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
58 utility formats the program sources specified as arguments
59 on the command line in a nice style using
61 Comments are placed in italics, keywords in bold face,
62 and the name of the current function is listed down the margin of each
63 page as it is encountered.
67 utility runs in two basic modes, filter mode (see the
69 option) or regular mode.
72 acts as a filter in a manner similar to
74 The standard input is passed directly to the standard output except
75 for lines bracketed by the
85 These lines are formatted as described above.
87 filter can be passed to
90 There need be no particular ordering with
97 accepts input files, processes them, and passes them to the postprocessor
104 passes any lines beginning with a decimal point without conversion.
109 forces input to be taken from standard input (default if
113 forces output to the (wide) Versatec printer rather than the (narrow)
116 specifies an alternate language definitions
118 .Pa /usr/share/misc/vgrindefs )
122 specifies a particular header to put on every output page (default is
125 specifies the language to use.
143 .Pq Fl l Ns Ar mod2 ,
145 .Pq Fl l Ns Ar yacc ,
152 .Pq Fl l Ns Ar perl .
154 forces no keyword bolding
158 to post-process the output,
161 .It Fl s Ar pointsize
162 specifies a point size to use on output (exactly the same as the argument
165 similar to the same option in
167 causing formatted text to go to the standard output
169 outputs the index file in a ``pretty'' format.
170 The index file itself is produced whenever
172 is run with a file called
174 in the current directory.
175 The index of function
176 definitions can then be run off by giving
185 .Bl -tag -width /usr/share/misc/vgrindefsxx -compact
187 file where source for index is created
188 .It Pa /usr/share/tmac/tmac.vgrind
190 .It Pa /usr/libexec/vfontedpr
192 .It Pa /usr/share/misc/vgrindefs
193 language descriptions
204 The vfontedpr preprocessor assumes that a certain programming style is
209 \- function names can be preceded on a line only by spaces, tabs, or an
211 The parenthesized arguments must also be on the same line.
215 \- function names need to appear on the same line as the keywords
222 \- function names need to appear on the same line as the keywords
225 If these conventions are not followed, the indexing and marginal function
226 name comment mechanisms will fail.
228 More generally, arbitrary formatting styles for programs mostly look bad.
229 The use of spaces to align source code fails miserably; if you plan to
231 your program you should use tabs.
232 This is somewhat inevitable since the
239 in recognizing functions should be used here.
241 Filter mode does not work in documents using the
246 (So what use is it anyway?)