home *** CD-ROM | disk | FTP | other *** search
- Dr. Chip's C Beautifier V1.02 Copyright 1993,1994 Charles E. Campbell, Jr
- ----------------------------------------------------------------------
-
- Copyright:
-
- This program (ccb) and associated documents are copyrighted 1993
- by Charles E. Campbell, Jr, PhD.
-
-
- Restrictions:
-
- All rights to ccb and its documents are reserved, except for those
- explicitly granted herein.
-
- No representation or warranties are made with respect to the accuracy,
- reliability, performance, or operation of this software, and all such
- use is at your own risk. The author does not assume any responsiblity
- or liability whatsoever with respect to your use of this software.
-
- Ccb may not be included with any commercial product nor may it be
- sold for profit either separately or as part of a compilation without
- the permission of Dr. Charles E. Campbell, Jr. It may be included in
- non-profit disk collections such as the Fred Fish collection. It may
- be archived and uploaded to electronic bulletin board systems so long
- as all files remain together and unaltered. It may be copied to and used on
- individuals' computer systems.
-
-
- Author : Dr. Charles E. Campbell, Jr.
- Contact: cec@gryphon.gsfc.nasa.gov
- Version: 1.02
-
-
- Usage
-
- ccb [-bBcdfirsv]
-
-
- Options
-
- -b: place a bar between functions
- -B: replace leading blanks+tabs, not just tabs
- -BB: replace leading tabs and >=3 blanks
- -c: don't detab case statements by one
- -d: de-tab close curly
- -f: don't de-tab functions by one
- -i: don't use if/do/while/else/for mode
- -r: replace input file with beautified file (dangerous)
- -s: save output in *.cb file(s)
- -v: verbose mode (to stderr)
-
-
- Explanation
-
- The ccb program is Dr. Chip's C beautifier program. It enforces my preferred
- tabbing rules based upon the current number of open curly braces and can shift
- comments and open curly braces around near if, for, else, else if, do, and
- switch statements. The ccb program has an obvious relationship with the
- *IX cb program, but has a different (default) style. The default style is, of
- course, Dr. Chip's preference, but can be modified to the "standard" cb
- style with the options "-cdfi". Naturally, my style is the best! :)
-
- Caveats: this is version 1.02, and as such it may well have bugs. It may
- not function with your style of coding, especially if you do funky things
- with the preprocessor. It has the potential to mess up your code, so:
-
- *** USE AT YOUR OWN RISK ***
-
- Normally, the ccb program puts its output onto stdout, so its output can
- be filtered, etc. However, the -r flag will replace your files with the
- "beautified" code (again: this is dangerous), although the old files will
- be kept with a .bak suffix. Don't remove your *.bak files until you're
- sure the beautified ones will compile correctly.
-
- Dr. Chip's C beautifier also contains extensions which should enable
- it to work with C++ programs, too.
-
- The <rdcolor.dat> file should be moved to the s: directory. Set the
- environment variable
-
- setenv ChipData s:
-
- so that the programs can find it. The file provides a mapping from color
- names to escape sequences, and it should be fairly obvious as to how to
- modify it to suit your requirements.
-
- The hdrtag program was compiled with Aztec C on an A3000 with the following
- options: CCOPTS=-qf -wp -c2 -f8.
-
- Good luck, and let me know of any problems you encounter, and any attaboys
- will be appreciated :)
-
-
- New Stuff
-
- The ccb program has had very few bug fixes and appears pretty stable.
- The main new thing is the "-BB" option, which retains leading 1 or 2
- blanks.
-