home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / linuxdoc-sgml-1.1 / sgmls-1.1 / entity.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  9.1 KB  |  190 lines

  1. /* Struct dcncb: attribute list added to support data attributes.             */
  2. #ifndef ENTITY_H              /* Don't include this file more than once. */
  3. #define ENTITY_H
  4. /* ENTITY.H: Definitions and control block templates for entity management.
  5. */
  6. #include "tools.h"            /* Definitions for type declarations, etc. */
  7. #include "msgcat.h"
  8.  
  9. #define STDINNAME "-"          /* File name that refers to standard input. */
  10.  
  11. #define EOS         '\0'      /* NONCHAR: EE (entity end: strings). */
  12.  
  13. #define AVALCASE      2       /* 2=untranslated string of name characters. */
  14.  
  15. #define REFNAMELEN 8          /* reference quantity set NAMELEN */
  16. #define REFLITLEN 240         /* reference quantity set LITLEN */
  17.  
  18. /* Minimization status of returned tags.
  19. */
  20. #define MINNONE 0             /* Minimization: tag not minimized. */
  21. #define MINNULL 1             /* Minimization: tag was null. */
  22. #define MINNET  2             /* Minimization: end-tag was NET delimiter. */
  23. #define MINDATA 3             /* Minimization: end-tag was data tag. */
  24. #define MINSTAG 4             /* Minimization: tag implied by start-tag. */
  25. #define MINETAG 5             /* Minimization: end-tag implied by end-tag. */
  26.  
  27. /* Formal public identifier public text classes.
  28. */
  29. #define FPICAP         1
  30. #define FPICHARS       2
  31. #define FPINOT         3
  32. #define FPISYN         4
  33. #define FPICMINV       5      /* Minimum fpic value for versionable text. */
  34. #define FPIDOC         5
  35. #define FPIDTD         6
  36. #define FPIELEM        7
  37. #define FPIENT         8
  38. #define FPILPD         9
  39. #define FPINON        10
  40. #define FPISHORT      11
  41. #define FPISUB        12
  42. #define FPITEXT       13
  43. struct fpi {                  /* Formal public identifier. */
  44.      UNCH fpiot;              /* Owner type: + or - or ! (for ISO). */
  45.      UNS fpiol;              /* Length of owner identifier. */
  46.      UNS fpio;                /* Offset in pubis of owner identifier (no EOS).*/
  47.      int fpic;                /* Public text class. */
  48.      UNCH fpitt;              /* Text type: - or + (for available). */
  49.      UNS fpitl;              /* Length of text identifier. */
  50.      UNS fpit;                /* Offset in pubis of text identifier (no EOS). */
  51.      UNS fpill;              /* Language/designating sequence length. */
  52.      UNS fpil;                /* Offset in pubis of language. */
  53.      UNS fpivl;              /* Length of display version . */
  54.      UNS fpiv;                /* Offset in pubis of display version (no EOS). */
  55.      int fpiversw;          /* 1=use best ver; 0=use stated ver; -1=error. */
  56.      UNCH *fpinm;          /* Entity/DCN name (EOS, no length). */
  57.      UNCH fpistore;           /* 1=NDATA 2=general 3=parm 4=DTD 5=LPD 6=DCN. */
  58.      /* Name of the entity's DCN.  Valid only when fpistore == 1.
  59.     NULL if it's a SUBDOC. */
  60.      UNCH *fpinedcn;
  61.      UNCH *fpipubis; /* Public ID string (EOS). */
  62.      UNCH *fpisysis; /* System ID string (EOS). */
  63. };
  64. #define FPISZ sizeof(struct fpi)
  65. typedef struct fpi *PFPI;     /* Ptr to FPI control block. */
  66.  
  67. /* General control blocks.
  68. */
  69. #define NONONCH 1             /* Character references to non-chars invalid. */
  70. #define OKNONCH 0             /* Character references to non-chars allowed. */
  71. struct parse {                /* Parse control block. */
  72.      char   *pname;           /* Parse name; content, tag, etc. */
  73.      UNCH   *plex;            /* Lexical analysis table. */
  74.      UNCH   **ptab;           /* State and action table. */
  75.      UNS    state;            /* State. */
  76.      UNS    input;            /* Input. */
  77.      UNS    action;           /* Action. */
  78.      UNS    newstate;         /* Next state. */
  79. };
  80. struct restate {
  81.      UNS   sstate;            /* State. */
  82.      UNS   sinput;            /* Input. */
  83.      UNS   saction;           /* Action. */
  84.      UNS   snext;             /* Next state. */
  85. };
  86. struct map {
  87.      UNCH   *mapnm;           /* Name followed by EOS. */
  88.      int    mapdata;          /* Data associated with that name. */
  89. };
  90. struct hash {                 /* Dummy structure for function arguments. */
  91.      struct hash *enext;      /* Next entry in chain. */
  92.      UNCH *ename;          /* Entry name with size and EOS. */
  93. };
  94. typedef struct hash *PHASH;   /* Ptr to hash table entry. */
  95. typedef struct hash **THASH;  /* Ptr to hash table. */
  96.  
  97. struct fwdref {               /* A forward id reference. */
  98.      struct fwdref *next;     /* Pt to next reference in chain. */
  99.      UNIV msg;              /* Ptr to saved error messsage. */
  100. };
  101. #define FWDREFSZ sizeof(struct fwdref)
  102.  
  103. struct dcncb {                /* Data content notation control block. */
  104.      struct dcncb *enext;     /* Next DCN in chain. */
  105.      UNCH *ename;          /* Notation name followed by EOS. */
  106.      UNCH mark;              /* For use by application. */
  107.      UNCH entsw;          /* Entity defined with this notation? */
  108.      UNCH defined;            /* Has this notation been defined. */
  109.      UNCH *sysid;             /* System identifier of notation. */
  110.      UNCH *pubid;             /* Public identifier of notation. */
  111.      struct ad *adl;          /* Data attribute list (NULL if none). */
  112. };
  113. #define DCBSZ sizeof(struct dcncb)
  114. #define DCNMARK(p) ((p)->mark ? 1 : ((p)->mark = 1, 0))
  115.  
  116. typedef struct dcncb *PDCB;   /* Ptr to DCN control block. */
  117.  
  118. /* Number of capacities in a capacity set. */
  119.  
  120. #define NCAPACITY 17
  121.  
  122. struct sgmlcap {
  123.      char **name;
  124.      UNCH *points;
  125.      long *number;
  126.      long *limit;
  127. };
  128.  
  129. struct sgmlstat {             /* Document statistics. */
  130.      UNS dcncnt;              /* Number of data content notations defined. */
  131.      UNS pmexgcnt;            /* Number of plus or minus exception groups. */
  132.      UNS etdcnt;              /* Number of element types declared. */
  133.      UNS etdercnt;            /* Number of element types defined by default. */
  134.      UNS pmexcnt;             /* Number of plus/minus exception grp members. */
  135.      UNS modcnt;              /* Number of content model tokens defined. */
  136.      UNS attcnt;              /* Number of attributes defined. */
  137.      UNS attdef;              /* Characters of attribute defaults defined. */
  138.      UNS attgcnt;             /* Number of att value grp members (incl dcn). */
  139.      UNS idcnt;               /* Number of ID attributes specified. */
  140.      UNS idrcnt;              /* Number of ID references specified. */
  141.      UNS ecbcnt;              /* Number of entities declared. */
  142.      UNS ecbtext;             /* Characters of entity text defined. */
  143.      UNS srcnt;               /* Number of short reference tables defined. */
  144.      UNS dcntext;             /* Characters of notation identifiers defined. */
  145. };
  146. struct switches {             /* Parser control switches (1=non-standard). */
  147.      int swdupent;            /* 1=msg if duplicate ENTITY def attempted;0=no.*/
  148.      int swcommnt;            /* 1=return comment declarations as data; 0=no. */
  149.      int swrefmsg;            /* 1=msg if undeclared ref is defaulted; 0=no. */
  150.      UNS swbufsz;             /* Size of source file buffer for READ(). */
  151.      int swenttr;             /* 1=trace entity stack in error messages; 0=no.*/
  152.      int sweltr;          /* 1=trace element stack in error messages; 0=no. */
  153.      int swambig;          /* 1=check content model ambiguity */
  154.      int swundef;          /* 1=warn about undefined elements and notations. */
  155.      char *prog;              /* Program name for error messages. */
  156. #ifdef TRACE
  157.      char *trace;          /* What to trace in the body. */
  158.      char *ptrace;          /* What to trace in the prolog. */
  159. #endif /* TRACE */
  160.      nl_catd catd;          /* Message catalog descriptor. */
  161.      long nopen;          /* Number of open document entities */
  162.      int onlypro;          /* Parse only the prolog. */
  163.      char **includes;          /* List of parameter entities to be defined
  164.                      as "INCLUDE"; NULL terminated.*/
  165.      VOID (*die) P((void));   /* Function to call on fatal error. */
  166. };
  167. struct markup {               /* Delimiter strings for text processor. */
  168.      UNCH *cro;               /* LEXCON markup string: CRO        */
  169.      UNCH *dso;               /* LEXCON markup string: DSO        */
  170.      UNCH *ero;               /* LEXCON markup string: ERO        */
  171.      UNCH *etag;              /* LEXMARK markup string: end-tag   */
  172.      UNCH *lit;               /* LEXMARK markup string: LIT       */
  173.      UNCH *lita;              /* LEXMARK markup string: LITA      */
  174.      UNCH *mdc;               /* LEXCON markup string: MDC       */
  175.      UNCH *mdo;               /* LEXCON markup string: MDO       */
  176.      UNCH *mse;               /* LEXCON markup string: mse        */
  177.      UNCH *mss;               /* LEXCON markup string: mss        */
  178.      UNCH *mssc;              /* LEXCON markup string: mss CDATA  */
  179.      UNCH *mssr;              /* LEXCON markup string: mss RCDATA */
  180.      UNCH *pic;               /* LEXCON markup string: PIC        */
  181.      UNCH *pio;               /* LEXCON markup string: PIO        */
  182.      UNCH *refc;              /* LEXGRP markup string: REFC       */
  183.      UNCH *stag;              /* LEXMARK markup string: start-tag */
  184.      UNCH *tagc;              /* LEXMARK markup string: TAGC      */
  185.      UNCH *vi;                /* LEXMARK markup string: VI        */
  186.      int lennet;              /* LEXMARK markup string length: null end-tag. */
  187.      int lennst;              /* LEXMARK markup string length: null start-tag.*/
  188. };
  189. #endif /* ndef ENTITY_H */
  190.