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