1994-05-27 12:33:43 +00:00
|
|
|
.\" Copyright (c) 1980, 1990, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2017-02-28 23:42:47 +00:00
|
|
|
.\" 3. Neither the name of the University nor the names of its contributors
|
1994-05-27 12:33:43 +00:00
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)vgrind.1 8.1 (Berkeley) 6/6/93
|
|
|
|
.\"
|
2006-08-29 18:11:20 +00:00
|
|
|
.Dd August 29, 2006
|
1994-05-27 12:33:43 +00:00
|
|
|
.Dt VGRIND 1
|
2001-07-10 14:16:33 +00:00
|
|
|
.Os
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm vgrind
|
|
|
|
.Nd grind nice listings of programs
|
|
|
|
.Sh SYNOPSIS
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
2001-07-15 08:06:20 +00:00
|
|
|
.Op Fl
|
1994-05-27 12:33:43 +00:00
|
|
|
.Op Fl W
|
|
|
|
.Op Fl d Ar file
|
|
|
|
.Op Fl f
|
|
|
|
.Op Fl h Ar header
|
1996-10-21 18:04:42 +00:00
|
|
|
.Op Fl l Ns Ar language
|
1994-05-27 12:33:43 +00:00
|
|
|
.Op Fl n
|
1996-10-21 18:04:42 +00:00
|
|
|
.Op Fl p Ar postproc
|
2006-08-29 18:11:20 +00:00
|
|
|
.Op Fl s Ar pointsize
|
1994-05-27 12:33:43 +00:00
|
|
|
.Op Fl t
|
|
|
|
.Op Fl x
|
|
|
|
.Ar name Ar ...
|
|
|
|
.Sh DESCRIPTION
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2006-08-29 18:11:20 +00:00
|
|
|
utility formats the program sources specified as arguments
|
|
|
|
on the command line in a nice style using
|
2022-08-15 20:14:15 +00:00
|
|
|
.Xr troff 1 Pq Pa ports/textproc/groff .
|
1994-05-27 12:33:43 +00:00
|
|
|
Comments are placed in italics, keywords in bold face,
|
|
|
|
and the name of the current function is listed down the margin of each
|
|
|
|
page as it is encountered.
|
|
|
|
.Pp
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility runs in two basic modes, filter mode (see the
|
1994-05-27 12:33:43 +00:00
|
|
|
.Fl f
|
2004-07-02 22:22:35 +00:00
|
|
|
option) or regular mode.
|
|
|
|
In filter mode
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
acts as a filter in a manner similar to
|
|
|
|
.Xr tbl 1 .
|
|
|
|
The standard input is passed directly to the standard output except
|
2001-07-15 08:06:20 +00:00
|
|
|
for lines bracketed by the
|
1994-05-27 12:33:43 +00:00
|
|
|
.Em troff-like
|
|
|
|
macros:
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It \&.vS
|
|
|
|
starts processing
|
|
|
|
.It \&.vE
|
|
|
|
ends processing
|
|
|
|
.El
|
|
|
|
.Pp
|
2004-07-02 22:22:35 +00:00
|
|
|
These lines are formatted as described above.
|
|
|
|
The output from this
|
2001-07-15 08:06:20 +00:00
|
|
|
filter can be passed to
|
2022-08-15 20:14:15 +00:00
|
|
|
.Xr troff 1 Pq Pa ports/textproc/groff
|
2004-07-02 22:22:35 +00:00
|
|
|
for output.
|
|
|
|
There need be no particular ordering with
|
2022-08-15 20:14:15 +00:00
|
|
|
.Xr eqn 1 Pq Pa ports/textproc/groff
|
1994-05-27 12:33:43 +00:00
|
|
|
or
|
2022-08-15 20:14:15 +00:00
|
|
|
.Xr tbl 1 Pq Pa ports/textproc/groff .
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
2001-07-15 08:06:20 +00:00
|
|
|
In regular mode
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
1996-09-08 18:23:53 +00:00
|
|
|
accepts input files, processes them, and passes them to the postprocessor
|
|
|
|
for output,
|
|
|
|
.Xr psroff 1
|
2001-07-15 08:06:20 +00:00
|
|
|
by default.
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
2001-07-15 08:06:20 +00:00
|
|
|
In both modes
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
passes any lines beginning with a decimal point without conversion.
|
|
|
|
.Pp
|
|
|
|
The options are:
|
|
|
|
.Bl -tag -width Ar
|
2001-07-15 08:06:20 +00:00
|
|
|
.It Fl
|
1994-05-27 12:33:43 +00:00
|
|
|
forces input to be taken from standard input (default if
|
|
|
|
.Fl f
|
2001-08-10 17:35:21 +00:00
|
|
|
is specified)
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl W
|
|
|
|
forces output to the (wide) Versatec printer rather than the (narrow)
|
|
|
|
Varian
|
|
|
|
.It Fl d Ar file
|
|
|
|
specifies an alternate language definitions
|
|
|
|
file (default is
|
|
|
|
.Pa /usr/share/misc/vgrindefs )
|
|
|
|
.It Fl f
|
|
|
|
forces filter mode
|
|
|
|
.It Fl h Ar header
|
|
|
|
specifies a particular header to put on every output page (default is
|
|
|
|
the file name)
|
|
|
|
.It Fl l
|
2004-07-02 22:22:35 +00:00
|
|
|
specifies the language to use.
|
|
|
|
Currently known are
|
1994-05-27 12:33:43 +00:00
|
|
|
.Tn PASCAL
|
|
|
|
.Pq Fl l Ns Ar p ,
|
|
|
|
.Tn MODEL
|
|
|
|
.Pq Fl l Ns Ar m ,
|
|
|
|
C
|
|
|
|
.Pf ( Fl l Ns Ar c
|
|
|
|
or the default),
|
1996-09-08 18:23:53 +00:00
|
|
|
.Tn C++
|
|
|
|
.Pq Fl l Ns Ar c++ ,
|
1994-05-27 12:33:43 +00:00
|
|
|
.Tn CSH
|
|
|
|
.Pq Fl l Ns Ar csh ,
|
|
|
|
.Tn SHELL
|
|
|
|
.Pq Fl l Ns Ar sh ,
|
|
|
|
.Tn RATFOR
|
|
|
|
.Pq Fl l Ns Ar r ,
|
|
|
|
.Tn MODULA2
|
|
|
|
.Pq Fl l Ns Ar mod2 ,
|
|
|
|
.Tn YACC
|
|
|
|
.Pq Fl l Ns Ar yacc ,
|
|
|
|
.Tn LISP
|
|
|
|
.Pq Fl l Ns Ar isp ,
|
|
|
|
.Tn ICON
|
1996-10-15 18:58:45 +00:00
|
|
|
.Pq Fl l Ns Ar I ,
|
|
|
|
and
|
|
|
|
.Tn PERL
|
|
|
|
.Pq Fl l Ns Ar perl .
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl n
|
|
|
|
forces no keyword bolding
|
1996-09-08 18:23:53 +00:00
|
|
|
.It Fl p Ar postproc
|
|
|
|
use
|
|
|
|
.Ar postproc
|
|
|
|
to post-process the output,
|
|
|
|
.Xr psroff 1
|
|
|
|
by default.
|
2006-08-29 18:11:20 +00:00
|
|
|
.It Fl s Ar pointsize
|
1994-05-27 12:33:43 +00:00
|
|
|
specifies a point size to use on output (exactly the same as the argument
|
|
|
|
of a .ps)
|
|
|
|
.It Fl t
|
|
|
|
similar to the same option in
|
2022-08-15 20:14:15 +00:00
|
|
|
.Xr troff 1 Pq Pa ports/textproc/groff
|
1994-05-27 12:33:43 +00:00
|
|
|
causing formatted text to go to the standard output
|
|
|
|
.It Fl x
|
2001-07-15 08:06:20 +00:00
|
|
|
outputs the index file in a ``pretty'' format.
|
|
|
|
The index file itself is produced whenever
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
2001-07-15 08:06:20 +00:00
|
|
|
is run with a file called
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pa index
|
|
|
|
in the current directory.
|
|
|
|
The index of function
|
2001-07-15 08:06:20 +00:00
|
|
|
definitions can then be run off by giving
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
the
|
|
|
|
.Fl x
|
|
|
|
option and the file
|
|
|
|
.Pa index
|
|
|
|
as argument.
|
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /usr/share/misc/vgrindefsxx -compact
|
|
|
|
.It Pa index
|
|
|
|
file where source for index is created
|
|
|
|
.It Pa /usr/share/tmac/tmac.vgrind
|
|
|
|
macro package
|
|
|
|
.It Pa /usr/libexec/vfontedpr
|
|
|
|
preprocessor
|
|
|
|
.It Pa /usr/share/misc/vgrindefs
|
|
|
|
language descriptions
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr getcap 3 ,
|
|
|
|
.Xr vgrindefs 5
|
2005-01-18 13:43:56 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Bx 3.0 .
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh BUGS
|
2003-06-08 13:58:08 +00:00
|
|
|
The vfontedpr preprocessor assumes that a certain programming style is
|
|
|
|
followed:
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
2001-07-15 08:06:20 +00:00
|
|
|
For
|
1994-05-27 12:33:43 +00:00
|
|
|
.Tn C
|
|
|
|
\- function names can be preceded on a line only by spaces, tabs, or an
|
2004-07-02 22:22:35 +00:00
|
|
|
asterisk.
|
|
|
|
The parenthesized arguments must also be on the same line.
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
|
|
|
For
|
|
|
|
.Tn PASCAL
|
|
|
|
\- function names need to appear on the same line as the keywords
|
|
|
|
.Em function
|
|
|
|
or
|
|
|
|
.Em procedure .
|
|
|
|
.Pp
|
|
|
|
For
|
|
|
|
.Tn MODEL
|
|
|
|
\- function names need to appear on the same line as the keywords
|
|
|
|
.Em is beginproc .
|
|
|
|
.Pp
|
|
|
|
If these conventions are not followed, the indexing and marginal function
|
|
|
|
name comment mechanisms will fail.
|
|
|
|
.Pp
|
|
|
|
More generally, arbitrary formatting styles for programs mostly look bad.
|
|
|
|
The use of spaces to align source code fails miserably; if you plan to
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
2004-07-02 22:22:35 +00:00
|
|
|
your program you should use tabs.
|
|
|
|
This is somewhat inevitable since the
|
1994-05-27 12:33:43 +00:00
|
|
|
font used by
|
1997-08-25 06:36:04 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
is variable width.
|
|
|
|
.Pp
|
|
|
|
The mechanism of
|
|
|
|
.Xr ctags 1
|
|
|
|
in recognizing functions should be used here.
|
|
|
|
.Pp
|
|
|
|
Filter mode does not work in documents using the
|
|
|
|
.Fl me
|
|
|
|
or
|
|
|
|
.Fl ms
|
|
|
|
macros.
|
|
|
|
(So what use is it anyway?)
|