blob: a20c95a292bc2325d6270b2159b670d0e9d503cc [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001/*
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
15extern "C" {
16#endif
17
18/*
19 * Constants.
20 */
21#define XML_DEFAULT_VERSION "1.0"
22
23
24typedef 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 */
39extern int xmlParseDocument(xmlParserCtxtPtr ctxt);
40extern xmlDocPtr xmlParseDoc(CHAR *cur);
41extern xmlDocPtr xmlParseMemory(char *buffer, int size);
42extern xmlDocPtr xmlParseFile(const char *filename);
43extern CHAR *xmlStrdup(const CHAR *input);
44extern CHAR *xmlStrndup(const CHAR *input, int n);
45extern CHAR *xmlStrchr(const CHAR *str, CHAR val);
46extern int xmlStrcmp(const CHAR *str1, const CHAR *str2);
47extern int xmlStrncmp(const CHAR *str1, const CHAR *str2, int len);
48
49extern void xmlInitParserCtxt(xmlParserCtxtPtr ctx);
50extern void xmlClearParserCtxt(xmlParserCtxtPtr ctx);
51extern void xmlSetupParserForBuffer(xmlParserCtxtPtr ctx, const CHAR* buffer,
52 const char* filename);
53
54extern void xmlReportError(xmlParserCtxtPtr ctx, const CHAR* msg);
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif /* __XML_PARSER_H__ */
61