/*******************************************************************************
* YORKTOWN ADVANCED SGML PARSER (YASP)                                         *
*         An SGML Parser conforming to International Standard ISO 8879 --      *
*         Standard Generalized Markup Language                                 *
*------------------------------------------------------------------------------*
* Written 1987 - 1993 by                                                       *
*         Pierre G. Richard                                                    *
*         IBM T.J. Watson Research Center                                      *
*         Yorktown Heights, New York                                           *
*         petrus@watson.ibm.com                                                *
*------------------------------------------------------------------------------*
* FUNCTION NAME    = YASP / Header File                                        *
* STATUS           = Version 0, Release 1, Level 25 and up                     *
* COMPONENT NAME   = sgml.h                                                    *
* DESCRIPTIVE NAME = SGML Control Blocks, Functions                            *
* DATE_WR          = 02/02/1989                                                *
* AUTHOR           = Pierre G. Richard - PETRUS at YKTVMX                      *
*                                                                              *
* FUNCTIONAL DESCRIPTION =                                                     *
* IMPLEMENTATION NOTES =                                                       *
* CHANGE HISTORY =                                                             *
* Number Date     Inits    Change & Reason (brief)                             *
*      1 02/02/89 PETRUS   Grouped here ERRORH, CBDEF and SGMLLIB              *
*******************************************************************************/
#define Ee 26             /* <====================== End of Entity */

typedef enum {
#include "msgcode.h"
}MSGCODE;

#define MSG_MAXSIZ 80       /* Max size of a message */
#define ERH_SEV_MASK 0x00FF /* Severity Mask */
#define ERH_LOCATE   0x1000 /* Locate the message */
#define ERH_NONSGML  0x2000 /* Non SGML just been found */
#define ERH_COMPLT   0x4000 /* A complementary message (not the main msg) */

typedef struct t_DTSG {                  /* DocType signature */
   uchar   base_elt_name[NAMELEN_MAX+1]; /* base element name */
   ELT    *base_elt_p;                   /* base element pointer */
   QNTYTAB qntytab;                      /* Quantity set */
   DSET    dsettab[MAX_CHARSET];         /* Syntax Character Set */
}DTSG;

typedef enum {
   INVALID_CHRF, NAMED_CHRF, NUMERIC_CHRF
}CHRF;

/*-----------------------------------------------------------------------------+
| SGML tools: function prototypes                                              |
+-----------------------------------------------------------------------------*/
extern void     C_FCT errorh    (GA_P, MSGCODE, uint, ...);
extern boolean  P_FCT skip_S    (GA_P);
extern boolean  P_FCT skip_ts   (GA_P);
extern boolean  P_FCT skip_ps   (GA_P);
extern void     P_FCT skip_Wps  (GA_P);
extern boolean  P_FCT skip_ds   (GA_P);
extern boolean  P_FCT skip_dlm  (GA_P, uchar *);
extern void     P_FCT skip_cdc  (GA_P);
extern void     P_FCT msd_psh   (GA_P);
extern boolean  P_FCT msd_pop   (GA_P);
extern void     P_FCT capa_chk  (GA_P, ulong *);
extern void     P_FCT get_nmgp  (
      GA_P, void (P_FCT *)(void STACK_BASED *), void STACK_BASED *
                                );
extern boolean  P_FCT get_ngac  (GA_P);
extern uint     P_FCT get_plit  (GA_P, uchar *, boolean);
extern uint     P_FCT get_zlit  (GA_P, uchar *, boolean);
#define get_lit_min(gbla_p,c_p)    get_zlit(gbla_p,c_p,TRUE)
#define get_lit_cdata(gbla_p,c_p)  get_zlit(gbla_p,c_p,FALSE)
extern void     P_FCT get_PI    (GA_P);
extern uint     P_FCT get_name  (GA_P, uchar *);
extern uint     P_FCT get_gi    (GA_P, uchar *);
extern uint     P_FCT get_enam  (GA_P, uchar *);
extern void     P_FCT get_enmd  (GA_P, uchar *);
extern uint     P_FCT get_nmtk  (GA_P, uchar *);
extern boolean  P_FCT get_gnam  (GA_P, uchar *);
extern void     P_FCT chk_gnam  (GA_P, uchar *);
extern boolean  P_FCT get_gstr  (GA_P, uchar *);
extern CHRF     P_FCT get_chrf  (GA_P);
extern ulong    P_FCT get_num   (GA_P);
extern boolean  P_FCT get_chnb  (GA_P, uint *);
extern void     P_FCT xid_fill  (GA_P, EXID *, uchar);
extern void     P_FCT xid_cchk  (GA_P, EXID *, uchar);
extern void     P_FCT xid_bfpi  (GA_P, EXID *);
extern int      P_FCT choos_in  (GA_P, CHOICES const *, GNWD *);
extern TK       P_FCT dl_find   (GA_P);
extern void     P_FCT set_mode  (GA_P, uint);
extern void     P_FCT psh_mode  (GA_P, uint);
extern void     P_FCT pop_mode  (GA_P);
extern void     P_FCT hid_mode  (GA_P);
extern void     P_FCT rst_mode  (GA_P);
extern void     P_FCT load_ocs  (GA_P, uint);
extern void     P_FCT load_odt  (GA_P, DTSG *);
extern void     P_FCT em_opper  (GA_P);
extern ETY *    P_FCT em_opger  (GA_P);
extern boolean  P_FCT em_find   (GA_P, EXID *);
extern ETY *    P_FCT em_fgety  (GA_P, uchar *);
extern boolean  P_FCT em_open   (GA_P, ETY *);
extern boolean  P_FCT em_close  (GA_P);
extern uint     P_FCT em_read   (GA_P);
extern uint     P_FCT em_unrd   (GA_P, uint);
extern void     P_FCT em_rplac  (GA_P, uchar, uint);
extern ulong    P_FCT em_ofs    (GA_P);
extern ulong    P_FCT em_vofs   (GA_P);
extern void     P_FCT em_locat  (GA_P, int, uchar **, uchar **, int *, int *);
extern POS *    P_FCT em_pos    (GA_P, POS *, int);

#define SGML_INCLUDED
/******************************************************************************/
