
Print Formatter for C Code                                             Page 1













                              Print Formatter for 
                                C and C++ Files
                                        
                       Copyright Corel Systems Corp. 1991
                                   Pat Beirne
     

Print Formatter for C Code                                             Page 2



==> Description:
     
     The  program  PDOC.COM accepts .C and .H files and creates a formatted
     print file. The format have been carefully designed by Marcus  et  al.
     [at  Berkley]  to highlight the significant parts of source files, and
     to aid in understanding.
     
     This version [1.7] can synthesize LaserJet  and  PostScript  codes  to
     produce  printed  pages  which closely follow the designer's guide. It
     can also synthesize RTF codes, with some  deviation  from  the  design
     guide.



==> Usage:
     
     The  program  should  be  run  from  the  DOS prompt, using 2 file (or
     device) names:
        PDOC [-L] | [-P] | [-R] [-n] [-?] sourcefile destfile
           -L uses LaserJet (default)
           -P uses PostScript codes
           -R uses RTF codes
           -n sets the tab width to n
           -? help
     
     Typically, I use lines like:
        PDOC -3 page.c lpt1
        PDOC -p -3 object.h lpt2
        PDOC -p -3 object.h f:tempfile.psc
        PDOC -r -8 c:\include\windows.h f:winh.rtf



==> Output Format:
     
     At the top of each page is a page header, showing the print time,  the
     file  name  and the page number. These are things that I always felt I
     needed in source code printouts.
     
     Below that is the source code. The  printed  format  puts  the  source
     codes into two columns. The left column is 2 inches wide, and contains
     only  comments.  It is intended to be where one would add hand written
     notes, punched holes or a binding. The right column is 6  inches  wide
     and holds the bulk of the source code.
     
     Most of the .C code is printed in 8 point Helvetica. This font is very
     legible  and  packs well. C language keywords (and C++) are printed in
     italics, just so that they  stand  out  from  the  bulk.  Preprocessor
     commands  are  printed  in  bold,  so that they stick out as well. Any
     strings are printed in 8 point Courier (or LinePrinter)  so  that  the
     reader is reminded that they are strings.
     
     Comments  that  are  own  their  own  lines are treated as significant
     paragraphs of information; explanations. They  are  printed  in  Times
     (the  most  legible  font)  on  a gray background. The gray background
     helps remind the reader that this is comments, and helps separate  the


Copyright Corel Systems Corp. 1991

Print Formatter for C Code                                             Page 3



     sections of code.
     
     Any  comments that are found in line with some code are printed in the
     left column, again in Times. These comments are treated as annotations
     concerning specific lines, much as if they are annotations.
     
     If the parser  discovers  a  line  which  appears  to  be  a  function
     declaration,   the  function  name  is  printed  in  12  or  14  point
     Helevetica-Bold, with a wide underbar. This helps break up  the  body,
     and helps locate functions.
     
     The PostScript option produces placeable EPS files.
     
     If  you  use  the  RTF  option,  the  output does not follow the above
     placement rules, since Word4Windows  has  real  trouble  putting  text
     right-column-then-left-column.   It  also  has  trouble  with  colored
     backgrounds. So, for RTF:
        everything begins in column 1
        comments are in blue, Times 8 point
        the tab control is not as good as the other conversions



==> Notes:
     
     The LaserJet codes have been carefully selected so  that  these  codes
     work equally well on the Kyocera series and on the LaserJet III.



==> Known Bugs:
     
     Sometimes long lines will not be fully visible on the output.
     
==>  History:
     
     1.5   Added C++ codes
     1.6   minor touch on the dimensions of the gray boxes
     1.7   Added RTF generator
           Added LaserJet III codes
           Fixed bug with "strings with embedd'd quotes"
           added #ifndef to keywords
           optimized lines with trailing whitespace
           recognize form feeds in the source



==> Conditions:
     
     Naturally,  we  deny  any  responsibility  for  any  problems  you may
     encounter with the program. We do not support in any way this program.
     
     The only condition on the use of this program is that we require  that
     any  enhancements you may make be sent back to us, so that we may take
     advantage of them.



Copyright Corel Systems Corp. 1991
