xref: /csrg-svn/usr.bin/vgrind/vgrind.1 (revision 62423)
1*62423Sbostic.\" Copyright (c) 1980, 1990, 1993
2*62423Sbostic.\"	The Regents of the University of California.  All rights reserved.
319324Smckusick.\"
456260Selan.\" %sccs.include.redist.roff%
519324Smckusick.\"
6*62423Sbostic.\"     @(#)vgrind.1	8.1 (Berkeley) 06/06/93
736167Sbostic.\"
856260Selan.Dd
948590Scael.Dt VGRIND 1
1048590Scael.Os BSD 4
1148590Scael.Sh NAME
1248590Scael.Nm vgrind
1348590Scael.Nd grind nice listings of programs
1448590Scael.Sh SYNOPSIS
1548590Scael.Nm vgrind
1648590Scael.Op Fl
1748590Scael.Op Fl W
1848590Scael.Op Fl d Ar file
1948590Scael.Op Fl f
2048590Scael.Op Fl h Ar header
2148590Scael.Op Fl l Ar language
2248590Scael.Op Fl n
2348590Scael.Op Fl sn
2448590Scael.Op Fl t
2548590Scael.Op Fl x
2648590Scael.Ar name Ar ...
2748590Scael.Sh DESCRIPTION
2848590Scael.Nm Vgrind
2919325Smckusickformats the program sources which are arguments
3019324Smckusickin a nice style using
3148590Scael.Xr troff 1
3219325SmckusickComments are placed in italics, keywords in bold face,
3319324Smckusickand the name of the current function is listed down the margin of each
3419324Smckusickpage as it is encountered.
3548590Scael.Pp
3648590Scael.Nm Vgrind
3748590Scaelruns in two basic modes, filter mode (see the
3848590Scael.Fl f
3948590Scaeloption) or regular mode.  In filter mode
4048590Scael.Nm vgrind
4119325Smckusickacts as a filter in a manner similar to
4248590Scael.Xr tbl 1 .
4319325SmckusickThe standard input is passed directly to the standard output except
4419325Smckusickfor lines bracketed by the
4548590Scael.Em troff-like
4619325Smckusickmacros:
4748590Scael.Bl -tag -width Ds
4848590Scael.It \&.vS
4948590Scaelstarts processing
5048590Scael.It \&.vE
5148590Scaelends processing
5248590Scael.El
5348590Scael.Pp
5419325SmckusickThese lines are formatted as described above.  The output from this
5519325Smckusickfilter can be passed to
5648590Scael.Xr troff
5719325Smckusickfor output.  There need be no particular ordering with
5848590Scael.Xr eqn 1
5919325Smckusickor
6048590Scael.Xr tbl 1 .
6148590Scael.Pp
6219325SmckusickIn regular mode
6348590Scael.Nm vgrind
6419325Smckusickaccepts input files, processes them, and passes them to
6548590Scael.Xr troff 1
6619325Smckusickfor output.
6748590Scael.Pp
6819325SmckusickIn both modes
6948590Scael.Nm vgrind
7019325Smckusickpasses any lines beginning with a decimal point without conversion.
7148590Scael.Pp
7219325SmckusickThe options are:
7348590Scael.Bl -tag -width Ar
7448590Scael.It Fl
7519325Smckusickforces input to be taken from standard input (default if
7648590Scael.Fl f
7719325Smckusickis specified )
7848590Scael.It Fl W
7948590Scaelforces output to the (wide) Versatec printer rather than the (narrow)
8048590ScaelVarian
8148590Scael.It Fl d Ar file
8248590Scaelspecifies an alternate language definitions
8348590Scaelfile (default is
8448590Scael.Pa /usr/share/misc/vgrindefs )
8548590Scael.It Fl f
8648590Scaelforces filter mode
8748590Scael.It Fl h Ar header
8848590Scaelspecifies a particular header to put on every output page (default is
8948590Scaelthe file name)
9048590Scael.It Fl l
9148590Scaelspecifies the language to use.  Currently known are
9248590Scael.Tn PASCAL
9348590Scael.Pq Fl l Ns Ar p ,
9448590Scael.Tn MODEL
9548590Scael.Pq Fl l Ns Ar m ,
9648590ScaelC
9748590Scael.Pf ( Fl l Ns Ar c
9848590Scaelor the default),
9948590Scael.Tn CSH
10048590Scael.Pq Fl l Ns Ar csh ,
10148590Scael.Tn SHELL
10248590Scael.Pq Fl l Ns Ar sh ,
10348590Scael.Tn RATFOR
10448590Scael.Pq Fl l Ns Ar r ,
10548590Scael.Tn MODULA2
10648590Scael.Pq Fl l Ns Ar mod2 ,
10748590Scael.Tn YACC
10848590Scael.Pq Fl l Ns Ar yacc ,
10948590Scael.Tn LISP
11048590Scael.Pq Fl l Ns Ar isp ,
11148590Scaeland
11248590Scael.Tn ICON
11348590Scael.Pq Fl l Ns Ar I .
11448590Scael.It Fl n
11548590Scaelforces no keyword bolding
11648590Scael.It Fl s
11748590Scaelspecifies a point size to use on output (exactly the same as the argument
11848590Scaelof a .ps)
11948590Scael.It Fl t
12019325Smckusicksimilar to the same option in
12148590Scael.Xr troff
12219325Smckusickcausing formatted text to go to the standard output
12348590Scael.It Fl x
12419325Smckusickoutputs the index file in a ``pretty'' format.
12519325SmckusickThe index file itself is produced whenever
12648590Scael.Nm vgrind
12719325Smckusickis run with a file called
12848590Scael.Pa index
12919325Smckusickin the current directory.
13019325SmckusickThe index of function
13119325Smckusickdefinitions can then be run off by giving
13248590Scael.Nm vgrind
13319324Smckusickthe
13448590Scael.Fl x
13519324Smckusickoption and the file
13648590Scael.Pa index
13719324Smckusickas argument.
13848590Scael.El
13948590Scael.Sh FILES
14048590Scael.Bl -tag -width /usr/share/misc/vgrindefsxx -compact
14148590Scael.It Pa index
14248590Scaelfile where source for index is created
14348590Scael.It Pa /usr/share/tmac/tmac.vgrind
14448590Scaelmacro package
14548590Scael.It Pa /usr/libexec/vfontedpr
14648590Scaelpreprocessor
14748590Scael.It Pa /usr/share/misc/vgrindefs
14848590Scaellanguage descriptions
14948590Scael.El
15048590Scael.Sh SEE ALSO
15156141Selan.Xr getcap 3 ,
15248590Scael.Xr vgrindefs 5
15348590Scael.Sh BUGS
15419324SmckusickVfontedpr assumes that a certain programming style is followed:
15548590Scael.Pp
15619324SmckusickFor
15748590Scael.Tn C
15819325Smckusick\- function names can be preceded on a line only by spaces, tabs, or an
15919325Smckusickasterisk.  The parenthesized arguments must also be on the same line.
16048590Scael.Pp
16119324SmckusickFor
16248590Scael.Tn PASCAL
16319325Smckusick\- function names need to appear on the same line as the keywords
16448590Scael.Em function
16519325Smckusickor
16648590Scael.Em procedure .
16748590Scael.Pp
16819324SmckusickFor
16948590Scael.Tn MODEL
17019325Smckusick\- function names need to appear on the same line as the keywords
17148590Scael.Em is beginproc .
17248590Scael.Pp
17319324SmckusickIf these conventions are not followed, the indexing and marginal function
17419324Smckusickname comment mechanisms will fail.
17548590Scael.Pp
17619324SmckusickMore generally, arbitrary formatting styles for programs mostly look bad.
17719324SmckusickThe use of spaces to align source code fails miserably; if you plan to
17848590Scael.Nm vgrind
17919324Smckusickyour program you should use tabs.  This is somewhat inevitable since the
18019324Smckusickfont used by
18148590Scael.Nm vgrind
18219324Smckusickis variable width.
18348590Scael.Pp
18448590ScaelThe mechanism of
18548590Scael.Xr ctags 1
18648590Scaelin recognizing functions should be used here.
18748590Scael.Pp
18848590ScaelFilter mode does not work in documents using the
18948590Scael.Fl me
19048590Scaelor
19148590Scael.Fl ms
19248590Scaelmacros.
19327724Smckusick(So what use is it anyway?)
19448590Scael.Sh HISTORY
19548590ScaelThe
19648590Scael.Nm
19748590Scaelcommand appeared in
19848590Scael.Bx 3.0 .
199