1 .\" @(#)psgrind.l 1.1 09/15/87 2 .TH PSGRIND 1 3 .ds PS P\s-2OST\s+2S\s-2CRIPT\s+2 4 .SH NAME 5 psgrind \- convert C source files to P\s-2OST\s+2S\s-2CRIPT\s+2 format for printing 6 .SH SYNOPSIS 7 .B psgrind 8 [ 9 .I options 10 ] [ 11 .I files 12 ] 13 .SH DESCRIPTION 14 .I psgrind 15 reads in C source files, converts them to \*(PS format, and spools them for 16 printing on a \*(PS printer. The different fonts used for the different 17 syntactic elements of C source code may be specified on the command line. 18 .I Psgrind 19 is also much faster than any other grind program since it outputs a 20 direct printer language without going through a normal document formatter 21 as other pretty source printers must. 22 .sp 23 The five syntactic categories that 24 .I psgrind 25 recognizes and displays in different ways are page headings (which are 26 actually not part of the C source code), the ``body'' or main text, 27 keywords, which are C reserved words, literal strings and comments. 28 Normally, the heading and keywords are set in a bold Helvetica font, 29 the comments in a slanted Helvetica font, the body in a normal Helvetica 30 font and literal strings and character constants in Courier font. 31 .sp 32 All the above fonts may be changed, see the 33 .BR \-H , 34 .BR \-B , 35 .BR \-K , 36 .BR \-L 37 and 38 .B -C 39 options. 40 All these options take as their argument a font specfication. 41 These font specifications have two parts: 42 A font name as known to \*(PS (e.g., Times-Roman, Times-BoldItalic, 43 Helvetica, Courier), and a 44 point size (1 point = 1/72 inch\-8 point is a good small font). 45 So ``Courier-Bold8'' is 8 point Courier Bold, ``Helvetica12'' is 12 point 46 Helvetica. 47 .sp 48 The environment variable PSGRIND may be used to specify defaults. The 49 value of PSGRIND is parsed as a string of arguments 50 .I before 51 the arguments 52 that appear on the command line. For example setting the 53 environment variable PSGRIND to the string ``-B Times-Roman12'' 54 sets your default body font to 12 point Times Roman. 55 .sp 56 The possible options are: 57 .TP 58 .B \-2 59 Sets two column mode. 60 .TP 61 .B \-1 62 Force one column mode. 63 .TP 64 .B \-g 65 Causes the fact that a file is garbage to be ignored. Normally, any file 66 with more than a small number of non-printing characters is suspected of 67 being garbage, and not printed\-this option means ``print it anyway.'' 68 .TP 69 .B \-o 70 If 71 .I psgrind 72 cannot find characters in a font, the missing characters are listed. 73 .TP 74 .BI \-p " file" 75 Causes the \*(PS file to be written to the named file rather than 76 being spooled for printing. As a special case, 77 .B \-p 78 .B \- 79 will send the \*(PS to the standard output. 80 .TP 81 .B \-r 82 Causes the output to be rotated 90 degrees on the page (landscape mode). 83 This is good for output that requires a wide page or for program listings 84 when used in conjunction with two column mode. 85 ``psgrind -2r 86 .IR files '' 87 is a nice way to get program listings. 88 .TP 89 .B \-R 90 Force portrait (non-rotated) mode. 91 .TP 92 .B \-k 93 Enable page prefeed (if the printer supports it). This allows 94 simple documents (e.g., program listings in one font) 95 to print somewhat faster by keeping the printer 96 running between pages. 97 .TP 98 .BI \-s " pagespec" 99 Allows you to specify a range (or several ranges) of pages to be printed. 100 .I Pagespec 101 is a string, not containing spaces, of the form ``pagerange[,pagespec]''. 102 .I Pagerange 103 may be a single page number or a range 104 of the form ``N-M'' which means print pages N through M. 105 -N means print from the beginning of the docment to page N. 106 M- means print from page M to the end of the document. 107 .TP 108 .BI \-H " font" 109 This allows the respecification of the font used to print running 110 titles listing the source file name and current page number. 111 The option argument to 112 .BR \-H , 113 and the other font options, 114 should be a font specification as described above. 115 .TP 116 .BI \-B " font" 117 This allows one to respecify the font to be used for the main body 118 of the source, that not set specially in another font. 119 .TP 120 .BI \-K " font" 121 This option allows the respecification of the font used to show 122 keywords as separate from normal body text. 123 .TP 124 .BI \-L " font" 125 This option allows the respecification of the font used to show 126 string and character constants (literals) separate from normal body text. 127 .TP 128 .BI \-C " font" 129 This option respecifies the font used to print comment text to 130 show its separateness from normal text. 131 .PP 132 The following options are passed on as is to 133 .I lpr. 134 .TP 135 .BI \-P printer 136 Causes the output to be sent to the named printer. 137 .TP 138 .BI \-# n 139 Causes n copies of the output to be produced. The default is one. 140 .TP 141 .B \-m 142 Causes the printer daemon to send mail upon job completion. 143 .TP 144 .B \-h 145 Suppress the printing of the burst page. 146 .TP 147 .BI \-J " name" 148 Set the job name for use on the burst page. Otherwise, the name of the 149 first input file will be used. 150 .SH ENVIRONMENT 151 .PP 152 .IP PSGRIND 153 string of options to be used by 154 .I psgrind. 155 .IP METRICS 156 path name of a directory to use instead of 157 /usr/lib/ps for font metric files. 158 .IP PRINTER 159 the name of a printer (as in the 160 .B \-P 161 option) for 162 .I lpr 163 to use. If no 164 .B \-P 165 option is specified, 166 .I lpr 167 will use this printer. If 168 .B \-P 169 is not specified and 170 PRINTER is not defined in the environment, 171 .I psgrind 172 will spool to a printer named ``PostScript''. 173 .SH FILES 174 .TP 2.2i 175 /usr/local/lib/ps/*.afm 176 font metrics files. 177 .TP 178 /usr/local/lib/ps/psgrind.pro 179 prologue for 180 .I psgrind 181 \*(PS files. 182 .TP 183 lpr 184 Printer spooler 185 .br 186 .SH "SEE ALSO" 187 enscript(1), lpr(1) 188 .SH AUTHOR 189 John Coker, 190 .br 191 University of California, Berkeley 192 .br 193 This code is based on the 194 .I enscript 195 utility from Adobe Systems, Inc. 196 .fi 197 .SH BUGS 198 If you give the 199 .B \-p 200 argument after the file to be converted, 201 .I psgrind 202 will lie and tell you that the file has been put in the right 203 place, when in fact it is in some obscure temporary file. Always give 204 the 205 .B \-p 206 argument first. 207 .sp 208 Long lines are not truncated in 2 column mode. Line truncation may be 209 off by a little bit as printer margins vary. There should be a 210 ``wrap'' option and multiple (truncated or wrapped) columns. 211 .sp 212 .I Psgrind 213 generates temporary files which are spooled for printing. The temporary file 214 names are used by the spooling software (e.g., 215 .IR lpq ), 216 rather than the symbolic job name passed to 217 .IR lpr . 218 .SH NOTES 219 \*(PS is a trademark of Adobe Systems, Incorporated. 220 .br 221 Times is a trademark of Allied Corporation. 222 .br 223 Helvetica is a registered trademark of Allied Corporation. 224