home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / indent-1.9.1-base.tgz / indent-1.9.1-base.tar / fsf / indent / indent.info (.txt) < prev    next >
GNU Info File  |  1994-02-03  |  43KB  |  996 lines

  1. This is Info file indent.info, produced by Makeinfo-1.54 from the input
  2. file ./indent.texinfo.
  3.    Copyright (C) 1989, 1992, 1993, 1994 Free Software Foundation, Inc.
  4.    This is Edition 1.3, January, 1994, of `The `indent' Manual', for
  5. Indent Version 1.9
  6.    Permission is granted to make and distribute verbatim copies of this
  7. manual provided the copyright notice and this permission notice are
  8. preserved on all copies.
  9. File: indent.info,  Node: Top,  Next: Indent Program,  Prev: (dir),  Up: (dir)
  10. `indent':  Indent and Format C Program Source
  11. *********************************************
  12.    The `indent' program changes the appearance of a C program by
  13. inserting or deleting whitespace.
  14.    This is Edition 1.3, January 1994, of `The `indent' Manual', for
  15. Indent Version 1.9
  16. * Menu:
  17. * Indent Program::              The `indent' Program
  18. * Option Summary::              Option Summary
  19. * Index::                       Index
  20. File: indent.info,  Node: Indent Program,  Next: Option Summary,  Prev: Top,  Up: Top
  21. The `indent' Program
  22. ********************
  23.    The `indent' program can be used to make code easier to read.  It
  24. can also convert from one style of writing C to another.
  25.    `indent' understands a substantial amount about the syntax of C, but
  26. it also attempts to cope with incomplete and misformed syntax.
  27.    In version 1.2 and more recent versions, the GNU style of indenting
  28. is the default.
  29. * Menu:
  30. * Invoking indent::             Invoking `indent'
  31. * Backup files::                Backup Files
  32. * Common styles::               Common styles
  33. * Blank lines::                 Blank lines
  34. * Comments::                    Comments
  35. * Statements::                  Statements
  36. * Declarations::                Declarations
  37. * Indentation::                 Indentation
  38. * Disabling Formatting::        Disabling Formatting
  39. * Miscellaneous options::       Miscellaneous options
  40. * Bugs::                     Bugs
  41. * Copyright::                   Copyright
  42. File: indent.info,  Node: Invoking indent,  Next: Backup files,  Up: Indent Program
  43. Invoking `indent'
  44. =================
  45.    As of version 1.3, the format of the `indent' command is:
  46.      indent [OPTIONS] [INPUT-FILES]
  47.      
  48.      indent [OPTIONS] [SINGLE-INPUT-FILE] [-o OUTPUT-FILE]
  49.    This format is different from earlier versions and other versions of
  50. `indent'.
  51.    In the first form, one or more input files are specified.  `indent'
  52. makes a backup copy of each file, and the original file is replaced with
  53. its indented version.  *Note Backup files::, for an explanation of how
  54. backups are made.
  55.    In the second form, only one input file is specified.  In this case,
  56. or when the standard input is used, you may specify an output file after
  57. the `-o' option.
  58.    To cause `indent' to write to standard output, use the `-st' option.
  59. This is only allowed when there is only one input file, or when the
  60. standard input is used.
  61.    If no input files are named, the standard input is read for input.
  62. Also, if a filename named `-' is specified, then the standard input is
  63. read.
  64.    As an example, each of the following commands will input the program
  65. `slithy_toves.c' and write its indented text to `slithy_toves.out':
  66.      indent slithy_toves.c -o slithy_toves.out
  67.      
  68.      indent -st slithy_toves.c > slithy_toves.out
  69.      
  70.      cat slithy_toves.c | indent -o slithy_toves.out
  71.    Most other options to `indent' control how programs are formatted.
  72. As of version 1.2, `indent' also recognizes a long name for each option
  73. name.  Long options are prefixed by either `--' or `+'.(1) In most of
  74. this document, the traditional, short names are used for the sake of
  75. brevity.  *Note Option Summary::, for a list of options, including both
  76. long and short names.
  77.    Here is another example:
  78.      indent -br test/metabolism.c -l85
  79.    This will indent the program `test/metabolism.c' using the `-br' and
  80. `-l85' options, write the output back to `test/metabolism.c', and write
  81. the original contents of `test/metabolism.c' to a backup file in the
  82. directory `test'.
  83.    Equivalent invocations using long option names for this example would
  84.      indent --braces-on-if-line --line-length185 test/metabolism.c
  85.      
  86.      indent +braces-on-if-line +line-length185 test/metabolism.c
  87.    If you find that you often use `indent' with the same options, you
  88. may put those options into a file called `.indent.pro'.  `indent' will
  89. first look for `.indent.pro' in the current directory and use that if
  90. found.  Otherwise, `indent' will search your home directory for
  91. `.indent.pro' and use that file if it is found.  This behaviour is
  92. different from that of other versions of `indent', which load both
  93. files if they both exist.
  94.    Command line switches are handled *after* processing `.indent.pro'.
  95. Options specified later override arguments specified earlier, with one
  96. exception: Explicitly specified options always override background
  97. options (*note Common styles::.).  You can prevent `indent' from
  98. reading an `.indent.pro' file by specifying the `-npro' option.
  99.    ---------- Footnotes ----------
  100.    (1)   `+' is being superseded by `--' to maintain consistency with
  101. the POSIX standard.
  102. File: indent.info,  Node: Backup files,  Next: Common styles,  Prev: Invoking indent,  Up: Indent Program
  103. Backup Files
  104. ============
  105.    As of version 1.3, GNU `indent' makes GNU-style backup files, the
  106. same way GNU Emacs does.  This means that either "simple" or "numbered"
  107. backup filenames may be made.
  108.    Simple backup file names are generated by appending a suffix to the
  109. original file name.  The default for the this suffix is the
  110. one-character string `~' (tilde).  Thus, the backup file for `python.c'
  111. would be `python.c~'.
  112.    Instead of the default, you may specify any string as a suffix by
  113. setting the environment variable `SIMPLE_BACKUP_SUFFIX' to your
  114. preferred suffix.
  115.    Numbered backup versions of a file `momewraths' look like
  116. `momewraths.c.~23~', where 23 is the version of this particular backup.
  117. When making a numbered backup of the file `src/momewrath.c', the
  118. backup file will be named `src/momewrath.c.~V~', where V is one greater
  119. than the highest version currently existing in the directory `src'.
  120.    The type of backup file made is controlled by the value of the
  121. environment variable `VERSION_CONTROL'.  If it is the string `simple',
  122. then only simple backups will be made.  If its value is the string
  123. `numbered', then numbered backups will be made.  If its value is
  124. `numbered-existing', then numbered backups will be made if there
  125. *already exist* numbered backups for the file being indented;
  126. otherwise, a simple backup is made.  If `VERSION_CONTROL' is not set,
  127. then `indent' assumes the behaviour of `numbered-existing'.
  128.    Other versions of `indent' use the suffix `.BAK' in naming backup
  129. files.  This behaviour can be emulated by setting
  130. `SIMPLE_BACKUP_SUFFIX' to `.BAK'.
  131.    Note also that other versions of `indent' make backups in the
  132. current directory, rather than in the directory of the source file as
  133. GNU `indent' now does.
  134. File: indent.info,  Node: Common styles,  Next: Blank lines,  Prev: Backup files,  Up: Indent Program
  135. Common styles
  136. =============
  137.    There are several common styles of C code, including the GNU style,
  138. the Kernighan & Ritchie style, and the original Berkeley style.  A
  139. style may be selected with a single "background" option, which
  140. specifies a set of values for all other options.  However, explicitly
  141. specified options always override options implied by a background
  142. option.
  143.    As of version 1.2, the default style of GNU `indent' is the GNU
  144. style.  Thus, it is no longer neccessary to specify the option `-gnu'
  145. to obtain this format, although doing so will not cause an error.
  146. Option settings which correspond to the GNU style are:
  147.      -nbad -bap -nbc -bl -bli2 -c33 -cd33 -ncdb -nce -cli0
  148.      -cp1 -di2 -nfc1 -nfca -i2 -ip5 -lp -pcs -psl -cs
  149.      -nsc -nsob -nss -ts8 -d0 -ci0 -l78
  150.    The GNU coding style is that preferred by the GNU project.  It is the
  151. style that the GNU Emacs C mode encourages and which is used in the C
  152. portions of GNU Emacs.  (People interested in writing programs for
  153. Project GNU should get a copy of `The GNU Coding Standards', which also
  154. covers semantic and portability issues such as memory usage, the size
  155. of integers, etc.)
  156.    The Kernighan & Ritchie style is used throughout their well-known
  157. book `The C Programming Language'.  It is enabled with the `-kr'
  158. option.  The Kernighan & Ritchie style corresponds to the following set
  159. of options:
  160.      -nbad -bap -nbc -br -c33 -cd33 -ncdb -ce -ci4
  161.      -cli0 -cp33 -d0 -di1 -nfc1 -nfca -i4 -ip0 -l75 -lp
  162.      -npcs -npsl -nsc -nsob -nss -ts8 -cs
  163. Kernighan & Ritchie style does not put comments to the right of code in
  164. the same column at all times (nor does it use only one space to the
  165. right of the code), so for this style `indent' has arbitrarily chosen
  166. column 33.
  167.    The style of the original Berkeley `indent' may be obtained by
  168. specifying `-orig' (or by specifyfying `--original', using the long
  169. option name).  This style is equivalent to the following settings:
  170.      -nbap -nbad -bc -br -c33 -cd33 -cdb -ce -ci4
  171.      -cli0 -cp33 -d4 -di16 -fc1 -fca -i4 -ip4 -l75 -lp
  172.      -npcs -psl -sc -nsob -nss -ts8 -ncs
  173. File: indent.info,  Node: Blank lines,  Next: Comments,  Prev: Common styles,  Up: Indent Program
  174. Blank lines
  175. ===========
  176.    Various programming styles use blank lines in different places.
  177. `indent' has a number of options to insert or delete blank lines in
  178. specific places.
  179.    The `-bad' option causes `indent' to force a blank line after every
  180. block of declarations.  The `-nbad' option causes `indent' not to force
  181. such blank lines.
  182.    The `-bap' option forces a blank line after every procedure body.
  183. The `-nbap' option forces no such blank line.
  184.    The `-sob' option causes `indent' to swallow optional blank lines
  185. (that is, any optional blank lines present in the input will be removed
  186. from the output).  If the `-nsob' is specified, any blank lines present
  187. in the input file will be copied to the output file.
  188. * Menu:
  189. * -bad::                        More on the `-bad' option.
  190. * -bap::                        More on the `-bap' option.
  191. File: indent.info,  Node: -bad,  Next: -bap,  Up: Blank lines
  192. -blank-lines-after-declarations
  193. -------------------------------
  194.    The `-bad' option forces a blank line after every block of
  195. declarations.  The `-nbad' option does not add any such blank lines.
  196.    For example, given the input
  197.      char *foo;
  198.      char *bar;
  199.      /* This separates blocks of declarations.  */
  200.      int baz;
  201. `indent -bad' produces
  202.      char *foo;
  203.      char *bar;
  204.      
  205.      /* This separates blocks of declarations.  */
  206.      int baz;
  207. and `indent -nbad' produces
  208.      char *foo;
  209.      char *bar;
  210.      /* This separates blocks of declarations.  */
  211.      int baz;
  212. File: indent.info,  Node: -bap,  Prev: -bad,  Up: Blank lines
  213. -blank-lines-after-procedures
  214. -----------------------------
  215.    The `-bap' option forces a blank line after every procedure body.
  216.    For example, given the input
  217.      int
  218.      foo ()
  219.      {
  220.        puts("Hi");
  221.      }
  222.      /* The procedure bar is even less interesting.  */
  223.      char *
  224.      bar ()
  225.      {
  226.        puts("Hello");
  227.      }
  228. `indent -bap' produces
  229.      int
  230.      foo ()
  231.      {
  232.        puts ("Hi");
  233.      }
  234.      
  235.      /* The procedure bar is even less interesting.  */
  236.      char *
  237.      bar ()
  238.      {
  239.        puts ("Hello");
  240.      }
  241. and `indent -nbap' produces
  242.      int
  243.      foo ()
  244.      {
  245.        puts ("Hi");
  246.      }
  247.      /* The procedure bar is even less interesting.  */
  248.      char *
  249.      bar ()
  250.      {
  251.        puts ("Hello");
  252.      }
  253. No blank line will be added after the procedure `foo'.
  254. File: indent.info,  Node: Comments,  Next: Statements,  Prev: Blank lines,  Up: Indent Program
  255. Comments
  256. ========
  257.    `indent' formats both C and C++ comments. C comments are begun with
  258. `/*' and terminated with `*/' and may contain newline characters.  C++
  259. comments begin with the delimiter `//' and end at the newline.
  260.    `indent' handles comments differently depending upon their context.
  261. `indent' attempts to distinguish amongst comments which follow
  262. statements, comments which follow declarations, comments following
  263. preprocessor directives, and comments which are not preceded by code of
  264. any sort, i.e., they begin the text of the line (although not
  265. neccessarily in column 1).
  266.    `indent' further attempts to leave "boxed comments" unmodified.  The
  267. general idea of such a comment is that it is enclosed in a rectangle or
  268. "box" of stars or dashes to visually set it apart.  More precisely,
  269. boxed comments are defined as those in which the initial `/*' is
  270. followed immediately by the character `*', `=', `_', or `-', or those
  271. in which the beginning comment delimiter (`/*') is on a line by itself,
  272. and the following line begins with a `*' in the same column as the star
  273. of the opening delimiter.
  274.    Examples of boxed comments are:
  275.      /**********************
  276.       * Comment in a box!! *
  277.       **********************/
  278.      
  279.             /*
  280.              * A different kind of scent,
  281.              * for a different kind of comment.
  282.              */
  283.    `indent' attempts to leave boxed comments exactly as they are found
  284. in the source file.  Thus the indentation of the comment is unchanged,
  285. and its length is not checked in any way.  The only alteration made is
  286. that an embedded tab character may be converted into the appropriate
  287. number of spaces.
  288.    Comments which are not boxed may be formatted, which means that the
  289. line is broken to fit within a right margin and left-filled with
  290. whitespace.  Single newlines are equivalent to a space, but blank lines
  291. (two or more newlines in a row) are taken to mean a paragraph break.
  292. Formatting of comments which begin after the first column is enabled
  293. with the `-fca' option.  To format those beginning in column one,
  294. specify `-fc1'.  Such formatting is disabled by default.
  295.    The right margin for formatting defaults to 78, but may be changed
  296. with the `-lc' or the `-l' option.  `-l' specifies the right margin for
  297. all code, and `-lc' specifies the margin for only for comments.  If
  298. `-l' is used alone, comments will be formatted according to the margin
  299. specified with that option.
  300.    If the margin specified does not allow the comment to be printed, the
  301. margin will be automatically extended for the duration of that comment.
  302. The margin is not respected if the comment is not being formatted.
  303.    If the comment begins a line (i.e., there is no program text to its
  304. left), it will be indented to the column it was found in unless the
  305. comment is within a block of code.  In that case, such a comment will
  306. be aligned with the indented code of that block.  This alignment may be
  307. affected by the `-d' option, which specifies an amount by which such
  308. comments are moved to the *left*, or unindented.  For example, `-d2'
  309. places comments two spaces to the left of code.  By default, comments
  310. are aligned with code.
  311.    Comments to the right of code will appear by default in column 33.
  312. This may be changed with one of three options.  `-c' will specify the
  313. column for comments following code, `-cd' specifies the column for
  314. comments following declarations, and `-cp' specifies the column for
  315. comments following preprocessor directives `#else' and `#endif'.
  316.    If the code to the left of the comment exceeds the beginning column,
  317. the comment column will be extended to the next tabstop column past the
  318. end of the code, or in the case of preprocessor directives, to one
  319. space past the end of the directive.  This extension lasts only for the
  320. output of that particular comment.
  321.    The `-cdb' option places the comment delimiters on blank lines.
  322. Thus, a single line comment like `/* Claustrophobia */' can be
  323. transformed into:
  324.      /*
  325.         Claustrophobia
  326.       */
  327.    Stars can be placed at the beginning of multi-line comments with the
  328. `-sc' option.  Thus, the single-line comment above can be transformed
  329. (with `-cdb -sc') into:
  330.      /*
  331.       * Claustrophobia
  332.       */
  333. File: indent.info,  Node: Statements,  Next: Declarations,  Prev: Comments,  Up: Indent Program
  334. Statements
  335. ==========
  336.    The `-br' or `-bl' option specifies how to format braces.
  337.    The `-br' option formats statement braces like this:
  338.      if (x > 0) {
  339.        x--;
  340.      }
  341. The `-bl' option formats them like this:
  342.      if (x > 0)
  343.        {
  344.          x--;
  345.        }
  346.    These options also affect structure and enumeration declarations.
  347. The `-br' option produces structure declarations like the following:
  348.      struct Sname {
  349.          int i;
  350.          char chp;
  351.      } Vname;
  352.    The default behaviour, also obtained by specifying `-bl', would
  353. yield the following format for the same declaration:
  354.      struct Sname
  355.        {
  356.           int i;
  357.           char chp;
  358.        }
  359.      Vname;
  360.    If you use the `-bl' option, you may also want to specify the `-bli'
  361. option.  This option specifies the number of spaces by which braces are
  362. indented.  `-bli2', the default, gives the result shown above.  `-bli0'
  363. results in the following:
  364.      if (x > 0)
  365.      {
  366.        x--;
  367.      }
  368.    If you are using the `-br' option, you probably want to also use the
  369. `-ce' option.  This causes the `else' in an if-then-else construct to
  370. cuddle up to the immediately preceding `}'.  For example, with `-br
  371. -ce' you get the following:
  372.      if (x > 0) {
  373.        x--;
  374.      } else {
  375.        fprintf (stderr, "...something wrong?\n");
  376.      }
  377. With `-br -nce' that code would appear as
  378.      if (x > 0) {
  379.        x--;
  380.      }
  381.      else {
  382.        fprintf (stderr, "...something wrong?\n");
  383.      }
  384.    The `-cli' option specifies the number of spaces that case labels
  385. should be indented to the right of the containing `switch' statement.
  386.    If a semicolon is on the same line as a `for' or `while' statement,
  387. the `-ss' option will cause a space to be placed before the semicolon.
  388. This emphasizes the semicolon, making it clear that the body of the
  389. `for' or `while' statement is an empty statement.  `-nss' disables this
  390. feature.
  391.    The `-pcs' option causes a space to be placed between the name of
  392. the procedure being called and the `(' (for example, `puts ("Hi");'.
  393. The `-npcs' option would give `puts("Hi");').
  394.    If the `-cs' option is specified, `indent' puts a space after a cast
  395. operator.
  396.    The `-bs' option ensures that there is a space between the keyword
  397. `sizeof' and its argument.  In some versions, this is known as the
  398. `Bill_Shannon' option.
  399. File: indent.info,  Node: Declarations,  Next: Indentation,  Prev: Statements,  Up: Indent Program
  400. Declarations
  401. ============
  402.    By default `indent' will line up identifiers, in the column
  403. specified by the `-di' option.  For example, `-di16' makes things look
  404. like:
  405.      int             foo;
  406.      char           *bar;
  407.    Using a small value (such as one or two) for the `-di' option can be
  408. used to cause the indentifiers to be placed in the first available
  409. position, for example
  410.      int foo;
  411.      char *bar;
  412.    The value given to the `-di' option will still affect variables
  413. which are put on separate lines from their types, for example `-di2'
  414. will lead to
  415.      int
  416.        foo;
  417.    If the `-bc' option is specified, a newline is forced after each
  418. comma in a declaration.  For example,
  419.      int a,
  420.        b,
  421.        c;
  422. With the `-nbc' option this would look like
  423.      int a, b, c;
  424.    The `-psl' option causes the type of a procedure being defined to be
  425. placed on the line before the name of the procedure.  This style is
  426. required for the `etags' program to work correctly, as well as some of
  427. the `c-mode' functions of Emacs.
  428.    If you are not using the `-di1' option to place variables being
  429. declared immediately after their type, you need to use the `-T' option
  430. to tell `indent' the name of all the typenames in your program that are
  431. defined by `typedef'.  `-T' can be specified more than once, and all
  432. names specified are used.  For example, if your program contains
  433.      typedef unsigned long CODE_ADDR;
  434.      typedef enum {red, blue, green} COLOR;
  435. you would use the options `-T CODE_ADDR -T COLOR'.
  436. File: indent.info,  Node: Indentation,  Next: Disabling Formatting,  Prev: Declarations,  Up: Indent Program
  437. Indentation
  438. ===========
  439.    One issue in the formatting of code is how far each line should be
  440. indented from the left margin.  When the beginning of a statement such
  441. as `if' or `for' is encountered, the indentation level is increased by
  442. the value specified by the `-i' option.  For example, use `-i8' to
  443. specify an eight character indentation for each level.  When a
  444. statement is broken across two lines, the second line is indented by a
  445. number of additional spaces specified by the `-ci' option.  `-ci'
  446. defaults to 0.  However, if the `-lp' option is specified, and a line
  447. has a left parenthesis which is not closed on that line, then
  448. continuation lines will be lined up to start at the character position
  449. just after the left parenthesis.  This processing also applies to `['
  450. and applies to `{' when it occurs in initialization lists.  For
  451. example, a piece of continued code might look like this with `-nlp
  452. -ci3' in effect:
  453.        p1 = first_procedure (second_procedure (p2, p3),
  454.           third_procedure (p4, p5));
  455. With `-lp' in effect the code looks somewhat clearer:
  456.        p1 = first_procedure (second_procedure (p2, p3),
  457.                              third_procedure (p4, p5));
  458.    `indent' assumes that tabs are placed at regular intervals of both
  459. input and output character streams.  These intervals are by default 8
  460. columns wide, but (as of version 1.2) may be changed by the `-ts'
  461. option.  Tabs are treated as the equivalent number of spaces.
  462.    The indentation of type declarations in old-style function
  463. definitions is controlled by the `-ip' parameter.  This is a numeric
  464. parameter specifying how many spaces to indent type declarations.  For
  465. example, the default `-ip5' makes definitions look like this:
  466.      char *
  467.      create_world (x, y, scale)
  468.           int x;
  469.           int y;
  470.           float scale;
  471.      {
  472.        . . .
  473.      }
  474.    For compatibility with other versions of indent, the option `-nip'
  475. is provided, which is equivalent to `-ip0'.
  476.    ASCII C allows white space to be placed on preprocessor command lines
  477. between the character `#' and the command name.  By default, `indent'
  478. removes this space, but specifying the `-lps' option directs `indent'
  479. to leave this space unmodified.
  480. File: indent.info,  Node: Disabling Formatting,  Next: Miscellaneous options,  Prev: Indentation,  Up: Indent Program
  481. Disabling Formatting
  482. ====================
  483.    Formatting of C code may be disabled for portions of a program by
  484. embedding special "control comments" in the program.  To turn off
  485. formatting for a section of a program, place the disabling control
  486. comment `/* *INDENT-OFF* */' on a line by itself just before that
  487. section.  Program text scanned after this control comment is output
  488. precisely as input with no modifications until the corresponding
  489. enabling comment is scanned on a line by itself.  The disabling control
  490. comment is `/* *INDENT-ON* */', and any text following the comment on
  491. the line is also output unformatted.  Formatting begins again with the
  492. input line following the enabling control comment.
  493.    More precisely, `indent' does not attempt to verify the closing
  494. delimiter (`*/') for these C comments, and any whitespace on the line
  495. is totally transparent.
  496.    These control comments also function in their C++ formats, namely
  497. `// *INDENT-OFF*' and `// *INDENT-ON*'.
  498.    It should be noted that the internal state of `indent' remains
  499. unchanged over the course of the unformatted section.  Thus, for
  500. example, turning off formatting in the middle of a function and
  501. continuing it after the end of the function may lead to bizarre
  502. results.  It is therefore wise to be somewhat modular in selecting code
  503. to be left unformatted.
  504.    As a historical note, some earlier versions of `indent' produced
  505. error messages beginning with `*INDENT**'.  These versions of `indent'
  506. were written to ignore any input text lines which began with such error
  507. messages.  I have removed this incestuous feature from `GNU indent'.
  508. File: indent.info,  Node: Miscellaneous options,  Next: Bugs,  Prev: Disabling Formatting,  Up: Indent Program
  509. Miscellaneous options
  510. =====================
  511.    To find out what version of `indent' you have, use the command
  512. `indent -version'.  This will report the version number of `indent',
  513. without doing any of the normal processing.
  514.    The `-v' option can be used to turn on verbose mode.  When in
  515. verbose mode, `indent' reports when it splits one line of input into
  516. two more more lines of output, and gives some size statistics at
  517. completion.
  518. File: indent.info,  Node: Bugs,  Next: Copyright,  Prev: Miscellaneous options,  Up: Indent Program
  519.    The "-troff" option is strongly deprecated, and is not supported.  A
  520. good thing for someone to do is to rewrite `indent' to generate TeX
  521. source as a hardcopy output option, amoung other things.
  522. File: indent.info,  Node: Copyright,  Prev: Bugs,  Up: Indent Program
  523. Copyright
  524. =========
  525.    The following copyright notice applies to the `indent' program.  The
  526. copyright and copying permissions for this manual appear near the
  527. beginning of this document.
  528.      Copyright (c) 1989, 1992 Free Software Foundation
  529.      Copyright (c) 1985 Sun Microsystems, Inc.
  530.      Copyright (c) 1980 The Regents of the University of California.
  531.      Copyright (c) 1976 Board of Trustees of the University of Illinois.
  532.      All rights reserved.
  533.      
  534.      Redistribution and use in source and binary forms are permitted
  535.      provided that the above copyright notice and this paragraph are
  536.      duplicated in all such forms and that any documentation,
  537.      advertising materials, and other materials related to such
  538.      distribution and use acknowledge that the software was developed
  539.      by the University of California, Berkeley, the University of Illinois,
  540.      Urbana, and Sun Microsystems, Inc.  The name of either University
  541.      or Sun Microsystems may not be used to endorse or promote products
  542.      derived from this software without specific prior written permission.
  543.      THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  544.      IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  545.      WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  546.      PURPOSE.
  547. File: indent.info,  Node: Option Summary,  Next: Index,  Prev: Indent Program,  Up: Top
  548. Option Summary
  549. **************
  550.    Here is a list of all the options for `indent', alphabetized by
  551. short option.  It is followed by a cross key alphabetized by long
  552. option.
  553. `-bad'
  554. `--blank-lines-after-declarations'
  555.      Force blank lines after the declarations.
  556.      *Note Blank lines::.
  557. `-bap'
  558. `--blank-lines-after-procedures'
  559.      Force blank lines after procedure bodies.
  560.      *Note Blank lines::.
  561. `-bbb'
  562. `--blank-lines-after-block-comments'
  563.      Force blank lines after block comments.
  564.      *Note Blank lines::.
  565. `-bc'
  566. `--blank-lines-after-commas'
  567.      Force newline after comma in declaration.
  568.      *Note Declarations::.
  569. `-bl'
  570. `--braces-after-if-line'
  571.      Put braces on line after `if', etc.
  572.      *Note Statements::.
  573. `-bliN'
  574. `--brace-indentN'
  575.      Indent braces N spaces.
  576.      *Note Statements::.
  577. `-br'
  578. `--braces-on-if-line'
  579.      Put braces on line with `if', etc. and structure declarations
  580.      *Note Statements::.
  581. `-cN'
  582. `--comment-indentationN'
  583.      Put comments to the right of code in column N.
  584.      *Note Comments::.
  585. `-cdN'
  586. `--declaration-comment-columnN'
  587.      Put comments to the right of the declarations in column N.
  588.      *Note Comments::.
  589. `-cdb'
  590. `--comment-delimiters-on-blank-lines'
  591.      Put comment delimiters on blank lines.
  592.      *Note Comments::.
  593. `-ce'
  594. `--cuddle-else'
  595.      Cuddle else and preceeding `}'.
  596.      *Note Comments::.
  597. `-ciN'
  598. `--continuation-indentationN'
  599.      Continuation indent of N spaces.
  600.      *Note Statements::.
  601. `-cliN'
  602. `--case-indentationN'
  603.      Case label indent of N spaces.
  604.      *Note Statements::.
  605. `-cpN'
  606. `--else-endif-columnN'
  607.      Put comments to the right of `#else' and `#endif' statements in
  608.      column N.
  609.      *Note Comments::.
  610. `-cs'
  611. `--space-after-cast'
  612.      Put a space after a cast operator.
  613.      *Note Statements::.
  614. `-bs'
  615. `--blank-before-sizeof'
  616.      Put a space between `sizeof' and its argument.
  617.      *Note Statements::
  618. `-dN'
  619. `--line-comments-indentationN'
  620.      Set indentation of comments not to the right of code to N spaces.
  621.      *Note Comments::.
  622. `-diN'
  623. `--declaration-indentationN'
  624.      Put variables in column N.
  625.      *Note Declarations::.
  626. `-fc1'
  627. `--format-first-column-comments'
  628.      Format comments in the first column.
  629.      *Note Comments::.
  630. `-fca'
  631. `--format-all-comments'
  632.      Do not disable all formatting of comments.
  633.      *Note Comments::
  634. `-gnu'
  635. `--gnu-style'
  636.      Use GNU coding style.  This is the default.
  637.      *Note Common styles::.
  638. `-iN'
  639. `--indent-levelN'
  640.      Set indentation level to N spaces.
  641.      *Note Indentation::.
  642. `-ipN'
  643. `--parameter-indentationN'
  644.      Indent parameter types in old-style function definitions by N
  645.      spaces.
  646.      *Note Indentation::.
  647. `-kr'
  648. `--k-and-r-style'
  649.      Use Kernighan & Ritchie coding style.
  650.      *Note Common styles::.
  651. `-lN'
  652. `--line-lengthN'
  653.      Set maximum line length to N.
  654.      *Note Comments::.
  655. `-lcN'
  656. `--comment-line-lengthN'
  657.      Set maximum line length for comment formatting to N.
  658.      *Note Comments::.
  659. `-lp'
  660. `--continue-at-parentheses'
  661.      Line up continued lines at parentheses.
  662.      *Note Indentation::.
  663. `-lps'
  664. `--leave-preprocessor-space'
  665.      Leave space between `#' and preprocessor directive.  *Note
  666.      Indentation::.
  667. `-nbad'
  668. `--no-blank-lines-after-declarations'
  669.      Do not force blank lines after declarations.
  670.      *Note Blank lines::.
  671. `-nbap'
  672. `--no-blank-lines-after-procedures'
  673.      Do not force blank lines after procedure bodies.
  674.      *Note Blank lines::.
  675. `-nbc'
  676. `--no-blank-lines-after-commas'
  677.      Do not force newlines after commas in declarations.
  678.      *Note Declarations::.
  679. `-ncdb'
  680. `--no-comment-delimiters-on-blank-lines'
  681.      Do not put comment delimiters on blank lines.
  682.      *Note Comments::.
  683. `-nce'
  684. `--dont-cuddle-else'
  685.      Do not cuddle `}' and `else'.
  686.      *Note Statements::.
  687. `-ncs'
  688. `--no-space-after-casts'
  689.      Do not put a space after cast operators.
  690.      *Note Statements::.
  691. `-nfc1'
  692. `--dont-format-first-column-comments'
  693.      Do not format comments in the first column as normal.
  694.      *Note Comments::.
  695. `-nfca'
  696. `--dont-format-comments'
  697.      Do not format any comments.
  698.      *Note Comments::.
  699. `-nip'
  700. `--no-parameter-indentation'
  701.      Zero width indentation for parameters.
  702.      *Note Indentation::
  703. `-nlp'
  704. `--dont-line-up-parentheses'
  705.      Do not line up parentheses.
  706.      *Note Statements::.
  707. `-npcs'
  708. `--no-space-after-function-call-names'
  709.      Do not put space after the function in function calls.
  710.      *Note Statements::.
  711. `-npsl'
  712. `--dont-break-procedure-type'
  713.      Put the type of a procedure on the same line as its name.
  714.      *Note Declarations::.
  715. `-nsc'
  716. `--dont-star-comments'
  717.      Do not put the `*' character at the left of comments.
  718.      *Note Comments::.
  719. `-nsob'
  720. `--leave-optional-blank-lines'
  721.      Do not swallow optional blank lines.
  722.      *Note Blank lines::.
  723. `-nss'
  724. `--dont-space-special-semicolon'
  725.      Do not force a space before the semicolon after certain statements.
  726.      Disables `-ss'.
  727.      *Note Statements::.
  728. `-nv'
  729. `--no-verbosity'
  730.      Disable verbose mode. *Note Miscellaneous options::.
  731. `-orig'
  732. `--original'
  733.      Use the original Berkeley coding style.
  734.      *Note Common styles::.
  735. `-npro'
  736. `--ignore-profile'
  737.      Do not read `.indent.pro' files.
  738.      *Note Invoking indent::.
  739. `-pcs'
  740. `--space-after-procedure-calls'
  741.      Insert a space between the name of the procedure being called and
  742.      the `('.
  743.      *Note Statements::.
  744. `-psl'
  745. `--procnames-start-lines'
  746.      Put the type of a procedure on the line before its name.
  747.      *Note Declarations::.
  748. `-sc'
  749. `--start-left-side-of-comments'
  750.      Put the `*' character at the left of comments.
  751.      *Note Comments::.
  752. `-sob'
  753. `--swallow-optional-blank-lines'
  754.      Swallow optional blank lines.
  755.      *Note Blank lines::.
  756. `-ss'
  757. `--space-special-semicolon'
  758.      On one-line `for' and `while' statments, force a blank before the
  759.      semicolon.
  760.      *Note Statements::.
  761. `-st'
  762. `--standard-output'
  763.      Write to standard output.
  764.      *Note Invoking indent::.
  765.      Tell `indent' the name of typenames.
  766.      *Note Declarations::.
  767. `-tsN'
  768. `--tab-sizeN'
  769.      Set tab size to N spaces.
  770.      *Note Indentation::.
  771. `--verbose'
  772.      Enable verbose mode.
  773.      *Note Miscellaneous options::.
  774. `-version'
  775.      Output the version number of `indent'.
  776.      *Note Miscellaneous options::.
  777. Options' Cross Key
  778. ------------------
  779.    Here is a list of options alphabetized by long option, to help you
  780. find the corresponding short option.
  781.      --blank-lines-after-block-comments              -bbb
  782.      --blank-lines-after-commas                      -bc
  783.      --blank-lines-after-declarations                -bad
  784.      --blank-lines-after-procedures                  -bap
  785.      --braces-after-if-line                          -bl
  786.      --brace-indent                                  -bli
  787.      --braces-on-if-line                             -br
  788.      --case-indentation                              -cliN
  789.      --comment-delimiters-on-blank-lines             -cdb
  790.      --comment-indentation                           -cN
  791.      --continuation-indentation                      -ciN
  792.      --continue-at-parentheses                       -lp
  793.      --cuddle-else                                   -ce
  794.      --declaration-comment-column                    -cdN
  795.      --declaration-indentation                       -diN
  796.      --dont-break-procedure-type                     -npsl
  797.      --dont-cuddle-else                              -nce
  798.      --dont-format-comments                          -nfca
  799.      --dont-format-first-column-comments             -nfc1
  800.      --dont-line-up-parentheses                      -nlp
  801.      --dont-space-special-semicolon                  -nss
  802.      --dont-star-comments                            -nsc
  803.      --else-endif-column                             -cpN
  804.      --format-all-comments                           -fca
  805.      --format-first-column-comments                  -fc1
  806.      --gnu-style                                     -gnu
  807.      --ignore-profile                                -npro
  808.      --indent-level                                  -iN
  809.      --k-and-r-style                                 -kr
  810.      --leave-optional-blank-lines                    -nsob
  811.      --leave-preprocessor-space                      -lps
  812.      --line-comments-indentation                     -dN
  813.      --line-length                                   -lN
  814.      --no-blank-lines-after-commas                   -nbc
  815.      --no-blank-lines-after-declarations             -nbad
  816.      --no-blank-lines-after-procedures               -nbap
  817.      --no-comment-delimiters-on-blank-lines          -ncdb
  818.      --no-space-after-casts                          -ncs
  819.      --no-parameter-indentation                      -nip
  820.      --no-space-after-function-call-names            -npcs
  821.      --no-verbosity                                  -nv
  822.      --original                                      -orig
  823.      --parameter-indentation                         -ipN
  824.      --procnames-start-lines                         -psl
  825.      --space-after-cast                              -cs
  826.      --space-after-procedure-calls                   -pcs
  827.      --space-special-semicolon                       -ss
  828.      --standard-output                               -st
  829.      --start-left-side-of-comments                   -sc
  830.      --swallow-optional-blank-lines                  -sob
  831.      --tab-size                                      -tsN
  832.      --verbose                                       -v
  833. File: indent.info,  Node: Index,  Prev: Option Summary,  Up: Top
  834. Index
  835. *****
  836. * Menu:
  837. * -blank-after-sizeof:                  Statements.
  838. * -blank-lines-after-commas:            Declarations.
  839. * -blank-lines-after-declarations:      -bad.
  840. * -blank-lines-after-procedures:        -bap.
  841. * -brace-indentN:                       Statements.
  842. * -braces-after-if-line:                Statements.
  843. * -braces-on-if-line:                   Statements.
  844. * -case-indentationN:                   Statements.
  845. * -comment-delimiters-on-blank-lines:   Comments.
  846. * -comment-indentationN:                Comments.
  847. * -continuation-indentationN:           Indentation.
  848. * -continue-at-parentheses:             Indentation.
  849. * -cuddle-else:                         Statements.
  850. * -declaration-comment-columnN:         Comments.
  851. * -declaration-indentationN:            Declarations.
  852. * -dont-break-procedure-type:           Declarations.
  853. * -dont-cuddle-else:                    Statements.
  854. * -dont-format-comments:                Comments.
  855. * -dont-format-first-column-comments:   Comments.
  856. * -dont-line-up-parentheses:            Indentation.
  857. * -dont-space-special-semicolon:        Statements.
  858. * -dont-star-comments:                  Comments.
  859. * -else-endif-columnN:                  Comments.
  860. * -format-all-comments:                 Comments.
  861. * -format-first-column-comments:        Comments.
  862. * -gnu-style:                           Common styles.
  863. * -ignore-profile:                      Invoking indent.
  864. * -indent-levelN:                       Indentation.
  865. * -k-and-r-style:                       Common styles.
  866. * -leave-optional-blank-lines:          Blank lines.
  867. * -leave-preprocessor-space:            Indentation.
  868. * -line-comments-indentationN:          Comments.
  869. * -line-lengthN:                        Comments.
  870. * -no-blank-lines-after-commas:         Declarations.
  871. * -no-blank-lines-after-declarations:   -bad.
  872. * -no-blank-lines-after-procedures:     -bap.
  873. * -no-comment-delimiters-on-blank-lines: Comments.
  874. * -no-parameter-indentation:            Indentation.
  875. * -no-space-after-casts:                Statements.
  876. * -no-space-after-function-call-names:  Statements.
  877. * -no-verbosity:                        Miscellaneous options.
  878. * -original:                            Common styles.
  879. * -output-file:                         Invoking indent.
  880. * -parameter-indentationN:              Indentation.
  881. * -procnames-start-lines:               Declarations.
  882. * -remove-preprocessor-space:           Indentation.
  883. * -space-after-cast:                    Statements.
  884. * -space-after-procedure-calls:         Statements.
  885. * -space-special-semicolon:             Statements.
  886. * -standard-output:                     Invoking indent.
  887. * -star-left-side-of-comments:          Comments.
  888. * -swallow-optional-blank-lines:        Blank lines.
  889. * -tab-sizeN:                           Indentation.
  890. * -verbose:                             Miscellaneous options.
  891. * -bad:                                 -bad.
  892. * -bap:                                 -bap.
  893. * -bc:                                  Declarations.
  894. * -bl:                                  Statements.
  895. * -bliN:                                Statements.
  896. * -br:                                  Statements.
  897. * -bs:                                  Statements.
  898. * -cN:                                  Comments.
  899. * -cdN:                                 Comments.
  900. * -cdb:                                 Comments.
  901. * -ce:                                  Statements.
  902. * -ciN:                                 Indentation.
  903. * -cliN:                                Statements.
  904. * -cpN:                                 Comments.
  905. * -cs:                                  Statements.
  906. * -dN:                                  Comments.
  907. * -dce:                                 Statements.
  908. * -diN:                                 Declarations.
  909. * -fc1:                                 Comments.
  910. * -fca:                                 Comments.
  911. * -gnu:                                 Common styles.
  912. * -iN:                                  Indentation.
  913. * -ipN:                                 Indentation.
  914. * -kr:                                  Common styles.
  915. * -lN:                                  Comments.
  916. * -lp:                                  Indentation.
  917. * -lps:                                 Indentation.
  918. * -nbad:                                -bad.
  919. * -nbap:                                -bap.
  920. * -nbc:                                 Declarations.
  921. * -ncdb:                                Comments.
  922. * -ncs:                                 Statements.
  923. * -nfc1:                                Comments.
  924. * -nfca:                                Comments.
  925. * -nip:                                 Indentation.
  926. * -nlp:                                 Indentation.
  927. * -nlps:                                Indentation.
  928. * -npcs:                                Statements.
  929. * -npro:                                Invoking indent.
  930. * -npsl:                                Declarations.
  931. * -nsc:                                 Comments.
  932. * -nsob:                                Blank lines.
  933. * -nss:                                 Statements.
  934. * -nv:                                  Miscellaneous options.
  935. * -o:                                   Invoking indent.
  936. * -orig:                                Common styles.
  937. * -pcs:                                 Statements.
  938. * -psl:                                 Declarations.
  939. * -sc:                                  Comments.
  940. * -sob:                                 Blank lines.
  941. * -ss:                                  Statements.
  942. * -st:                                  Invoking indent.
  943. * -T:                                   Declarations.
  944. * -tsN:                                 Indentation.
  945. * -v:                                   Miscellaneous options.
  946. * -version:                             Miscellaneous options.
  947. * etags requires -psl:                  Declarations.
  948. * .indent.pro file:                     Invoking indent.
  949. * Beginning indent:                     Invoking indent.
  950. * Berkeley style:                       Common styles.
  951. * Blank lines:                          Blank lines.
  952. * Comments:                             Comments.
  953. * GNU style:                            Common styles.
  954. * Initialization file:                  Invoking indent.
  955. * Invoking indent:                      Invoking indent.
  956. * Kernighan & Ritchie style:            Common styles.
  957. * Long options, use of:                 Invoking indent.
  958. * Original Berkeley style:              Common styles.
  959. * Output File Specification:            Invoking indent.
  960. * Standard Output:                      Invoking indent.
  961. * Starting indent:                      Invoking indent.
  962. * Typenames:                            Declarations.
  963. * Using Standard Input:                 Invoking indent.
  964. Tag Table:
  965. Node: Top
  966. Node: Indent Program
  967. Node: Invoking indent
  968. Node: Backup files
  969. Node: Common styles
  970. Node: Blank lines
  971. Node: -bad
  972. 10168
  973. Node: -bap
  974. 10815
  975. Node: Comments
  976. 11676
  977. Node: Statements
  978. 15997
  979. Node: Declarations
  980. 18421
  981. Node: Indentation
  982. 20038
  983. Node: Disabling Formatting
  984. 22362
  985. Node: Miscellaneous options
  986. 24101
  987. Node: Bugs
  988. 24652
  989. Node: Copyright
  990. 24964
  991. Node: Option Summary
  992. 26344
  993. Node: Index
  994. 35844
  995. End Tag Table
  996.