home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / nroffgraphics / part01 / termtab.h < prev   
Encoding:
C/C++ Source or Header  |  1988-06-06  |  2.5 KB  |  120 lines

  1. /* termtab.h -- declaration of nroff terminal driver internal representation */
  2.  
  3. /* you'll probably never need to change these */
  4. #define CHARMIN    32            /* minimum ASCII char nroff uses */
  5. #define CHARMAX    256            /* size of ASCII character set */
  6.  
  7. #define C_SIZE    10000    /* The maximum amount of character data allowed
  8.                in the initialized structure t - increase if
  9.                necessary */
  10.  
  11. typedef struct    /* string table internals */
  12. {
  13.     char    c_data[C_SIZE];
  14.     char    *c_pointer[CHARMAX - CHARMIN];
  15.     int        c_length[CHARMAX - CHARMIN];
  16.     char    *c_end;
  17.     int        n_strings, c_size;
  18. }
  19. strtab;
  20.  
  21. typedef struct
  22. {
  23.     char *name;
  24.     int bset;
  25.     int breset;
  26.     int Hor;
  27.     int Vert;
  28.     int Newline;
  29.     int Char;
  30. #ifdef KANJI
  31.     int Kchar;
  32. #endif KANJI
  33.     int Em;
  34.     int Halfline;
  35.     int Adj;
  36.     char *twinit;
  37.     char *twrest;
  38.     char *twnl;
  39.     char *hlr;
  40.     char *hlf;
  41.     char *flr;
  42.     char *bdon;
  43.     char *bdoff;
  44.     char *iton;
  45.     char *itoff;
  46.     char *ploton;
  47.     char *plotoff;
  48.     char *up;
  49.     char *down;
  50.     char *right;
  51.     char *left;
  52.     char *codetab[CHARMAX - CHARMIN];
  53.     char *zzz;
  54.  
  55.     strtab    pool;
  56. }
  57. nrtab_t;
  58.  
  59. /*
  60.  * The format of an old-style tab file is:
  61.  *
  62.  * Type    Name        Size on most machines    Description
  63.  * ----    ----        ---------------------    -----------
  64.  * int    c_size        4 bytes    - The amount of character data in bytes
  65.  *                that follows the t_stor structure.
  66.  *
  67.  * nrext_t oldform    1000 bytes - This is the storage for the "t"
  68.  *            structure with one change. All the elements
  69.  *            of the t structure which were pointers to
  70.  *            strings are now integer indexes to one
  71.  *            large character array.
  72.  *
  73.  * char    array[c_size]    (variable size)- This is the storage for the strings
  74.  *            pointed to by the indexes.
  75.  *
  76.  * The total size of the tabfile in bytes should be:
  77.  *    c_size + sizeof (c_size) + sizeof (t_stor)
  78.  */
  79.  
  80. typedef struct        /* This structure will be stored in the tab file */
  81. {
  82.     int bset;
  83.     int breset;
  84.     int Hor;
  85.     int Vert;
  86.     int Newline;
  87.     int Char;
  88.     int Em;
  89.     int Halfline;
  90.     int Adj;
  91.     int twinit;
  92.     int twrest;
  93.     int twnl;
  94.     int hlr;
  95.     int hlf;
  96.     int flr;
  97.     int bdon;
  98.     int bdoff;
  99.     int iton;
  100.     int itoff;
  101.     int ploton;
  102.     int plotoff;
  103.     int up;
  104.     int down;
  105.     int right;
  106.     int left;
  107.     int codetab[CHARMAX - CHARMIN];
  108.     int zzz;
  109. }
  110. nrext_t;
  111.  
  112. extern char *ntnames[];
  113. extern void newstrings();
  114. extern char *addstring();
  115. extern int char_comp(), findstring();
  116. extern nrtab_t *ditread(), *otread();
  117. extern void ditwrite(), otwrite();
  118.  
  119. /* termtab.h ends here */
  120.