int mg_load( char *filename )
void mg_clear( void )
extern MG_FCTXT *mg_file
extern char *mg_err[MG_NERRS]
The global mg_file variable points to the current file context structure, which may be useful for the interpretation of certain entities, such as ies, which must know the directory path of the enclosing file. This structure is of the defined type MG_FCTXT, given in "parser.h" as:
typedef struct mg_fctxt { char fname[96]; /* file name */ FILE *fp; /* stream pointer */ int fid; /* unique file context id */ char inpline[4096]; /* input line */ int lineno; /* line number */ struct mg_fctxt *prev; /* previous context */ } MG_FCTXT; /* file context */
#define MG_OK 0 /* normal return value */ #define MG_EUNK 1 /* unknown entity */ #define MG_EARGC 2 /* wrong number of arguments */ #define MG_ETYPE 3 /* argument type error */ #define MG_EILL 4 /* illegal argument value */ #define MG_EUNDEF 5 /* undefined reference */ #define MG_ENOFILE 6 /* cannot open input file */ #define MG_EINCL 7 /* error in included file */ #define MG_EMEM 8 /* out of memory */ #define MG_ESEEK 9 /* file seek error */ #define MG_EBADMAT 10 /* bad material specification */ #define MG_ELINE 11 /* input line too long */ #define MG_ECNTXT 12 /* unmatched context close */ #define MG_NERRS 13If it is inappropriate to send output to standard error, the calling program should use the routines listed under mg_open for better control over the parsing process.
The mg_err array contains error messages corresponding to each of the values listed above in the native country's language.