Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * parser.h : constants and stuff related to the XML parser. |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * $Id$ |
| 7 | */ |
| 8 | |
| 9 | #ifndef __XML_PARSER_H__ |
| 10 | #define __XML_PARSER_H__ |
| 11 | |
| 12 | #include "xml_tree.h" |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /* |
| 19 | * Constants. |
| 20 | */ |
| 21 | #define XML_DEFAULT_VERSION "1.0" |
| 22 | |
| 23 | |
| 24 | typedef struct xmlParserCtxt { |
| 25 | const char *filename; /* The file analyzed, if any */ |
| 26 | const CHAR *base; /* Base of the array to parse */ |
| 27 | const CHAR *cur; /* Current char being parsed */ |
| 28 | int line; /* Current line */ |
| 29 | int col; /* Current column */ |
| 30 | xmlDocPtr doc; /* the document being built */ |
| 31 | int depth; /* Depth of current element */ |
| 32 | int max_depth; /* Max depth allocated */ |
| 33 | xmlNodePtr *nodes; /* The node hierarchy being built */ |
| 34 | } xmlParserCtxt, *xmlParserCtxtPtr; |
| 35 | |
| 36 | /* |
| 37 | * Interfaces |
| 38 | */ |
| 39 | extern int xmlParseDocument(xmlParserCtxtPtr ctxt); |
| 40 | extern xmlDocPtr xmlParseDoc(CHAR *cur); |
| 41 | extern xmlDocPtr xmlParseMemory(char *buffer, int size); |
| 42 | extern xmlDocPtr xmlParseFile(const char *filename); |
| 43 | extern CHAR *xmlStrdup(const CHAR *input); |
| 44 | extern CHAR *xmlStrndup(const CHAR *input, int n); |
| 45 | extern CHAR *xmlStrchr(const CHAR *str, CHAR val); |
| 46 | extern int xmlStrcmp(const CHAR *str1, const CHAR *str2); |
| 47 | extern int xmlStrncmp(const CHAR *str1, const CHAR *str2, int len); |
| 48 | |
| 49 | extern void xmlInitParserCtxt(xmlParserCtxtPtr ctx); |
| 50 | extern void xmlClearParserCtxt(xmlParserCtxtPtr ctx); |
| 51 | extern void xmlSetupParserForBuffer(xmlParserCtxtPtr ctx, const CHAR* buffer, |
| 52 | const char* filename); |
| 53 | |
| 54 | extern void xmlReportError(xmlParserCtxtPtr ctx, const CHAR* msg); |
| 55 | |
| 56 | #ifdef __cplusplus |
| 57 | } |
| 58 | #endif |
| 59 | |
| 60 | #endif /* __XML_PARSER_H__ */ |
| 61 | |