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