1 .\" Copyright (c) 1980, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)vgrind.1 8.1 (Berkeley) 6/6/93
40 .Nd grind nice listings of programs
48 .Op Fl l Ns Ar language
57 formats the program sources which are arguments
60 Comments are placed in italics, keywords in bold face,
61 and the name of the current function is listed down the margin of each
62 page as it is encountered.
65 runs in two basic modes, filter mode (see the
67 option) or regular mode. In filter mode
69 acts as a filter in a manner similar to
71 The standard input is passed directly to the standard output except
72 for lines bracketed by the
82 These lines are formatted as described above. The output from this
83 filter can be passed to
85 for output. There need be no particular ordering with
92 accepts input files, processes them, and passes them to the postprocessor
99 passes any lines beginning with a decimal point without conversion.
104 forces input to be taken from standard input (default if
108 forces output to the (wide) Versatec printer rather than the (narrow)
111 specifies an alternate language definitions
113 .Pa /usr/share/misc/vgrindefs )
117 specifies a particular header to put on every output page (default is
120 specifies the language to use. Currently known are
137 .Pq Fl l Ns Ar mod2 ,
139 .Pq Fl l Ns Ar yacc ,
146 .Pq Fl l Ns Ar perl .
148 forces no keyword bolding
152 to post-process the output,
156 specifies a point size to use on output (exactly the same as the argument
159 similar to the same option in
161 causing formatted text to go to the standard output
163 outputs the index file in a ``pretty'' format.
164 The index file itself is produced whenever
166 is run with a file called
168 in the current directory.
169 The index of function
170 definitions can then be run off by giving
179 .Bl -tag -width /usr/share/misc/vgrindefsxx -compact
181 file where source for index is created
182 .It Pa /usr/share/tmac/tmac.vgrind
184 .It Pa /usr/libexec/vfontedpr
186 .It Pa /usr/share/misc/vgrindefs
187 language descriptions
193 Vfontedpr assumes that a certain programming style is followed:
197 \- function names can be preceded on a line only by spaces, tabs, or an
198 asterisk. The parenthesized arguments must also be on the same line.
202 \- function names need to appear on the same line as the keywords
209 \- function names need to appear on the same line as the keywords
212 If these conventions are not followed, the indexing and marginal function
213 name comment mechanisms will fail.
215 More generally, arbitrary formatting styles for programs mostly look bad.
216 The use of spaces to align source code fails miserably; if you plan to
218 your program you should use tabs. This is somewhat inevitable since the
225 in recognizing functions should be used here.
227 Filter mode does not work in documents using the
232 (So what use is it anyway?)