home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 042.lha / c / print.doc < prev    next >
Text File  |  1987-06-25  |  5KB  |  144 lines

  1.                C   P r i n t   R o u t i n e   V1.1
  2.  
  3. SYNTAX
  4.       print <[-n] [-v]> <filename>
  5.  
  6. DESCRIPTION
  7.       This program is designed to paginate, and print C programs from
  8. the raw C file.  It may be used with any textual file, but the pagin-
  9. ation string cannot be changed in this version.  All page format sizes
  10. are taken from the active Preferences structure.  These sizes include
  11. number of lines per page, left, and right margins.  Output is sent to
  12. the PRT: device, and may not be redirected.  A banner is generated
  13. with the internal clock, and the day, date, time, and page number is
  14. printed at the top of each page.  Currently, there are three lines
  15. consumed at the top of each page for this header.  Printing of the
  16. file data begins on line 4 (if you number lines starting with 1).
  17.  
  18.       Two flags are supported in this version:
  19.       -v verbose mode.
  20.       -n no print mode.
  21.  
  22.       Verbose mode is used to print the name of the currently printing
  23. file on the console.  This is particularly useful if the files to be
  24. printed are listed using wildcards (see below for info on using wild-
  25. cards in your application).
  26.  
  27.       No print mode is useful to suppress printing, but have the program
  28. write to the console the names of all files that match the given file
  29. string(s).
  30.  
  31.       This program is free form input, and the flags may appear any-
  32. place on the command line.  All flags specified take effect on all files
  33. to be printed.  Files are printed in the order that they are specified
  34. on the command line.  Files that use wildcards are printed as names
  35. from the source directory match.  These are therefore printed in the
  36. same order as they would appear in a "list" command.
  37.  
  38.  
  39. --- Pagination ---
  40.  
  41.       Pagination of the listing is possible by inserting the following
  42. string anywhere in the C program:
  43.  
  44.    /*E*/
  45.  
  46. This may appear in comments if the compiler you are using supports
  47. nesting of comments, otherwise you will have a catastrophe (the compiler
  48. barfs).  Version 1.1 does not support changing this string, but later
  49. versions may.
  50.  
  51.       Whenever this string is found in the input file, a page break is
  52. executed by sending a formfeed to the PRT: device.  A new banner is
  53. printed at the top of the page, and the page number is incremented.
  54.  
  55.  
  56. --- Wildcards ---
  57.  
  58.       The standard AmigaDOS wildcards may be used in specification of
  59. the files to be printed.  These wildcards are:
  60.  
  61.    # - match zero or more of the following character.
  62.  
  63.    ? - match any character in this location.
  64.  
  65.       These wildcards may be combined to match any number of characters
  66. in the filename.  Hence, the command:
  67.  
  68.    print #?.c
  69.  
  70. will match any file in the current directory that has a ".c" extension.
  71.  
  72.       There are several restrictions in the use of these wildcards in
  73. combination with one another.  An example valid file pattern is:
  74.  
  75.    print ???x#?
  76.  
  77. This will print any file that has "x" as the 4th character.  Notice that
  78. the "?" wildcard acts as a placeholder, and matches anything.  These
  79. patterns will not do what you would think:
  80.  
  81.    print #
  82.    print #??
  83.    print #?#?
  84.  
  85.       Note that the appearance of a wildcard after the compound wildcard
  86. is not interpreted correctly.  Since these are nonsensical, I saw no
  87. reason to program around them.  Therefore, the following rules MUST be
  88. adhered to for predictable operation:
  89.  
  90. RULE 1 : A valid filename character MUST appear after the compound wildcard
  91.          "#?", that is not a wildcard character.
  92.  
  93. RULE 2 : A valid filename character or "?" MUST appear after the "#"
  94.          wildcard character.
  95.  
  96.       I have not seen the program hang or crash if the above rules are
  97. not followed, but I do not recommend their use.
  98.  
  99.  
  100. --- Stopping the Program ---
  101.  
  102.       You may stop the printing at any point in the process by using
  103. the CTRL-C combination.  The program will stop printing the current
  104. file, clean up, and exit.  Due to printer buffering, the printer may
  105. not stop immediately, but will eventually.
  106.  
  107.  
  108. --- Notes ---
  109.  
  110.       There may be a small delay after the banner is printed on the
  111. first page of the first file, and before the first line is printed
  112. from the file.  This is due to the small inserted delay (approximately
  113. 0.5 seconds) at the end of each line.  Since the Amiga can process
  114. the characters out to the printer much faster than the printer can
  115. print them, long listings could cause a request to stop printing take
  116. a long time to implement (once again due to printer buffering).  The
  117. next version will implement a settable delay.
  118.  
  119.  
  120.       I hope you enjoy this program.  Send me compuserve E-Mail if you
  121. have any suggestions, or find any latent bugs.  I would be happy to hear
  122. from you.  Source is not yet available, but if I get enough inquiries,
  123. I would be willing to clean up the source, and distribute it also.
  124.  
  125. DISCLAIMER
  126.       This program may be freely distributed, and copied in any form.  My
  127. only request is that it is not sold, or incorporated as part of any
  128. commercial product with prior written permission.  This program must
  129. remain as a single unit.
  130.  
  131.       No warranty or liability is assumed by the author for any damage,
  132. or loss incurred by the use (or misuse) of this program.
  133.  
  134.  
  135.  
  136.                                  ENJOY,
  137.  
  138.                                  Vincent M. Hopson
  139.                                  Compuserve : 71550,2754
  140.                                  108 Andrew Place
  141.                                  Sterling VA 22170
  142.  
  143.  
  144.