Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | * SGMLparser.h : interface for a DocBook SGML non-verifying parser |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * Daniel.Veillard@w3.org |
| 7 | */ |
| 8 | |
| 9 | #ifndef __DOCB_PARSER_H__ |
| 10 | #define __DOCB_PARSER_H__ |
Daniel Veillard | b59076b | 2001-04-29 17:04:07 +0000 | [diff] [blame] | 11 | #include <libxml/parser.h> |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | /* |
| 18 | * Most of the back-end structures from XML and SGML are shared |
| 19 | */ |
| 20 | typedef xmlParserCtxt docbParserCtxt; |
| 21 | typedef xmlParserCtxtPtr docbParserCtxtPtr; |
| 22 | typedef xmlParserNodeInfo docbParserNodeInfo; |
| 23 | typedef xmlSAXHandler docbSAXHandler; |
| 24 | typedef xmlSAXHandlerPtr docbSAXHandlerPtr; |
| 25 | typedef xmlParserInput docbParserInput; |
| 26 | typedef xmlParserInputPtr docbParserInputPtr; |
| 27 | typedef xmlDocPtr docbDocPtr; |
| 28 | typedef xmlNodePtr docbNodePtr; |
| 29 | |
| 30 | /* |
| 31 | * There is only few public functions. |
| 32 | */ |
| 33 | int docbEncodeEntities(unsigned char* out, |
| 34 | int *outlen, |
| 35 | const unsigned char* in, |
| 36 | int *inlen, int quoteChar); |
| 37 | |
| 38 | docbDocPtr docbSAXParseDoc (xmlChar *cur, |
| 39 | const char *encoding, |
| 40 | docbSAXHandlerPtr sax, |
| 41 | void *userData); |
| 42 | docbDocPtr docbParseDoc (xmlChar *cur, |
| 43 | const char *encoding); |
| 44 | docbDocPtr docbSAXParseFile(const char *filename, |
| 45 | const char *encoding, |
| 46 | docbSAXHandlerPtr sax, |
| 47 | void *userData); |
| 48 | docbDocPtr docbParseFile (const char *filename, |
| 49 | const char *encoding); |
| 50 | |
| 51 | /** |
| 52 | * Interfaces for the Push mode |
| 53 | */ |
| 54 | void docbFreeParserCtxt (docbParserCtxtPtr ctxt); |
| 55 | docbParserCtxtPtr docbCreatePushParserCtxt(docbSAXHandlerPtr sax, |
| 56 | void *user_data, |
| 57 | const char *chunk, |
| 58 | int size, |
| 59 | const char *filename, |
| 60 | xmlCharEncoding enc); |
| 61 | int docbParseChunk (docbParserCtxtPtr ctxt, |
| 62 | const char *chunk, |
| 63 | int size, |
| 64 | int terminate); |
| 65 | docbParserCtxtPtr docbCreateFileParserCtxt(const char *filename, |
| 66 | const char *encoding); |
| 67 | int docbParseDocument (docbParserCtxtPtr ctxt); |
| 68 | |
| 69 | #ifdef __cplusplus |
| 70 | } |
| 71 | #endif |
| 72 | |
| 73 | #endif /* __DOCB_PARSER_H__ */ |