version 1.3, 1998/10/30 00:24:42 |
version 1.4, 1999/06/05 01:21:46 |
|
|
.\" |
.\" |
.Dd June 6, 1993 |
.Dd June 6, 1993 |
.Dt VGRIND 1 |
.Dt VGRIND 1 |
.Os BSD 4 |
.Os |
.Sh NAME |
.Sh NAME |
.Nm vgrind |
.Nm vgrind |
.Nd grind nice listings of programs |
.Nd grind nice listings of programs |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm vgrind |
.Nm vgrind |
.Op Fl |
.Op Fl |
.Op Fl W |
.Op Fl W |
.Op Fl d Ar file |
.Op Fl d Ar file |
.Op Fl f |
.Op Fl f |
|
|
.Op Fl x |
.Op Fl x |
.Ar name Ar ... |
.Ar name Ar ... |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm vgrind |
.Nm |
formats the program sources which are arguments |
formats the program sources which are arguments |
in a nice style using |
in a nice style using |
.Xr troff 1 . |
.Xr troff 1 . |
Comments are placed in italics, keywords in bold face, |
Comments are placed in italics, keywords in bold face, |
and the name of the current function is listed down the margin of each |
and the name of the current function is listed down the margin of each |
page as it is encountered. |
page as it is encountered. |
.Pp |
.Pp |
.Nm vgrind |
.Nm |
runs in two basic modes, filter mode (see the |
runs in two basic modes, filter mode (see the |
.Fl f |
.Fl f |
option) or regular mode. In filter mode |
option) or regular mode. In filter mode |
.Nm vgrind |
.Nm |
acts as a filter in a manner similar to |
acts as a filter in a manner similar to |
.Xr tbl 1 . |
.Xr tbl 1 . |
The standard input is passed directly to the standard output except |
The standard input is passed directly to the standard output except |
for lines bracketed by the |
for lines bracketed by the |
.Em troff-like |
.Em troff-like |
macros: |
macros: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
|
|
.El |
.El |
.Pp |
.Pp |
These lines are formatted as described above. The output from this |
These lines are formatted as described above. The output from this |
filter can be passed to |
filter can be passed to |
.Xr troff 1 |
.Xr troff 1 |
for output. There need be no particular ordering with |
for output. There need be no particular ordering with |
.Xr eqn 1 |
.Xr eqn 1 |
or |
or |
.Xr tbl 1 . |
.Xr tbl 1 . |
.Pp |
.Pp |
In regular mode |
In regular mode |
.Nm vgrind |
.Nm |
accepts input files, processes them, and passes them to |
accepts input files, processes them, and passes them to |
.Xr troff 1 |
.Xr troff 1 |
for output. |
for output. |
.Pp |
.Pp |
In both modes |
In both modes |
.Nm vgrind |
.Nm |
passes any lines beginning with a decimal point without conversion. |
passes any lines beginning with a decimal point without conversion. |
.Pp |
.Pp |
The options are: |
The options are: |
.Bl -tag -width Ar |
.Bl -tag -width Ar |
.It Fl |
.It Fl |
Forces input to be taken from standard input (default if |
Forces input to be taken from standard input (default if |
.Fl f |
.Fl f |
is specified). |
is specified). |
|
|
.Xr troff 1 |
.Xr troff 1 |
causing formatted text to go to the standard output |
causing formatted text to go to the standard output |
.It Fl x |
.It Fl x |
Outputs the index file in a ``pretty'' format. |
Outputs the index file in a |
The index file itself is produced whenever |
.Dq pretty |
.Nm vgrind |
format. |
is run with a file called |
The index file itself is produced whenever |
|
.Nm |
|
is run with a file called |
.Pa index |
.Pa index |
in the current directory. |
in the current directory. |
The index of function |
The index of function |
definitions can then be run off by giving |
definitions can then be run off by giving |
.Nm vgrind |
.Nm |
the |
the |
.Fl x |
.Fl x |
option and the file |
option and the file |
|
|
.Sh BUGS |
.Sh BUGS |
vfontedpr assumes that a certain programming style is followed: |
vfontedpr assumes that a certain programming style is followed: |
.Pp |
.Pp |
For |
For |
.Tn C |
.Tn C |
\- function names can be preceded on a line only by spaces, tabs, or an |
\- function names can be preceded on a line only by spaces, tabs, or an |
asterisk. The parenthesized arguments must also be on the same line. |
asterisk. The parenthesized arguments must also be on the same line. |
|
|
.Pp |
.Pp |
More generally, arbitrary formatting styles for programs mostly look bad. |
More generally, arbitrary formatting styles for programs mostly look bad. |
The use of spaces to align source code fails miserably; if you plan to |
The use of spaces to align source code fails miserably; if you plan to |
.Nm vgrind |
.Nm |
your program you should use tabs. This is somewhat inevitable since the |
your program you should use tabs. This is somewhat inevitable since the |
font used by |
font used by |
.Nm vgrind |
.Nm |
is variable width. |
is variable width. |
.Pp |
.Pp |
The mechanism of |
The mechanism of |