home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 16 / FREEDOS.ZIP / FD_A4PRE.ZIP / SOURCE / MICROC.ZIP / NRO.H < prev    next >
C/C++ Source or Header  |  1995-03-24  |  8KB  |  199 lines

  1. /*
  2.  * NRO.H: Parameter file for NRO word processor
  3.  *
  4.  * Stephen L. Browning
  5.  * 5723 North Parker Avenue
  6.  * Indianapolis, Indiana 46220
  7.  *
  8.  * Ported to MS C 5.1 by John Dudeck 11/25/90.
  9.  */
  10.  
  11. /* some or all of this may be unnecessary for you */
  12.  
  13. #define EOS        '\0'
  14. #define CPMEOF    0x1a
  15. #define TRUE    -1
  16. #define FALSE    0
  17. #define OK        0
  18.  
  19. /* end of possible bogus hacks */
  20.  
  21. #define MACRO    0      /* macro definition */
  22. #define BP       1      /* begin page   */
  23. #define BR       2      /* break        */
  24. #define CE       3      /* center       */
  25. #define FI       4      /* fill         */
  26. #define FO       5      /* footer       */
  27. #define HE       6      /* header       */
  28. #define IN       7      /* indent       */
  29. #define LS       8      /* line spacing */
  30. #define NF       9      /* no fill      */
  31. #define PL      10      /* page lenght  */
  32. #define RM      11      /* right margin */
  33. #define SP      12      /* line space   */
  34. #define TI      13      /* temp indent  */
  35. #define UL      14      /* underline    */
  36. #define JU      15      /* justify      */
  37. #define NJ      16      /* no justify   */
  38. #define M1      17      /* top margin   */
  39. #define M2      18      /* second top margin    */
  40. #define M3      19      /* first bottom margin  */
  41. #define M4      20      /* bottom-most margin   */
  42. #define BS      21      /* allow/disallow '\b' in output */
  43. #define NE      22      /* need n lines */
  44. #define PC      23      /* page number character */
  45. #define CC      24      /* control character    */
  46. #define PO      25      /* page offset  */
  47. #define BO      26      /* bold face    */
  48. #define EH      27      /* header for even numbered pages       */
  49. #define OH      28      /* header for odd numbered pages        */
  50. #define EF      29      /* footer for even numbered pages       */
  51. #define OF      30      /* footer for odd numbered pages        */
  52. #define SO      31      /* source file  */
  53. #define CU      32      /* continuous underline */
  54. #define DE      33      /* define macro */
  55. #define EN      34      /* end macro definition */
  56. #define NR      35      /* set number register  */
  57.  
  58. #define UNKNOWN -1
  59.  
  60. /*
  61.  *      MAXLINE is set to a value slightly larger
  62.  *      than twice the longest expected input line.
  63.  *      Because of the way underlining is handled, the
  64.  *      input line which is to be underlined, can almost
  65.  *      triple in length.  Unlike normal underlining and
  66.  *      boldfacing, continuous underlining affects all
  67.  *      characters in the buffer, and represents the
  68.  *      worst case condition.  If the distance between
  69.  *      the left margin and the right margin is greater
  70.  *      than about 65 characters, and continuous underlining
  71.  *      is in effect, there is a high probability of buffer
  72.  *      overflow.
  73.  */
  74.  
  75. #define MAXLINE 512            /* was 200 */
  76. #define PAGELEN  66
  77. #define PAGEWIDTH 80
  78. #define HUGE    256
  79. #define LEFT    0               /* indecies into header margin limit arrays */
  80. #define RIGHT   1
  81. #define NFILES  4               /* nesting depth for input files */
  82.  
  83. /*
  84.  *      The following parameters may be defined in bdscio.h
  85.  */
  86.  
  87. #define YES     1
  88. #define NO      0
  89. #define ERR     -1
  90.  
  91. /*
  92.  *      The parameter values selected for macro definitions
  93.  *      are somewhat arbitrary.  MACBUF is the storage area
  94.  *      for both macro names and definitions.  Since macro
  95.  *      processing is handled by pushing back the expansion
  96.  *      into the input buffer, the longest possible expansion
  97.  *      would be MAXLINE characters.  Allowing for argument
  98.  *      expansion, MXMLEN was chosen slightly less than MAXLINE.
  99.  *      It is assumed that most macro definitions will not
  100.  *      exceed 20 characters, hence MXMDEF of 100.
  101.  */
  102.  
  103. #define MXMDEF  100             /* maximum no. of macro definitions */
  104. #define MACBUF  4000            /* macro definition buffer was 2000 */
  105. #define MXMLEN  512             /* maximum length of each macro def was 100 */
  106. #define MNLEN   10              /* maximum length of macro name */
  107.  
  108. struct macros {
  109.         char *mnames[MXMDEF];   /* table of pointers to macro names */
  110.         int lastp;              /* index to last mname  */
  111.         char *emb;              /* next char avail in macro defn buffer */
  112.         char mb[MACBUF];        /* table of macro definitions */
  113.         char *ppb;              /* pointer into push back buffer */
  114.         char pbb[MAXLINE];      /* push back buffer */
  115. };
  116.  
  117.  
  118. /* control parameters for nro */
  119.  
  120. struct docctl {
  121.         int fill;       /* fill if YES, init = YES              */
  122.         int lsval;      /* current line spacing, init = 1       */
  123.         int inval;      /* current indent, >= 0, init = 0       */
  124.         int rmval;      /* current right margin, init = 60      */
  125.         int tival;      /* current temp indent, init = 0        */
  126.         int ceval;      /* number of lines to center, init = 0  */
  127.         int ulval;      /* number of lines to underline, init = 0 */
  128.         int cuval;      /* no. lines to continuously underline, init = 0 */
  129.         int juval;      /* justify if YES, init = YES           */
  130.         int boval;      /* number of lines to bold face, init = 0 */
  131.         int bsflg;      /* can output contain '\b', init = FALSE */
  132.         int buflg;      /* enable bold and underline, init = FALSE */
  133.         char pgchr;     /* page number character, init = '#'    */
  134.         char cmdchr;    /* command character, init = '.'        */
  135.         int prflg;      /* print on or off, init = TRUE         */
  136.         int sprdir;     /* direction for spread(), init = 0     */
  137.         int flevel;     /* nesting depth for source cmd, init = 0 */
  138.         int nr[26];     /* number registers     */
  139. };
  140.  
  141.  
  142. /* output buffer control parameters */
  143.  
  144. struct cout {
  145.         int outp;       /* next avail char position in outbuf, init = 0 */
  146.         int outw;       /* width of text currently in buffer    */
  147.         int outwds;     /* number of words in buffer, init = 0  */
  148.         char outbuf[MAXLINE];   /* output of filled text        */
  149. };
  150.  
  151. /* page control parameters for nro */
  152.  
  153. struct page {
  154.         int curpag;     /* current output page number, init =0  */
  155.         int newpag;     /* next output page number, init = 1    */
  156.         int lineno;     /* next line to be printed, init = 0    */
  157.         int plval;      /* page length in lines, init = 66      */
  158.         int m1val;      /* margin before and including header   */
  159.         int m2val;      /* margin after header                  */
  160.         int m3val;      /* margin after last text line          */
  161.         int m4val;      /* bottom margin, including footer      */
  162.         int bottom;     /* last live line on page
  163.                                         = plval - m3val - m4val */
  164.         int offset;     /* page offset from left, init = 0      */
  165.         int frstpg;     /* first page to print, init = 0        */
  166.         int lastpg;     /* last page to print, init = 30000     */
  167.         int ehlim[2];   /* left/right margins for headers/footers       */
  168.         int ohlim[2];   /* init = 0 and PAGEWIDTH                       */
  169.         int eflim[2];
  170.         int oflim[2];
  171.         char ehead[MAXLINE];    /* top of page title, init = '\n'       */
  172.         char ohead[MAXLINE];
  173.         char efoot[MAXLINE];    /* bottom of page title, init = '\n'    */
  174.         char ofoot[MAXLINE];
  175. };
  176.  
  177. char *getmac();
  178.  
  179. /*
  180.  * NROXTRN.H: external "common" for NRO word processor
  181.  *
  182.  * Stephen L. Browning
  183.  * 5723 North Parker Avenue
  184.  * Indianapolis, Indiana 46220
  185.  *
  186.  * Ported to MS C 5.1 by John Dudeck (jdudeck@polyslo.calpoly.edu) 11/25/90.
  187.  */
  188. #ifndef EXTERN
  189. #define EXTERN extern
  190. #endif
  191.  
  192. EXTERN struct docctl dc;
  193. EXTERN struct page pg;
  194. EXTERN FILE   *oub; /* output file handle? */
  195. EXTERN FILE   *pout; /* output printer handle? */
  196. EXTERN struct cout co;
  197. EXTERN FILE   *sofile[NFILES];  /* input file buffers   */
  198. EXTERN struct macros mac;
  199.