cb man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



CB(1)			       Silicon Graphics				 CB(1)

NAME
     cb - C program beautifier

SYNOPSIS
     cb [ -s ] [ -j ] [ -n ] [ -l leng ] [ -t shiftwidth ] [ file ... ]

DESCRIPTION
     The cb command reads C programs either from its arguments or from the
     standard input, and writes them on the standard output with spacing and
     indentation that display the structure of the code.  Under default
     options, cb preserves all user new-lines.

     cb accepts the following options.

     -s		 Canonicalizes the code to the style of Kernighan and Ritchie
		 in The C Programming Language.

     -j		 Causes split lines to be put back together.

     -n		 Causes pairs of left braces with only whitespace between them
		 to be interpreted as code braces.  By default, such pairs of
		 braces are assumed to be structure initializations and less
		 indentation is done; this causes code-brace pairs to produce
		 odd output.   An example will clarify this.
		 File t.c:

		    int x; main() { { { x = 3; } } }
		 cb t.c produces

		    int x;
		    main() {
			    { {
				    x = 3;
			    }
		    }
		    }
		 Note the right braces prematurely at the left margin.	On the
		 other hand,  cb -n t.c produces

		    int x;
		    main() {
			    {
				    {
					    x = 3;
				    }
			    }
		    }

Page 1				 Release 6.4

CB(1)			       Silicon Graphics				 CB(1)

     -l	 leng	 Causes cb to split lines that are longer than leng.

     -t	 shiftwidth
		 tells cb to use a soft tab stop which is different from the
		 hard tabs. Tab characters will be used to save space where
		 possible.

SEE ALSO
     cc(1).
     Kernighan, B. W., and Ritchie, D. M., The C Programming Language.
     Prentice-Hall, 1978.

BUGS
     Punctuation that is hidden in preprocessor statements will cause indenta-
     tion errors.

Page 2				 Release 6.4

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net