home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsf / indent / Manual < prev    next >
Text File  |  1995-10-27  |  15KB  |  311 lines

  1.  
  2.  
  3.  
  4.      INDENT(1)         UNIX System V (July 14, 1989)         INDENT(1)
  5.  
  6.  
  7.  
  8.      NAME
  9.           indent - indent and format C program source
  10.  
  11.      SYNOPSIS
  12.           indent  [ input-file [ output-file ] ] [ -bad | -nbad ]
  13.                  [ -bap | -nbap ] [ -bbb | -nbbb ] [ -bc | -nbc ]
  14.                  [ -bl ] [ -br ] [ -brr ] [ -cn ] [ -cdn ]
  15.                  [ -cdb | -ncdb ] [ -ce | -nce ] [ -cin ] [ -clin ]
  16.                  [ -ccin ] [ -dn ] [ -din ] [ -fc1 | -nfc1 ] [ -in ]
  17.                  [ -ip | -nip ] [ -ln ] [ -lcn ] [ -lp | -nlp ]
  18.                  [ -pcs | -npcs ] [ -npro ] [ -prs | -nprs ]
  19.                  [ -psl | -npsl ] [ -sc | -nsc ] [ -sob | -nsob ]
  20.                  [ -st ] [ -troff ] [ -v | -nv ] [ -+ ]
  21.  
  22.  
  23.      DESCRIPTION
  24.           Indent is a C program formatter.  It reformats the C program
  25.           in the input-file according to the switches.  The switches
  26.           which can be specified are described below. They may appear
  27.           before or after the file names.
  28.  
  29.           NOTE: If you only specify an input-file, the formatting is
  30.           done `in-place', that is, the formatted file is written back
  31.           into input-file and a backup copy of input-file is written
  32.           in the current directory.  If input-file is named
  33.           `/blah/blah/file', the backup file is named file.BAK.
  34.  
  35.           If output-file is specified, indent checks to make sure it
  36.           is different from input-file.
  37.  
  38.      OPTIONS
  39.           The options listed below control the formatting style
  40.           imposed by indent.
  41.  
  42.           -bap,-nbap     If -bap is specified, a blank line is forced
  43.                          after every procedure body.  Default:  -nbap.
  44.  
  45.           -bad,-nbad     If -bad is specified, a blank line is forced
  46.                          after every block of declarations.  Default:
  47.                          -nbad.
  48.  
  49.           -bbb,-nbbb     If -bbb is specified, a blank line is forced
  50.                          before every block comment.  Default:  -nbbb.
  51.  
  52.           -bc,-nbc       If -bc is specified, then a newline is forced
  53.                          after each comma in a declaration. -nbc turns
  54.                          off this option.  The default is -bc.
  55.  
  56.           -br,-bl,-brr   Specifying -bl lines up compound statements
  57.                          like this:
  58.                              if (...)
  59.                              {
  60.                                  code
  61.                              }
  62.                          Specifying -br (the default) makes them look
  63.                          like this:
  64.                              if (...) {
  65.                                  code
  66.                              }
  67.                          And specifying -brr makes them look like
  68.                          this:
  69.                              if (...)
  70.                                  {
  71.                                  code
  72.                                  }
  73.  
  74.           -cn            The column in which comments on code start.
  75.                          The default is 33.
  76.  
  77.           -cdn           The column in which comments on declarations
  78.                          start.  The default is for these comments to
  79.                          start in the same column as those on code.
  80.  
  81.           -cdb,-ncdb     Enables (disables) the placement of comment
  82.                          delimiters on blank lines.  With this option
  83.                          enabled, comments look like this:
  84.                               /*
  85.                                * this is a comment
  86.                                */
  87.                          Rather than like this:
  88.                               /* this is a comment */
  89.                          This only affects block comments, not
  90.                          comments to the right of code. The default is
  91.                          -cdb .
  92.  
  93.           -ce,-nce       Enables (disables) forcing `else's to cuddle
  94.                          up to the immediatly preceeding `}'.  The
  95.                          default is -ce .
  96.  
  97.           -cin           Sets the continuation indent to be n.
  98.                          Continuation lines will be indented that far
  99.                          from the beginning of the first line of the
  100.                          statement.  Parenthesized expressions have
  101.                          extra indentation added to indicate the
  102.                          nesting, unless -lp is in effect.  -ci
  103.                          defaults to the same value as -i.
  104.  
  105.           -clin          Causes case labels to be indented n tab stops
  106.                          to the right of the containing switch
  107.                          statement.  -cli0.5 causes case labels to be
  108.                          indented half a tab stop.  The default is
  109.                          -cli0 .
  110.  
  111.           -ccin          Causes case code to be indented n tab stops
  112.                          to the right of the corresponding case label.
  113.                          -cci0.5 causes case code to be indented half
  114.                          a tab stop.  The default is -cci1 .
  115.  
  116.           -dn            Controls the placement of comments which are
  117.                          not to the right of code.  The default -d1
  118.                          means that such comments are placed one
  119.                          indentation level to the left of code.
  120.                          Specifying -d0 lines up these comments with
  121.                          the code.  See the section on comment
  122.                          indentation below.
  123.  
  124.           -din           Specifies the indentation, in character
  125.                          positions, from a declaration keyword to the
  126.                          following identifier.  The default is -di16 .
  127.  
  128.           -fc1,-nfc1     Enables (disables) the formatting of comments
  129.                          that start in column 1.  Often, comments
  130.                          whose leading `/' is in column 1 have been
  131.                          carefully hand formatted by the programmer.
  132.                          In such cases, -nfc1 should be used.  The
  133.                          default is -fc1.
  134.  
  135.           -in            The number of spaces for one indentation
  136.                          level.  The default is 4.
  137.  
  138.           -ip,-nip       Enables (disables) the indentation of
  139.                          parameter declarations from the left margin.
  140.                          The default is -ip .
  141.  
  142.           -ln            Maximum length of an output line.  The
  143.                          default is 75.
  144.  
  145.           -npro          Causes the profile files, `./.indent.pro' and
  146.                          `~/.indent.pro', to be ignored.
  147.  
  148.           -lp,-nlp       Lines up code surrounded by parenthesis in
  149.                          continuation lines.  If a line has a left
  150.                          paren which is not closed on that line, then
  151.                          continuation lines will be lined up to start
  152.                          at the character position just after the left
  153.                          paren.  For example, here is how a piece of
  154.                          continued code looks with -nlp in effect:
  155.                              p1 = first_procedure(second_procedure(p2, p3),
  156.                                  third_procedure(p4, p5));
  157.                          With -lp in effect (the default) the code
  158.                          looks somewhat clearer:
  159.                              p1 = first_procedure(second_procedure(p2, p3),
  160.                                                   third_procedure(p4, p5));
  161.                          Inserting a couple more newlines we get:
  162.                              p1 = first_procedure(second_procedure(p2,
  163.                                                                    p3),
  164.                                                   third_procedure(p4,
  165.                                                                   p5));
  166.  
  167.           -pcs , -npcs   If true (-pcs) all procedure calls will have
  168.                          a space inserted between the name and the
  169.                          '('.  The default is -npcs
  170.  
  171.           -prs , -nprs   If true (-prs) all parentheses will have a
  172.                          space inserted after the '(' and before the
  173.