Path: utzoo!attcan!uunet!husc6!mailrus!ncar!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Personal style -vs- Standards Keywords: Formatting, Indentation Message-ID: <15153@mimsy.UUCP> Date: 23 Dec 88 06:54:31 GMT References: <663@htsa.uucp> <832@husc6.harvard.edu> <2450@ficc.uu.net> <88Dec21.213900est.10762@ephemeral.ai.toronto.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 67 >In article <519@midgard.Midgard.MN.ORG> dal@midgard.Midgard.MN.ORG >(Dale Schumacher) writes: >>... the 'cb' type programs I've seen have the major disadvantage that >>the formatting rules are hard coded and even at that, don't seem to do >>a very good job of fully converting to a consistent style. In article <88Dec21.213900est.10762@ephemeral.ai.toronto.edu> bradb@ai.toronto.edu (Brad Brown) writes: >cb from Polytron can be given flags that tell it when to break lines. ... > >The C-DOC package from Software Blacksmith's Inc. is a complete documentation >package that handles reformatting and cross references and a whole bunch of >things. ... C-DOC may do more; but there is a program supplied with 4.3BSD called `indent' that (while it has some nontrivial bugs) does a fairly good job. It has over 15 boolean options alone: Boolean: ( on | off ) (if on) -bad | -nbad force blank line after block of declarations -bap | -nbap force blank line after procedure body -bbb | -nbbb force blank line before block comment -bc | -nbc force newline after each comma in declarations -ce | -nce force `} else {' format (vs }\nelse) -dj | -ndj left-justify declarations -ei | -nei handle `else if' as a unit (vs else\n\tif) -fc1 | -nfc1 enable formatting comments starting in col 1 -ip | -nip do indent parameter declarations -lp | -nlp line up continuations under unclosed parentheses -pcs | -npcs put space after procedure call: `fn (arg1, arg2)' -ps | -nps put spaces around `->': `p -> field' -psl | -npsl put procedure names on col 1 (int\nfoo()) -sc | -nsc put stars `*' at left edge of multi-line comments -sob | -nsob swallow (eat) certain optional blank lines (this is basically to undo -bad above) -v | -nv be verbose (to stderr) Numeric: (name) (function) -c column for comments on code lines -cd column for comments on declaration lines -ci continuation line (extra) indentation -cli case label indent (in `tab stops'; can be 0.0