blob: a1aeea26062c917bfda27e165d2cee0ac122fbb4 [file] [log] [blame]
Daniel Veillardeae522a2001-04-23 13:41:34 +00001/*
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 Veillardb59076b2001-04-29 17:04:07 +000011#include <libxml/parser.h>
Daniel Veillardeae522a2001-04-23 13:41:34 +000012
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/*
18 * Most of the back-end structures from XML and SGML are shared
19 */
20typedef xmlParserCtxt docbParserCtxt;
21typedef xmlParserCtxtPtr docbParserCtxtPtr;
22typedef xmlParserNodeInfo docbParserNodeInfo;
23typedef xmlSAXHandler docbSAXHandler;
24typedef xmlSAXHandlerPtr docbSAXHandlerPtr;
25typedef xmlParserInput docbParserInput;
26typedef xmlParserInputPtr docbParserInputPtr;
27typedef xmlDocPtr docbDocPtr;
28typedef xmlNodePtr docbNodePtr;
29
30/*
31 * There is only few public functions.
32 */
33int docbEncodeEntities(unsigned char* out,
34 int *outlen,
35 const unsigned char* in,
36 int *inlen, int quoteChar);
37
38docbDocPtr docbSAXParseDoc (xmlChar *cur,
39 const char *encoding,
40 docbSAXHandlerPtr sax,
41 void *userData);
42docbDocPtr docbParseDoc (xmlChar *cur,
43 const char *encoding);
44docbDocPtr docbSAXParseFile(const char *filename,
45 const char *encoding,
46 docbSAXHandlerPtr sax,
47 void *userData);
48docbDocPtr docbParseFile (const char *filename,
49 const char *encoding);
50
51/**
52 * Interfaces for the Push mode
53 */
54void docbFreeParserCtxt (docbParserCtxtPtr ctxt);
55docbParserCtxtPtr docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
56 void *user_data,
57 const char *chunk,
58 int size,
59 const char *filename,
60 xmlCharEncoding enc);
61int docbParseChunk (docbParserCtxtPtr ctxt,
62 const char *chunk,
63 int size,
64 int terminate);
65docbParserCtxtPtr docbCreateFileParserCtxt(const char *filename,
66 const char *encoding);
67int docbParseDocument (docbParserCtxtPtr ctxt);
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* __DOCB_PARSER_H__ */