BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / vgrind.0
VGRIND(1) UNIX Programmer's Manual VGRIND(1)
N\bNA\bAM\bME\bE
vgrind - grind nice listings of programs
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
v\bvg\bgr\bri\bin\bnd\bd [ -\b-f\bf ] [ -\b- ] [ -\b-t\bt ] [ -\b-n\bn ] [ -\b-x\bx ] [ -\b-W\bW ] [ -\b-s\bsn\bn ] [ -\b-h\bh
header ] [ -\b-d\bd file ] [ -\b-l\bl_\bl_\ba_\bn_\bg_\bu_\ba_\bg_\be ] name ...
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bV_\bg_\br_\bi_\bn_\bd formats the program sources which are arguments in a
nice style using _\bt_\br_\bo_\bf_\bf(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.
_\bV_\bg_\br_\bi_\bn_\bd runs in two basic modes, filter mode or regular mode.
In filter mode _\bv_\bg_\br_\bi_\bn_\bd acts as a filter in a manner similar
to _\bt_\bb_\bl(1). The standard input is passed directly to the
standard output except for lines bracketed by the _\bt_\br_\bo_\bf_\bf-_\bl_\bi_\bk_\be
macros:
.vS - starts processing
.vE - ends processing
These lines are formatted as described above. The output
from this filter can be passed to _\bt_\br_\bo_\bf_\bf for output. There
need be no particular ordering with _\be_\bq_\bn(1) or _\bt_\bb_\bl(1).
In regular mode _\bv_\bg_\br_\bi_\bn_\bd accepts input files, processes them,
and passes them to _\bt_\br_\bo_\bf_\bf(1) for output.
In both modes _\bv_\bg_\br_\bi_\bn_\bd passes any lines beginning with a
decimal point without conversion.
The options are:
-\b-f\bf forces filter mode
-\b- forces input to be taken from standard input (default
if -\b-f\bf is specified )
-\b-t\bt similar to the same option in _\bt_\br_\bo_\bf_\bf causing formatted
text to go to the standard output
-\b-n\bn forces no keyword bolding
-\b-x\bx outputs the index file in a ``pretty'' format. The
index file itself is produced whenever _\bv_\bg_\br_\bi_\bn_\bd is run
with a file called _\bi_\bn_\bd_\be_\bx in the current directory. The
index of function definitions can then be run off by
giving _\bv_\bg_\br_\bi_\bn_\bd the -\b-x\bx option and the file _\bi_\bn_\bd_\be_\bx as argu-
ment.
Printed 7/9/88 May 5, 1986 1
VGRIND(1) UNIX Programmer's Manual VGRIND(1)
-\b-W\bW forces output to the (wide) Versatec printer rather
than the (narrow) Varian
-\b-s\bs specifies a point size to use on output (exactly the
same as the argument of a .ps)
-\b-h\bh specifies a particular header to put on every output
page (default is the file name)
-\b-d\bd specifies an alternate language definitions file
(default is /usr/lib/vgrindefs)
-\b-l\bl specifies the language to use. Currently known are
PASCAL (-\b-l\blp\bp), MODEL (-\b-l\blm\bm),C\bC (-\b-l\blc\bc or the default), CSH
(-\b-l\blc\bcs\bsh\bh), SHELL (-\b-l\bls\bsh\bh), RATFOR (-\b-l\blr\br), MODULA2 (-\b-l\blm\bmo\bod\bd2\b2),
YACC (-\b-l\bly\bya\bac\bcc\bc), ISP (-\b-l\bli\bis\bsp\bp), and ICON (-\b-l\blI\bI).
F\bFI\bIL\bLE\bES\bS
index file where source for index is created
/usr/lib/tmac/tmac.vgrindmacro package
/usr/lib/vfontedpr preprocessor
/usr/lib/vgrindefs language descriptions
A\bAU\bUT\bTH\bHO\bOR\bR
Dave Presotto & William Joy
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
vlp(1), vtroff(1), vgrindefs(5)
B\bBU\bUG\bGS\bS
Vfontedpr assumes that a certain programming style is fol-
lowed:
For C\bC - 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 P\bPA\bAS\bSC\bCA\bAL\bL - function names need to appear on the same line
as the keywords _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn or _\bp_\br_\bo_\bc_\be_\bd_\bu_\br_\be.
For M\bMO\bOD\bDE\bEL\bL - function names need to appear on the same line
as the keywords _\bi_\bs _\bb_\be_\bg_\bi_\bn_\bp_\br_\bo_\bc.
If these conventions are not followed, the indexing and mar-
ginal 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 _\bv_\bg_\br_\bi_\bn_\bd your program you
should use tabs. This is somewhat inevitable since the font
used by _\bv_\bg_\br_\bi_\bn_\bd is variable width.
Printed 7/9/88 May 5, 1986 2
VGRIND(1) UNIX Programmer's Manual VGRIND(1)
The mechanism of ctags in recognizing functions should be
used here.
Filter mode does not work in documents using the -me or -ms
macros. (So what use is it anyway?)
Printed 7/9/88 May 5, 1986 3