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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)vgrind.1 8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD: src/usr.bin/vgrind/vgrind.1,v 1.7.2.3 2002/06/21 15:30:04 charnier Exp $
30 .\" $DragonFly: src/usr.bin/vgrind/vgrind.1,v 1.4 2006/04/17 18:01:38 swildner Exp $
37 .Nd grind nice listings of programs
45 .Op Fl l Ns Ar language
55 utility formats the program sources which are arguments
58 Comments are placed in italics, keywords in bold face,
59 and the name of the current function is listed down the margin of each
60 page as it is encountered.
64 utility runs in two basic modes, filter mode (see the
66 option) or regular mode. In filter mode
68 acts as a filter in a manner similar to
70 The standard input is passed directly to the standard output except
71 for lines bracketed by the
81 These lines are formatted as described above. The output from this
82 filter can be passed to
84 for output. There need be no particular ordering with
91 accepts input files, processes them, and passes them to the postprocessor
98 passes any lines beginning with a decimal point without conversion.
103 forces input to be taken from standard input (default if
107 forces output to the (wide) Versatec printer rather than the (narrow)
110 specifies an alternate language definitions
112 .Pa /usr/share/misc/vgrindefs )
116 specifies a particular header to put on every output page (default is
119 specifies the language to use. Currently known are
136 .Pq Fl l Ns Ar mod2 ,
138 .Pq Fl l Ns Ar yacc ,
145 .Pq Fl l Ns Ar perl .
147 forces no keyword bolding
151 to post-process the output,
155 specifies a point size to use on output (exactly the same as the argument
158 similar to the same option in
160 causing formatted text to go to the standard output
162 outputs the index file in a ``pretty'' format.
163 The index file itself is produced whenever
165 is run with a file called
167 in the current directory.
168 The index of function
169 definitions can then be run off by giving
178 .Bl -tag -width /usr/share/misc/vgrindefsxx -compact
180 file where source for index is created
181 .It Pa /usr/share/tmac/tmac.vgrind
183 .It Pa /usr/libexec/vfontedpr
185 .It Pa /usr/share/misc/vgrindefs
186 language descriptions
197 Vfontedpr assumes that a certain programming style is followed:
201 \- function names can be preceded on a line only by spaces, tabs, or an
202 asterisk. The parenthesized arguments must also be on the same line.
206 \- function names need to appear on the same line as the keywords
213 \- function names need to appear on the same line as the keywords
216 If these conventions are not followed, the indexing and marginal function
217 name comment mechanisms will fail.
219 More generally, arbitrary formatting styles for programs mostly look bad.
220 The use of spaces to align source code fails miserably; if you plan to
222 your program you should use tabs. This is somewhat inevitable since the
229 in recognizing functions should be used here.
231 Filter mode does not work in documents using the
236 (So what use is it anyway?)