]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/vgrind/vgrind.1
This commit was generated by cvs2svn to compensate for changes in r78986,
[FreeBSD/FreeBSD.git] / usr.bin / vgrind / vgrind.1
1 .\" Copyright (c) 1980, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
19 .\"
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
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)vgrind.1    8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD$
34 .\"
35 .Dd June 6, 1993
36 .Dt VGRIND 1
37 .Os BSD 4
38 .Sh NAME
39 .Nm vgrind
40 .Nd grind nice listings of programs
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl 
44 .Op Fl W
45 .Op Fl d Ar file
46 .Op Fl f
47 .Op Fl h Ar header
48 .Op Fl l Ns Ar language
49 .Op Fl n
50 .Op Fl p Ar postproc
51 .Op Fl sn
52 .Op Fl t
53 .Op Fl x
54 .Ar name Ar ...
55 .Sh DESCRIPTION
56 .Nm Vgrind
57 formats the program sources which are arguments 
58 in a nice style using
59 .Xr troff 1
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.
63 .Pp
64 .Nm Vgrind
65 runs in two basic modes, filter mode (see the
66 .Fl f
67 option) or regular mode.  In filter mode 
68 .Nm
69 acts as a filter in a manner similar to
70 .Xr tbl 1 .
71 The standard input is passed directly to the standard output except
72 for lines bracketed by the 
73 .Em troff-like
74 macros:
75 .Bl -tag -width Ds
76 .It \&.vS
77 starts processing
78 .It \&.vE
79 ends processing
80 .El
81 .Pp
82 These lines are formatted as described above.  The output from this
83 filter can be passed to 
84 .Xr troff
85 for output.  There need be no particular ordering with 
86 .Xr eqn 1
87 or
88 .Xr tbl 1 .
89 .Pp
90 In regular mode 
91 .Nm
92 accepts input files, processes them, and passes them to the postprocessor
93 for output,
94 .Xr psroff 1
95 by default.  
96 .Pp
97 In both modes 
98 .Nm
99 passes any lines beginning with a decimal point without conversion.
100 .Pp
101 The options are:
102 .Bl -tag -width Ar
103 .It Fl 
104 forces input to be taken from standard input (default if
105 .Fl f
106 is specified )
107 .It Fl W
108 forces output to the (wide) Versatec printer rather than the (narrow)
109 Varian
110 .It Fl d Ar file
111 specifies an alternate language definitions
112 file (default is
113 .Pa /usr/share/misc/vgrindefs )
114 .It Fl f
115 forces filter mode
116 .It Fl h Ar header
117 specifies a particular header to put on every output page (default is
118 the file name)
119 .It Fl l
120 specifies the language to use.  Currently known are
121 .Tn PASCAL
122 .Pq Fl l Ns Ar p ,
123 .Tn MODEL
124 .Pq Fl l Ns Ar m ,
125 C
126 .Pf ( Fl l Ns Ar c
127 or the default),
128 .Tn C++
129 .Pq Fl l Ns Ar c++ ,
130 .Tn CSH
131 .Pq Fl l Ns Ar csh ,
132 .Tn SHELL
133 .Pq Fl l Ns Ar sh ,
134 .Tn RATFOR
135 .Pq Fl l Ns Ar r ,
136 .Tn MODULA2
137 .Pq Fl l Ns Ar mod2 ,
138 .Tn YACC
139 .Pq Fl l Ns Ar yacc ,
140 .Tn LISP
141 .Pq Fl l Ns Ar isp ,
142 .Tn ICON
143 .Pq Fl l Ns Ar I ,
144 and
145 .Tn PERL
146 .Pq Fl l Ns Ar perl .
147 .It Fl n
148 forces no keyword bolding
149 .It Fl p Ar postproc
150 use
151 .Ar postproc
152 to post-process the output,
153 .Xr psroff 1
154 by default.
155 .It Fl s
156 specifies a point size to use on output (exactly the same as the argument
157 of a .ps)
158 .It Fl t
159 similar to the same option in
160 .Xr troff
161 causing formatted text to go to the standard output
162 .It Fl x
163 outputs the index file in a ``pretty'' format. 
164 The index file itself is produced whenever 
165 .Nm
166 is run with a file called 
167 .Pa index
168 in the current directory.
169 The index of function
170 definitions can then be run off by giving 
171 .Nm
172 the
173 .Fl x
174 option and the file
175 .Pa index
176 as argument.
177 .El
178 .Sh FILES
179 .Bl -tag -width /usr/share/misc/vgrindefsxx -compact
180 .It Pa index
181 file where source for index is created
182 .It Pa /usr/share/tmac/tmac.vgrind
183 macro package
184 .It Pa /usr/libexec/vfontedpr
185 preprocessor
186 .It Pa /usr/share/misc/vgrindefs
187 language descriptions
188 .El
189 .Sh SEE ALSO
190 .Xr getcap 3 ,
191 .Xr vgrindefs 5
192 .Sh BUGS
193 Vfontedpr assumes that a certain programming style is followed:
194 .Pp
195 For 
196 .Tn C
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.
199 .Pp
200 For
201 .Tn PASCAL
202 \- function names need to appear on the same line as the keywords
203 .Em function
204 or
205 .Em procedure .
206 .Pp
207 For
208 .Tn MODEL
209 \- function names need to appear on the same line as the keywords
210 .Em is beginproc .
211 .Pp
212 If these conventions are not followed, the indexing and marginal function
213 name comment mechanisms will fail.
214 .Pp
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
217 .Nm
218 your program you should use tabs.  This is somewhat inevitable since the
219 font used by
220 .Nm
221 is variable width.
222 .Pp
223 The mechanism of
224 .Xr ctags 1
225 in recognizing functions should be used here.
226 .Pp
227 Filter mode does not work in documents using the
228 .Fl me
229 or
230 .Fl ms
231 macros.
232 (So what use is it anyway?)
233 .Sh HISTORY
234 The
235 .Nm
236 command appeared in
237 .Bx 3.0 .