home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / DCHIP103.LHA / DrChip / ccb / ccb.doc next >
Encoding:
Text File  |  1994-11-08  |  3.6 KB  |  99 lines

  1.         Dr. Chip's C Beautifier V1.02 Copyright 1993,1994 Charles E. Campbell, Jr
  2.        ----------------------------------------------------------------------
  3.  
  4. Copyright:
  5.  
  6.     This program (ccb) and associated documents are copyrighted 1993
  7.     by Charles E. Campbell, Jr, PhD.
  8.  
  9.  
  10. Restrictions:
  11.  
  12.     All rights to ccb and its documents are reserved, except for those
  13.     explicitly granted herein.
  14.  
  15.     No representation or warranties are made with respect to the accuracy,
  16.     reliability, performance, or operation of this software, and all such
  17.     use is at your own risk.  The author does not assume any responsiblity
  18.     or liability whatsoever with respect to your use of this software.
  19.  
  20.     Ccb may not be included with any commercial product nor may it be
  21.     sold for profit either separately or as part of a compilation without
  22.     the permission of Dr. Charles E. Campbell, Jr.  It may be included in
  23.     non-profit disk collections such as the Fred Fish collection.  It may
  24.     be archived and uploaded to electronic bulletin board systems so long
  25.     as all files remain together and unaltered.  It may be copied to and used on
  26.     individuals' computer systems.
  27.  
  28.  
  29. Author : Dr. Charles E. Campbell, Jr.
  30. Contact: cec@gryphon.gsfc.nasa.gov
  31. Version: 1.02
  32.  
  33.  
  34. Usage
  35.  
  36.     ccb [-bBcdfirsv]
  37.  
  38.  
  39. Options
  40.  
  41.     -b:  place a bar between functions
  42.     -B:  replace leading blanks+tabs, not just tabs
  43.     -BB: replace leading tabs and >=3 blanks
  44.     -c:  don't detab case statements by one
  45.     -d:  de-tab close curly
  46.     -f:  don't de-tab functions by one
  47.     -i:  don't use if/do/while/else/for mode
  48.     -r:  replace input file with beautified file (dangerous)
  49.     -s:  save output in *.cb file(s)
  50.     -v:  verbose mode (to stderr)
  51.  
  52.  
  53. Explanation
  54.  
  55.     The ccb program is Dr. Chip's C beautifier program.  It enforces my preferred
  56.     tabbing rules based upon the current number of open curly braces and can shift
  57.     comments and open curly braces around near if, for, else, else if, do, and
  58.     switch statements.  The ccb program has an obvious relationship with the
  59.     *IX cb program, but has a different (default) style.  The default style is, of
  60.     course, Dr. Chip's preference, but can be modified to the "standard" cb
  61.     style with the options "-cdfi".  Naturally, my style is the best! :)
  62.  
  63.     Caveats: this is version 1.02, and as such it may well have bugs.  It may
  64.     not function with your style of coding, especially if you do funky things
  65.     with the preprocessor.  It has the potential to mess up your code, so:
  66.  
  67.         *** USE AT YOUR OWN RISK ***
  68.  
  69.     Normally, the ccb program puts its output onto stdout, so its output can
  70.     be filtered, etc.  However, the -r flag will replace your files with the
  71.     "beautified" code (again: this is dangerous), although the old files will
  72.     be kept with a .bak suffix.  Don't remove your *.bak files until you're
  73.     sure the beautified ones will compile correctly.
  74.     
  75.     Dr. Chip's C beautifier also contains extensions which should enable
  76.     it to work with C++ programs, too.
  77.  
  78.     The <rdcolor.dat> file should be moved to the s: directory.  Set the
  79.     environment variable
  80.  
  81.        setenv ChipData s:
  82.  
  83.     so that the programs can find it.  The file provides a mapping from color
  84.     names to escape sequences, and it should be fairly obvious as to how to
  85.     modify it to suit your requirements.
  86.  
  87.     The hdrtag program was compiled with Aztec C on an A3000 with the following
  88.     options: CCOPTS=-qf -wp -c2 -f8.
  89.  
  90.     Good luck, and let me know of any problems you encounter, and any attaboys
  91.     will be appreciated :)
  92.  
  93.  
  94. New Stuff
  95.  
  96.     The ccb program has had very few bug fixes and appears pretty stable.
  97.     The main new thing is the "-BB" option, which retains leading 1 or 2
  98.     blanks.
  99.