BSD 4_4_Lite2 development
[unix-history] / usr / share / man / cat1 / vgrind.0
VGRIND(1) BSD Reference Manual VGRIND(1)
N\bNA\bAM\bME\bE
v\bvg\bgr\bri\bin\bnd\bd - grind nice listings of programs
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
v\bvg\bgr\bri\bin\bnd\bd [-\b-] [-\b-W\bW] [-\b-d\bd _\bf_\bi_\bl_\be] [-\b-f\bf] [-\b-h\bh _\bh_\be_\ba_\bd_\be_\br] [-\b-l\bl _\bl_\ba_\bn_\bg_\bu_\ba_\bg_\be] [-\b-n\bn] [-\b-s\bsn\bn] [-\b-t\bt]
[-\b-x\bx] _\bn_\ba_\bm_\be _\b._\b._\b.
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
V\bVg\bgr\bri\bin\bnd\bd formats the program sources which are arguments in a nice style
using troff(1) 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.
V\bVg\bgr\bri\bin\bnd\bd runs in two basic modes, filter mode (see the -\b-f\bf option) or regu-
lar mode. In filter mode v\bvg\bgr\bri\bin\bnd\bd acts as a filter in a manner similar to
tbl(1). The standard input is passed directly to the standard output ex-
cept for lines bracketed by the _\bt_\br_\bo_\bf_\bf_\b-_\bl_\bi_\bk_\be macros:
.vS starts processing
.vE ends processing
These lines are formatted as described above. The output from this fil-
ter can be passed to troff for output. There need be no particular or-
dering with eqn(1) or tbl(1).
In regular mode v\bvg\bgr\bri\bin\bnd\bd accepts input files, processes them, and passes
them to troff(1) for output.
In both modes v\bvg\bgr\bri\bin\bnd\bd passes any lines beginning with a decimal point
without conversion.
The options are:
-\b- forces input to be taken from standard input (default if -\b-f\bf
is specified )
-\b-W\bW forces output to the (wide) Versatec printer rather than
the (narrow) Varian
-\b-d\bd _\bf_\bi_\bl_\be specifies an alternate language definitions file (default
is _\b/_\bu_\bs_\br_\b/_\bs_\bh_\ba_\br_\be_\b/_\bm_\bi_\bs_\bc_\b/_\bv_\bg_\br_\bi_\bn_\bd_\be_\bf_\bs)
-\b-f\bf forces filter mode
-\b-h\bh _\bh_\be_\ba_\bd_\be_\br specifies a particular header to put on every output page
(default is the file name)
-\b-l\bl specifies the language to use. Currently known are PASCAL
(-\b-l\bl_\bp), MODEL (-\b-l\bl_\bm), C (-\b-l\bl_\bc or the default), CSH (-\b-l\bl_\bc_\bs_\bh),
SHELL (-\b-l\bl_\bs_\bh), RATFOR (-\b-l\bl_\br), MODULA2 (-\b-l\bl_\bm_\bo_\bd_\b2), YACC
(-\b-l\bl_\by_\ba_\bc_\bc), LISP (-\b-l\bl_\bi_\bs_\bp), and ICON (-\b-l\bl_\bI).
-\b-n\bn forces no keyword bolding
-\b-s\bs specifies a point size to use on output (exactly the same
as the argument of a .ps)
-\b-t\bt similar to the same option in troff causing formatted text
to go to the standard output
-\b-x\bx outputs the index file in a ``pretty'' format. The index
file itself is produced whenever v\bvg\bgr\bri\bin\bnd\bd is run with a file
called _\bi_\bn_\bd_\be_\bx in the current directory. The index of func-
tion definitions can then be run off by giving v\bvg\bgr\bri\bin\bnd\bd the
-\b-x\bx option and the file _\bi_\bn_\bd_\be_\bx as argument.
F\bFI\bIL\bLE\bES\bS
index file where source for index is created
/usr/share/tmac/tmac.vgrind macro package
/usr/libexec/vfontedpr preprocessor
/usr/share/misc/vgrindefs language descriptions
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
getcap(3), vgrindefs(5)
B\bBU\bUG\bGS\bS
Vfontedpr assumes that a certain programming style is followed:
For C - 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.
For PASCAL - function names need to appear on the same line as the key-
words _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn or _\bp_\br_\bo_\bc_\be_\bd_\bu_\br_\be.
For MODEL - function names need to appear on the same line as the key-
words _\bi_\bs _\bb_\be_\bg_\bi_\bn_\bp_\br_\bo_\bc.
If these conventions are not followed, the indexing and marginal function
name comment mechanisms will fail.
More generally, arbitrary formatting styles for programs mostly look bad.
The use of spaces to align source code fails miserably; if you plan to
v\bvg\bgr\bri\bin\bnd\bd your program you should use tabs. This is somewhat inevitable
since the font used by v\bvg\bgr\bri\bin\bnd\bd is variable width.
The mechanism of ctags(1) in recognizing functions should be used here.
Filter mode does not work in documents using the -\b-m\bme\be or -\b-m\bms\bs macros. (So
what use is it anyway?)
H\bHI\bIS\bST\bTO\bOR\bRY\bY
The v\bvg\bgr\bri\bin\bnd\bd command appeared in 3.0BSD.
4th Berkeley Distribution June 6, 1993 2