manual page distributed with 4.2BSD
[unix-history] / usr / src / usr.bin / vgrind / vgrind.1
CommitLineData
9005ce62
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
4a9bc47c 5.\" @(#)vgrind.1 5.1 (Berkeley) %G%
9005ce62 6.\"
4a9bc47c 7.TH VGRIND 1 "3 August 1983"
9005ce62
KM
8.UC 4
9.SH NAME
10vgrind \- grind nice listings of programs
11.SH SYNOPSIS
12.B vgrind
13[
4a9bc47c
KM
14.B \-f
15] [
16.B \-
17] [
9005ce62
KM
18.B \-t
19] [
20.B \-n
21] [
22.B \-x
23] [
24.B \-W
25] [
9005ce62
KM
26.B \-sn
27] [
28.B \-h
29header
4a9bc47c
KM
30] [
31.B \-d
32file
33] [
34.BI \-l language
9005ce62
KM
35]
36name ...
37.SH DESCRIPTION
38.I Vgrind
4a9bc47c 39formats the program sources which are arguments
9005ce62 40in a nice style using
4a9bc47c
KM
41.IR troff (1)
42Comments are placed in italics, keywords in bold face,
9005ce62
KM
43and the name of the current function is listed down the margin of each
44page as it is encountered.
45.PP
4a9bc47c
KM
46.I Vgrind
47runs in two basic modes, filter mode or regular mode. In filter mode
48.I vgrind
49acts as a filter in a manner similar to
50.IR tbl (1).
51The standard input is passed directly to the standard output except
52for lines bracketed by the
53.I troff-like
54macros:
55.IP .vS
56- starts processing
57.IP .vE
58- ends processing
59.LP
60These lines are formatted as described above. The output from this
61filter can be passed to
62.I troff
63for output. There need be no particular ordering with
64.IR eqn (1)
65or
66.IR tbl (1).
9005ce62 67.PP
4a9bc47c
KM
68In regular mode
69.I vgrind
70accepts input files, processes them, and passes them to
9005ce62 71.IR troff (1)
4a9bc47c 72for output.
9005ce62 73.PP
4a9bc47c
KM
74In both modes
75.I vgrind
76passes any lines beginning with a decimal point without conversion.
77.PP
78The options are:
79.IP \fB\-f\fP
80forces filter mode
81.IP \fB\-\fP
82forces input to be taken from standard input (default if
83.B \fB\-f\fP
84is specified )
85.IP \fB\-t\fP
86similar to the same option in
87.I troff
88causing formatted text to go to the standard output
89.IP \fB\-n\fP
90forces no keyword bolding
91.IP \fB\-x\fP
92outputs the index file in a ``pretty'' format.
93The index file itself is produced whenever
9005ce62 94.I vgrind
4a9bc47c
KM
95is run with a file called
96.I index
97in the current directory.
98The index of function
99definitions can then be run off by giving
100.I vgrind
9005ce62
KM
101the
102.B \-x
103option and the file
104.I index
105as argument.
4a9bc47c
KM
106.IP \fB\-W\fP
107forces output to the (wide) Versatec printer rather than the (narrow)
108Varian
109.IP \fB\-s\fP
110specifies a point size to use on output (exactly the same as the argument
111of a .ps)
112.IP \fB\-h\fP
113specifies a particular header to put on every output page (default is
114the file name)
115.IP \fB\-d\fP
116specifies an alternate language definitions
117file (default is /usr/lib/vgrindefs)
118.IP \fB\-l\fP
119specifies the language to use. Currently known are PASCAL
120.RB ( \-lp ),
121MODEL
122.RB ( \-lm ), C
123.RB ( \-lc
124or the default), CSH
125.RB ( \-lcsh ),
126SHELL
127.RB ( \-lsh ),
128RATFOR
129.RB ( \-lr ),
130and ICON
131.RB ( \-lI ).
9005ce62
KM
132.SH FILES
133.ta 2i
134index file where source for index is created
135.br
136/usr/lib/tmac/tmac.vgrind macro package
137.br
138/usr/lib/vfontedpr preprocessor
4a9bc47c
KM
139.br
140/usr/lib/vgrindefs language descriptions
9005ce62 141.SH AUTHOR
4a9bc47c 142Dave Presotto & William Joy
9005ce62 143.SH SEE ALSO
4a9bc47c
KM
144vlp(1),
145vtroff(1),
146vgrindefs(5)
9005ce62
KM
147.SH BUGS
148Vfontedpr assumes that a certain programming style is followed:
149.PP
150For
151.B C
4a9bc47c
KM
152\- function names can be preceded on a line only by spaces, tabs, or an
153asterisk. The parenthesized arguments must also be on the same line.
9005ce62
KM
154.PP
155For
156.B PASCAL
4a9bc47c 157\- function names need to appear on the same line as the keywords
9005ce62 158.I function
4a9bc47c 159or
9005ce62 160.I procedure.
9005ce62
KM
161.PP
162For
163.B MODEL
4a9bc47c 164\- function names need to appear on the same line as the keywords
9005ce62
KM
165.I is
166.I beginproc.
167.PP
168If these conventions are not followed, the indexing and marginal function
169name comment mechanisms will fail.
170.sp
171More generally, arbitrary formatting styles for programs mostly look bad.
172The use of spaces to align source code fails miserably; if you plan to
173.I vgrind
174your program you should use tabs. This is somewhat inevitable since the
175font used by
176.I vgrind
177is variable width.
178.PP
9005ce62 179The mechanism of ctags in recognizing functions should be used here.