1*48590Scael.\" Copyright (c) 1980 ,1990 The Regents of the University of California. 236167Sbostic.\" All rights reserved. 319324Smckusick.\" 4*48590Scael.\" %sccs.include.redist.roff% 519324Smckusick.\" 6*48590Scael.\" @(#)vgrind.1 6.4 (Berkeley) 04/23/91 736167Sbostic.\" 8*48590Scael.Dd 9*48590Scael.Dt VGRIND 1 10*48590Scael.Os BSD 4 11*48590Scael.Sh NAME 12*48590Scael.Nm vgrind 13*48590Scael.Nd grind nice listings of programs 14*48590Scael.Sh SYNOPSIS 15*48590Scael.Nm vgrind 16*48590Scael.Op Fl 17*48590Scael.Op Fl W 18*48590Scael.Op Fl d Ar file 19*48590Scael.Op Fl f 20*48590Scael.Op Fl h Ar header 21*48590Scael.Op Fl l Ar language 22*48590Scael.Op Fl n 23*48590Scael.Op Fl sn 24*48590Scael.Op Fl t 25*48590Scael.Op Fl x 26*48590Scael.Ar name Ar ... 27*48590Scael.Sh DESCRIPTION 28*48590Scael.Nm Vgrind 2919325Smckusickformats the program sources which are arguments 3019324Smckusickin a nice style using 31*48590Scael.Xr troff 1 3219325SmckusickComments are placed in italics, keywords in bold face, 3319324Smckusickand the name of the current function is listed down the margin of each 3419324Smckusickpage as it is encountered. 35*48590Scael.Pp 36*48590Scael.Nm Vgrind 37*48590Scaelruns in two basic modes, filter mode (see the 38*48590Scael.Fl f 39*48590Scaeloption) or regular mode. In filter mode 40*48590Scael.Nm vgrind 4119325Smckusickacts as a filter in a manner similar to 42*48590Scael.Xr tbl 1 . 4319325SmckusickThe standard input is passed directly to the standard output except 4419325Smckusickfor lines bracketed by the 45*48590Scael.Em troff-like 4619325Smckusickmacros: 47*48590Scael.Bl -tag -width Ds 48*48590Scael.It \&.vS 49*48590Scaelstarts processing 50*48590Scael.It \&.vE 51*48590Scaelends processing 52*48590Scael.El 53*48590Scael.Pp 5419325SmckusickThese lines are formatted as described above. The output from this 5519325Smckusickfilter can be passed to 56*48590Scael.Xr troff 5719325Smckusickfor output. There need be no particular ordering with 58*48590Scael.Xr eqn 1 5919325Smckusickor 60*48590Scael.Xr tbl 1 . 61*48590Scael.Pp 6219325SmckusickIn regular mode 63*48590Scael.Nm vgrind 6419325Smckusickaccepts input files, processes them, and passes them to 65*48590Scael.Xr troff 1 6619325Smckusickfor output. 67*48590Scael.Pp 6819325SmckusickIn both modes 69*48590Scael.Nm vgrind 7019325Smckusickpasses any lines beginning with a decimal point without conversion. 71*48590Scael.Pp 7219325SmckusickThe options are: 73*48590Scael.Bl -tag -width Ar 74*48590Scael.It Fl 7519325Smckusickforces input to be taken from standard input (default if 76*48590Scael.Fl f 7719325Smckusickis specified ) 78*48590Scael.It Fl W 79*48590Scaelforces output to the (wide) Versatec printer rather than the (narrow) 80*48590ScaelVarian 81*48590Scael.It Fl d Ar file 82*48590Scaelspecifies an alternate language definitions 83*48590Scaelfile (default is 84*48590Scael.Pa /usr/share/misc/vgrindefs ) 85*48590Scael.It Fl f 86*48590Scaelforces filter mode 87*48590Scael.It Fl h Ar header 88*48590Scaelspecifies a particular header to put on every output page (default is 89*48590Scaelthe file name) 90*48590Scael.It Fl l 91*48590Scaelspecifies the language to use. Currently known are 92*48590Scael.Tn PASCAL 93*48590Scael.Pq Fl l Ns Ar p , 94*48590Scael.Tn MODEL 95*48590Scael.Pq Fl l Ns Ar m , 96*48590ScaelC 97*48590Scael.Pf ( Fl l Ns Ar c 98*48590Scaelor the default), 99*48590Scael.Tn CSH 100*48590Scael.Pq Fl l Ns Ar csh , 101*48590Scael.Tn SHELL 102*48590Scael.Pq Fl l Ns Ar sh , 103*48590Scael.Tn RATFOR 104*48590Scael.Pq Fl l Ns Ar r , 105*48590Scael.Tn MODULA2 106*48590Scael.Pq Fl l Ns Ar mod2 , 107*48590Scael.Tn YACC 108*48590Scael.Pq Fl l Ns Ar yacc , 109*48590Scael.Tn LISP 110*48590Scael.Pq Fl l Ns Ar isp , 111*48590Scaeland 112*48590Scael.Tn ICON 113*48590Scael.Pq Fl l Ns Ar I . 114*48590Scael.It Fl n 115*48590Scaelforces no keyword bolding 116*48590Scael.It Fl s 117*48590Scaelspecifies a point size to use on output (exactly the same as the argument 118*48590Scaelof a .ps) 119*48590Scael.It Fl t 12019325Smckusicksimilar to the same option in 121*48590Scael.Xr troff 12219325Smckusickcausing formatted text to go to the standard output 123*48590Scael.It Fl x 12419325Smckusickoutputs the index file in a ``pretty'' format. 12519325SmckusickThe index file itself is produced whenever 126*48590Scael.Nm vgrind 12719325Smckusickis run with a file called 128*48590Scael.Pa index 12919325Smckusickin the current directory. 13019325SmckusickThe index of function 13119325Smckusickdefinitions can then be run off by giving 132*48590Scael.Nm vgrind 13319324Smckusickthe 134*48590Scael.Fl x 13519324Smckusickoption and the file 136*48590Scael.Pa index 13719324Smckusickas argument. 138*48590Scael.El 139*48590Scael.Sh FILES 140*48590Scael.Bl -tag -width /usr/share/misc/vgrindefsxx -compact 141*48590Scael.It Pa index 142*48590Scaelfile where source for index is created 143*48590Scael.It Pa /usr/share/tmac/tmac.vgrind 144*48590Scaelmacro package 145*48590Scael.It Pa /usr/libexec/vfontedpr 146*48590Scaelpreprocessor 147*48590Scael.It Pa /usr/share/misc/vgrindefs 148*48590Scaellanguage descriptions 149*48590Scael.El 150*48590Scael.Sh SEE ALSO 151*48590Scael.Xr vlp 1 , 152*48590Scael.Xr vtroff 1 , 153*48590Scael.Xr vgrindefs 5 154*48590Scael.Sh BUGS 15519324SmckusickVfontedpr assumes that a certain programming style is followed: 156*48590Scael.Pp 15719324SmckusickFor 158*48590Scael.Tn C 15919325Smckusick\- function names can be preceded on a line only by spaces, tabs, or an 16019325Smckusickasterisk. The parenthesized arguments must also be on the same line. 161*48590Scael.Pp 16219324SmckusickFor 163*48590Scael.Tn PASCAL 16419325Smckusick\- function names need to appear on the same line as the keywords 165*48590Scael.Em function 16619325Smckusickor 167*48590Scael.Em procedure . 168*48590Scael.Pp 16919324SmckusickFor 170*48590Scael.Tn MODEL 17119325Smckusick\- function names need to appear on the same line as the keywords 172*48590Scael.Em is beginproc . 173*48590Scael.Pp 17419324SmckusickIf these conventions are not followed, the indexing and marginal function 17519324Smckusickname comment mechanisms will fail. 176*48590Scael.Pp 17719324SmckusickMore generally, arbitrary formatting styles for programs mostly look bad. 17819324SmckusickThe use of spaces to align source code fails miserably; if you plan to 179*48590Scael.Nm vgrind 18019324Smckusickyour program you should use tabs. This is somewhat inevitable since the 18119324Smckusickfont used by 182*48590Scael.Nm vgrind 18319324Smckusickis variable width. 184*48590Scael.Pp 185*48590ScaelThe mechanism of 186*48590Scael.Xr ctags 1 187*48590Scaelin recognizing functions should be used here. 188*48590Scael.Pp 189*48590ScaelFilter mode does not work in documents using the 190*48590Scael.Fl me 191*48590Scaelor 192*48590Scael.Fl ms 193*48590Scaelmacros. 19427724Smckusick(So what use is it anyway?) 195*48590Scael.Sh HISTORY 196*48590ScaelThe 197*48590Scael.Nm 198*48590Scaelcommand appeared in 199*48590Scael.Bx 3.0 . 200