*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> cb (1)              


CB(1)			       Silicon Graphics				 CB(1)

NAME    [Toc]    [Back]

     cb	- C program beautifier

SYNOPSIS    [Toc]    [Back]

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

DESCRIPTION    [Toc]    [Back]

     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

SEE ALSO    [Toc]    [Back]

     Kernighan,	B. W., and Ritchie, D. M., The C Programming Language.
     Prentice-Hall, 1978.

BUGS    [Toc]    [Back]

     Punctuation that is hidden	in preprocessor	statements will	cause indentation

Page 2				 Release 6.4
[ Back ]
 Similar pages
Name OS Title
setmemwindow HP-UX changes the window id of a running program or starts a program in a particular memory window
getprogname FreeBSD get or set the program name
setprogname FreeBSD get or set the program name
lint Tru64 a C program checker
lint NetBSD a C program verifier
units FreeBSD conversion program
xrx Tru64 helper program
getprogname NetBSD get/set the name of the current program
setsid Linux run a program in a new session
setprogname NetBSD get/set the name of the current program
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service