GNU Info

Info Node: (indent.info)Declarations

(indent.info)Declarations


Next: Indentation Prev: Statements Up: Indent Program
Enter node , (file) or (file)node

Declarations
============

   By default `indent' will line up identifiers, in the column
specified by the `-di' option.  For example, `-di16' makes things look
like:

     int             foo;
     char           *bar;

   Using a small value (such as one or two) for the `-di' option can be
used to cause the identifiers to be placed in the first available
position; for example:

     int foo;
     char *bar;

   The value given to the `-di' option will still affect variables
which are put on separate lines from their types, for example `-di2'
will lead to:

     int
       foo;

   If the `-bc' option is specified, a newline is forced after each
comma in a declaration.  For example,

     int a,
       b,
       c;

With the `-nbc' option this would look like

     int a, b, c;

   The `-bfda' option causes a newline to be forced after the comma
separating the arguments of a function declaration.  The arguments will
appear at the current indention level matching the opening paren.  This
is particularly helpful for functions with long argument lists.   For
example,

     void foo (int arg1, char arg2, int *arg3, long arg4, char arg5);

With the `-bfda' option this would look like

     void foo (int arg1,
               char arg2,
               int *arg3,
               long arg4,
               char arg5);

   The `-psl' option causes the type of a procedure being defined to be
placed on the line before the name of the procedure.  This style is
required for the `etags' program to work correctly, as well as some of
the `c-mode' functions of Emacs.

   You must use the `-T' option to tell `indent' the name of all the
typenames in your program that are defined by `typedef'.  `-T' can be
specified more than once, and all names specified are used.  For
example, if your program contains

     typedef unsigned long CODE_ADDR;
     typedef enum {red, blue, green} COLOR;

you would use the options `-T CODE_ADDR -T COLOR'.

   The `-brs' or `-bls' option specifies how to format braces in struct
declarations.  The `-brs' option formats braces like this:

     struct foo {
       int x;
     };

The `-bls' option formats them like this:

     struct foo
     {
       int x;
     };


automatically generated by info2www version 1.2.2.9