148590Scael.\" Copyright (c) 1980 ,1990 The Regents of the University of California. 236167Sbostic.\" All rights reserved. 319324Smckusick.\" 4*56141Selan.\" Redistribution and use in source and binary forms, with or without 5*56141Selan.\" modification, are permitted provided that the following conditions 6*56141Selan.\" are met: 7*56141Selan.\" 1. Redistributions of source code must retain the above copyright 8*56141Selan.\" notice, this list of conditions and the following disclaimer. 9*56141Selan.\" 2. Redistributions in binary form must reproduce the above copyright 10*56141Selan.\" notice, this list of conditions and the following disclaimer in the 11*56141Selan.\" documentation and/or other materials provided with the distribution. 12*56141Selan.\" 3. All advertising materials mentioning features or use of this software 13*56141Selan.\" must display the following acknowledgement: 14*56141Selan.\" This product includes software developed by the University of 15*56141Selan.\" California, Berkeley and its contributors. 16*56141Selan.\" 4. Neither the name of the University nor the names of its contributors 17*56141Selan.\" may be used to endorse or promote products derived from this software 18*56141Selan.\" without specific prior written permission. 1919324Smckusick.\" 20*56141Selan.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21*56141Selan.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*56141Selan.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*56141Selan.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24*56141Selan.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*56141Selan.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*56141Selan.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*56141Selan.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*56141Selan.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*56141Selan.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*56141Selan.\" SUCH DAMAGE. 3136167Sbostic.\" 32*56141Selan.\" @(#)vgrind.1 6.5 (Berkeley) 8/6/92 33*56141Selan.\" 34*56141Selan.Dd August 6, 1992 3548590Scael.Dt VGRIND 1 3648590Scael.Os BSD 4 3748590Scael.Sh NAME 3848590Scael.Nm vgrind 3948590Scael.Nd grind nice listings of programs 4048590Scael.Sh SYNOPSIS 4148590Scael.Nm vgrind 4248590Scael.Op Fl 4348590Scael.Op Fl W 4448590Scael.Op Fl d Ar file 4548590Scael.Op Fl f 4648590Scael.Op Fl h Ar header 4748590Scael.Op Fl l Ar language 4848590Scael.Op Fl n 4948590Scael.Op Fl sn 5048590Scael.Op Fl t 5148590Scael.Op Fl x 5248590Scael.Ar name Ar ... 5348590Scael.Sh DESCRIPTION 5448590Scael.Nm Vgrind 5519325Smckusickformats the program sources which are arguments 5619324Smckusickin a nice style using 5748590Scael.Xr troff 1 5819325SmckusickComments are placed in italics, keywords in bold face, 5919324Smckusickand the name of the current function is listed down the margin of each 6019324Smckusickpage as it is encountered. 6148590Scael.Pp 6248590Scael.Nm Vgrind 6348590Scaelruns in two basic modes, filter mode (see the 6448590Scael.Fl f 6548590Scaeloption) or regular mode. In filter mode 6648590Scael.Nm vgrind 6719325Smckusickacts as a filter in a manner similar to 6848590Scael.Xr tbl 1 . 6919325SmckusickThe standard input is passed directly to the standard output except 7019325Smckusickfor lines bracketed by the 7148590Scael.Em troff-like 7219325Smckusickmacros: 7348590Scael.Bl -tag -width Ds 7448590Scael.It \&.vS 7548590Scaelstarts processing 7648590Scael.It \&.vE 7748590Scaelends processing 7848590Scael.El 7948590Scael.Pp 8019325SmckusickThese lines are formatted as described above. The output from this 8119325Smckusickfilter can be passed to 8248590Scael.Xr troff 8319325Smckusickfor output. There need be no particular ordering with 8448590Scael.Xr eqn 1 8519325Smckusickor 8648590Scael.Xr tbl 1 . 8748590Scael.Pp 8819325SmckusickIn regular mode 8948590Scael.Nm vgrind 9019325Smckusickaccepts input files, processes them, and passes them to 9148590Scael.Xr troff 1 9219325Smckusickfor output. 9348590Scael.Pp 9419325SmckusickIn both modes 9548590Scael.Nm vgrind 9619325Smckusickpasses any lines beginning with a decimal point without conversion. 9748590Scael.Pp 9819325SmckusickThe options are: 9948590Scael.Bl -tag -width Ar 10048590Scael.It Fl 10119325Smckusickforces input to be taken from standard input (default if 10248590Scael.Fl f 10319325Smckusickis specified ) 10448590Scael.It Fl W 10548590Scaelforces output to the (wide) Versatec printer rather than the (narrow) 10648590ScaelVarian 10748590Scael.It Fl d Ar file 10848590Scaelspecifies an alternate language definitions 10948590Scaelfile (default is 11048590Scael.Pa /usr/share/misc/vgrindefs ) 11148590Scael.It Fl f 11248590Scaelforces filter mode 11348590Scael.It Fl h Ar header 11448590Scaelspecifies a particular header to put on every output page (default is 11548590Scaelthe file name) 11648590Scael.It Fl l 11748590Scaelspecifies the language to use. Currently known are 11848590Scael.Tn PASCAL 11948590Scael.Pq Fl l Ns Ar p , 12048590Scael.Tn MODEL 12148590Scael.Pq Fl l Ns Ar m , 12248590ScaelC 12348590Scael.Pf ( Fl l Ns Ar c 12448590Scaelor the default), 12548590Scael.Tn CSH 12648590Scael.Pq Fl l Ns Ar csh , 12748590Scael.Tn SHELL 12848590Scael.Pq Fl l Ns Ar sh , 12948590Scael.Tn RATFOR 13048590Scael.Pq Fl l Ns Ar r , 13148590Scael.Tn MODULA2 13248590Scael.Pq Fl l Ns Ar mod2 , 13348590Scael.Tn YACC 13448590Scael.Pq Fl l Ns Ar yacc , 13548590Scael.Tn LISP 13648590Scael.Pq Fl l Ns Ar isp , 13748590Scaeland 13848590Scael.Tn ICON 13948590Scael.Pq Fl l Ns Ar I . 14048590Scael.It Fl n 14148590Scaelforces no keyword bolding 14248590Scael.It Fl s 14348590Scaelspecifies a point size to use on output (exactly the same as the argument 14448590Scaelof a .ps) 14548590Scael.It Fl t 14619325Smckusicksimilar to the same option in 14748590Scael.Xr troff 14819325Smckusickcausing formatted text to go to the standard output 14948590Scael.It Fl x 15019325Smckusickoutputs the index file in a ``pretty'' format. 15119325SmckusickThe index file itself is produced whenever 15248590Scael.Nm vgrind 15319325Smckusickis run with a file called 15448590Scael.Pa index 15519325Smckusickin the current directory. 15619325SmckusickThe index of function 15719325Smckusickdefinitions can then be run off by giving 15848590Scael.Nm vgrind 15919324Smckusickthe 16048590Scael.Fl x 16119324Smckusickoption and the file 16248590Scael.Pa index 16319324Smckusickas argument. 16448590Scael.El 16548590Scael.Sh FILES 16648590Scael.Bl -tag -width /usr/share/misc/vgrindefsxx -compact 16748590Scael.It Pa index 16848590Scaelfile where source for index is created 16948590Scael.It Pa /usr/share/tmac/tmac.vgrind 17048590Scaelmacro package 17148590Scael.It Pa /usr/libexec/vfontedpr 17248590Scaelpreprocessor 17348590Scael.It Pa /usr/share/misc/vgrindefs 17448590Scaellanguage descriptions 17548590Scael.El 17648590Scael.Sh SEE ALSO 177*56141Selan.Xr getcap 3 , 17848590Scael.Xr vgrindefs 5 17948590Scael.Sh BUGS 18019324SmckusickVfontedpr assumes that a certain programming style is followed: 18148590Scael.Pp 18219324SmckusickFor 18348590Scael.Tn C 18419325Smckusick\- function names can be preceded on a line only by spaces, tabs, or an 18519325Smckusickasterisk. The parenthesized arguments must also be on the same line. 18648590Scael.Pp 18719324SmckusickFor 18848590Scael.Tn PASCAL 18919325Smckusick\- function names need to appear on the same line as the keywords 19048590Scael.Em function 19119325Smckusickor 19248590Scael.Em procedure . 19348590Scael.Pp 19419324SmckusickFor 19548590Scael.Tn MODEL 19619325Smckusick\- function names need to appear on the same line as the keywords 19748590Scael.Em is beginproc . 19848590Scael.Pp 19919324SmckusickIf these conventions are not followed, the indexing and marginal function 20019324Smckusickname comment mechanisms will fail. 20148590Scael.Pp 20219324SmckusickMore generally, arbitrary formatting styles for programs mostly look bad. 20319324SmckusickThe use of spaces to align source code fails miserably; if you plan to 20448590Scael.Nm vgrind 20519324Smckusickyour program you should use tabs. This is somewhat inevitable since the 20619324Smckusickfont used by 20748590Scael.Nm vgrind 20819324Smckusickis variable width. 20948590Scael.Pp 21048590ScaelThe mechanism of 21148590Scael.Xr ctags 1 21248590Scaelin recognizing functions should be used here. 21348590Scael.Pp 21448590ScaelFilter mode does not work in documents using the 21548590Scael.Fl me 21648590Scaelor 21748590Scael.Fl ms 21848590Scaelmacros. 21927724Smckusick(So what use is it anyway?) 22048590Scael.Sh HISTORY 22148590ScaelThe 22248590Scael.Nm 22348590Scaelcommand appeared in 22448590Scael.Bx 3.0 . 225