home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
utilities
/
utilsf
/
indent
/
Manual
< prev
next >
Wrap
Text File
|
1995-10-27
|
15KB
|
311 lines
INDENT(1) UNIX System V (July 14, 1989) INDENT(1)
NAME
indent - indent and format C program source
SYNOPSIS
indent [ input-file [ output-file ] ] [ -bad | -nbad ]
[ -bap | -nbap ] [ -bbb | -nbbb ] [ -bc | -nbc ]
[ -bl ] [ -br ] [ -brr ] [ -cn ] [ -cdn ]
[ -cdb | -ncdb ] [ -ce | -nce ] [ -cin ] [ -clin ]
[ -ccin ] [ -dn ] [ -din ] [ -fc1 | -nfc1 ] [ -in ]
[ -ip | -nip ] [ -ln ] [ -lcn ] [ -lp | -nlp ]
[ -pcs | -npcs ] [ -npro ] [ -prs | -nprs ]
[ -psl | -npsl ] [ -sc | -nsc ] [ -sob | -nsob ]
[ -st ] [ -troff ] [ -v | -nv ] [ -+ ]
DESCRIPTION
Indent is a C program formatter. It reformats the C program
in the input-file according to the switches. The switches
which can be specified are described below. They may appear
before or after the file names.
NOTE: If you only specify an input-file, the formatting is
done `in-place', that is, the formatted file is written back
into input-file and a backup copy of input-file is written
in the current directory. If input-file is named
`/blah/blah/file', the backup file is named file.BAK.
If output-file is specified, indent checks to make sure it
is different from input-file.
OPTIONS
The options listed below control the formatting style
imposed by indent.
-bap,-nbap If -bap is specified, a blank line is forced
after every procedure body. Default: -nbap.
-bad,-nbad If -bad is specified, a blank line is forced
after every block of declarations. Default:
-nbad.
-bbb,-nbbb If -bbb is specified, a blank line is forced
before every block comment. Default: -nbbb.
-bc,-nbc If -bc is specified, then a newline is forced
after each comma in a declaration. -nbc turns
off this option. The default is -bc.
-br,-bl,-brr Specifying -bl lines up compound statements
like this:
if (...)
{
code
}
Specifying -br (the default) makes them look
like this:
if (...) {
code
}
And specifying -brr makes them look like
this:
if (...)
{
code
}
-cn The column in which comments on code start.
The default is 33.
-cdn The column in which comments on declarations
start. The default is for these comments to
start in the same column as those on code.
-cdb,-ncdb Enables (disables) the placement of comment
delimiters on blank lines. With this option
enabled, comments look like this:
/*
* this is a comment
*/
Rather than like this:
/* this is a comment */
This only affects block comments, not
comments to the right of code. The default is
-cdb .
-ce,-nce Enables (disables) forcing `else's to cuddle
up to the immediatly preceeding `}'. The
default is -ce .
-cin Sets the continuation indent to be n.
Continuation lines will be indented that far
from the beginning of the first line of the
statement. Parenthesized expressions have
extra indentation added to indicate the
nesting, unless -lp is in effect. -ci
defaults to the same value as -i.
-clin Causes case labels to be indented n tab stops
to the right of the containing switch
statement. -cli0.5 causes case labels to be
indented half a tab stop. The default is
-cli0 .
-ccin Causes case code to be indented n tab stops
to the right of the corresponding case label.
-cci0.5 causes case code to be indented half
a tab stop. The default is -cci1 .
-dn Controls the placement of comments which are
not to the right of code. The default -d1
means that such comments are placed one
indentation level to the left of code.
Specifying -d0 lines up these comments with
the code. See the section on comment
indentation below.
-din Specifies the indentation, in character
positions, from a declaration keyword to the
following identifier. The default is -di16 .
-fc1,-nfc1 Enables (disables) the formatting of comments
that start in column 1. Often, comments
whose leading `/' is in column 1 have been
carefully hand formatted by the programmer.
In such cases, -nfc1 should be used. The
default is -fc1.
-in The number of spaces for one indentation
level. The default is 4.
-ip,-nip Enables (disables) the indentation of
parameter declarations from the left margin.
The default is -ip .
-ln Maximum length of an output line. The
default is 75.
-npro Causes the profile files, `./.indent.pro' and
`~/.indent.pro', to be ignored.
-lp,-nlp Lines up code surrounded by parenthesis in
continuation lines. If a line has a left
paren which is not closed on that line, then
continuation lines will be lined up to start
at the character position just after the left
paren. For example, here is how a piece of
continued code looks with -nlp in effect:
p1 = first_procedure(second_procedure(p2, p3),
third_procedure(p4, p5));
With -lp in effect (the default) the code
looks somewhat clearer:
p1 = first_procedure(second_procedure(p2, p3),
third_procedure(p4, p5));
Inserting a couple more newlines we get:
p1 = first_procedure(second_procedure(p2,
p3),
third_procedure(p4,
p5));
-pcs , -npcs If true (-pcs) all procedure calls will have
a space inserted between the name and the
'('. The default is -npcs
-prs , -nprs If true (-prs) all parentheses will have a
space inserted after the '(' and before the