2 .\" Copyright (c) 1980 Regents of the University
3 .\" of California. All rights reserved. The Berkeley software License Agreement
4 .\" specifies the terms and conditions for redistribution.
5 .\" Copyright (c) 2000, Sun Microsystems, Inc.
6 .\" All Rights Reserved
7 .TH VGRIND 1 "Mar 3, 2000"
9 vgrind \- grind nice program listings
13 \fBvgrind\fR [\fB-2fntwx\fR] [\fB-d\fR \fIdefs-file\fR] [\fB-h\fR \fIheader\fR] [\fB-l\fR \fIlanguage\fR]
14 [\fB-s\fR \fIn\fR] [\fB-o\fR \fIpagelist\fR] [\fB-P\fR \fIprinter\fR] [\fB-T\fR \fIoutput-device\fR] \fIfilename\fR...
20 The \fBvgrind\fR utility formats the program sources named by the
21 \fIfilename\fR arguments in a nice style using \fBtroff\fR(1). Comments are
22 placed in italics, keywords in bold face, and as each function is encountered
23 its name is listed on the page margin.
26 \fBvgrind\fR runs in two basic modes, filter mode or regular mode. In filter
27 mode, \fBvgrind\fR acts as a filter in a manner similar to \fBtbl\fR(1). The
28 standard input is passed directly to the standard output except for lines
29 bracketed by the \fBtroff\fR-like macros:
50 These lines are formatted as described above. The output from this filter can
51 be passed to \fBtroff\fR for output. There need be no particular ordering with
52 \fBeqn\fR(1) or \fBtbl\fR(1).
55 In regular mode, \fBvgrind\fR accepts input \fIfilename\fRs, processes them,
56 and passes them to \fBtroff\fR for output. Use a hyphen (`\fB\(mi\fR\&') to
57 specify standard input; otherwise, \fBvgrind\fR will exit without attempting to
58 read from the standard input. Filenames must be specified after all other
62 In regular mode, if the \fB-t\fR or \fB-P\fR option is specified, the output
68 emitted (in \fBtroff\fR format) to stdout if the \fB-t\fR option is specified.
74 printed (as PostScript) to the named printer if the \fB-P\fR option is
79 Otherwise, the output is:
84 printed (as PostScript) on the system default printer, if one is defined, and
85 the command's stdout is a tty.
91 emitted (as PostScript) to stdout if it is not a tty (that is, if stdout is a
92 pipe or a redirect to a file).
96 In both modes, \fBvgrind\fR passes any lines beginning with a decimal point
101 The following options are supported:
108 Produces two-column output. Specifying this option changes the default point
109 size to 8 (as if the \fB-s8\fR option were supplied). It also arranges for
110 output to appear in landscape mode.
128 Does not make keywords boldface.
137 Considers TAB characters to be spaced four columns apart instead of the usual
147 Outputs the index file in a "pretty" format. The index file itself is produced
148 whenever \fBvgrind\fR is run with a file called \fBindex\fR that is present in
149 the current directory. The index of function definitions can then be run off by
150 giving \fBvgrind\fR the \fB-x\fR option and the file \fBindex\fR as argument.
156 \fB\fB-d\fR \fIdefs-file\fR\fR
159 Specifies an alternate language definitions file (default is
160 \fB/usr/lib/vgrindefs\fR).
166 \fB\fB-h\fR \fIheader\fR\fR
169 Specifies a header to appear in the center of every output page. Use quotes to
170 specify headers with embedded spaces.
176 \fB\fB-l\fR \fIlanguage\fR\fR
179 Specifies the language to use. Among the \fIlanguage\fRs currently known are:
180 Bourne shell (\fB-lsh\fR), C (\fB-lc\fR, the default), C++ (\fB-lc++\fR), C
181 shell (\fB-lcsh\fR), emacs MLisp (\fB-lml\fR), FORTRAN (\fB-lf\fR), Icon
182 (\fB-lI\fR), ISP (\fB-i\fR), LDL (\fB-lLDL\fR), Model (\fB-lm\fR), Pascal
183 (\fB-lp\fR), and RATFOR (\fB-lr\fR).
189 \fB\fB-P\fR \fIprinter\fR\fR
192 Sends output to the named \fIprinter\fR.
198 \fB\fB-s\fR \fIn\fR\fR
201 Specifies a point size to use on output (exactly the same as the argument of a
202 \fBtroff\fR \fB\&.ps\fR point size request).
207 \fBvgrind\fR passes the following options to the formatter specified by the
208 \fBTROFF\fR environment variable. See ENVIRONMENT VARIABLES.
215 Similar to the same option in \fBtroff\fR; that is, formatted text goes to the
222 \fB\fB-o\fR \fIpagelist\fR\fR
225 Prints only those pages whose page numbers appear in the comma-separated
226 \fIpagelist\fR of numbers and ranges. A range \fIN\(miM\fR means pages \fIN\fR
227 through \fIM\fR; an initial \fB-N\fR means from the beginning to page \fIN\fR;
228 and a final \fIN\fR\(mi means from \fIN\fR to the end.
234 \fB\fB-T\fR \fIoutput-device\fR\fR
237 Formats output for the specified \fIoutput-device\fR.
243 The following operand is supported:
250 Name of the program source to be processed by \fBvgrind\fR. Use `\fB\(mi\fR\&'
251 to specify the standard input.
254 .SH ENVIRONMENT VARIABLES
257 In regular mode, \fBvgrind\fR feeds its intermediate output to the text
258 formatter given by the value of the \fBTROFF\fR environment variable, or to
259 \fB/usr/bin/troff\fR if this variable is not defined in the environment. This
260 mechanism allows for local variations in \fBtroff\fR's name.
269 file where source for index is created
275 \fB\fB/usr/lib/vgrindefs\fR\fR
279 language descriptions
285 \fB\fB/usr/lib/vfontedpr\fR\fR
295 \fB\fB/usr/share/lib/tmac/tmac.vgrind\fR\fR
305 \fBcsh\fR(1), \fBctags\fR(1), \fBeqn\fR(1), \fBtbl\fR(1), \fBtroff\fR(1),
306 \fBattributes\fR(5), \fBvgrindefs\fR(5)
310 \fBvgrind\fR assumes that a certain programming style is followed:
317 Function names can be preceded on a line only by SPACE, TAB, or an asterisk
318 (\fB*\fR). The parenthesized arguments must also be on the same line.
327 Function names need to appear on the same line as the keywords \fBfunction\fR
337 Function names should not appear on the same line as the preceding \fBdefun\fR.
346 Function names need to appear on the same line as the keywords \fBis
356 Function names need to appear on the same line as the keywords \fBfunction\fR
362 If these conventions are not followed, the indexing and marginal function name
363 comment mechanisms will fail.
366 More generally, arbitrary formatting styles for programs usually give unsightly
367 results. To prepare a program for \fBvgrind\fR output, use TAB rather than
368 SPACE characters to align source code properly, since \fBvgrind\fR uses
369 variable width fonts.
372 The mechanism of \fBctags\fR(1) in recognizing functions should be used here.
375 The \fB-w\fR option is annoying, but there is no other way to achieve the
379 The macros defined in \fBtmac.vgrind\fR do not coexist gracefully with those of
380 other macro packages, making filter mode difficult to use effectively.
383 \fBvgrind\fR does not process certain special characters in \fBcsh\fR(1)
387 The \fBtmac.vgrind\fR formatting macros wire in the page height and width used
388 in two-column mode, effectively making two column output useless for paper
389 sizes other than the standard American size of 8.5 inches by 11 inches. For
390 other paper sizes, it is necessary to edit the size values given in
391 \fBtmac.vgrind\fR. A better solution would be to create a \fBtroff\fR output
392 device specification intended specifically for landscape output and record size