blob: 1264d34a0cd98d94d7c929f5dded764da937df31 [file] [log] [blame]
Daniel Veillard6eadf632003-01-23 18:29:16 +00001/*
2 * relaxng.h: header for the implementation of the Relax-NG validation
3 *
4 * See Copyright for the status of this software.
5 *
6 * daniel@veillard.com
7 */
8
9#ifndef __XML_RELAX_NG__
10#define __XML_RELAX_NG__
11
12#include <libxml/hash.h>
13
14typedef struct _xmlRelaxNG xmlRelaxNG;
15typedef xmlRelaxNG *xmlRelaxNGPtr;
16
17
18/**
19 * A schemas validation context
20 */
21typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...);
22typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...);
23
24typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
25typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
26
27typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
28typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
29
30/*
31 * Interfaces for parsing.
32 */
33xmlRelaxNGParserCtxtPtr xmlRelaxNGNewParserCtxt (const char *URL);
34xmlRelaxNGParserCtxtPtr xmlRelaxNGNewMemParserCtxt(const char *buffer,
35 int size);
36void xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
37void xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
38 xmlRelaxNGValidityErrorFunc err,
39 xmlRelaxNGValidityWarningFunc warn,
40 void *ctx);
41xmlRelaxNGPtr xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
42void xmlRelaxNGFree (xmlRelaxNGPtr schema);
43void xmlRelaxNGDump (FILE *output,
44 xmlRelaxNGPtr schema);
45/*
46 * Interfaces for validating
47 */
48void xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
49 xmlRelaxNGValidityErrorFunc err,
50 xmlRelaxNGValidityWarningFunc warn,
51 void *ctx);
52xmlRelaxNGValidCtxtPtr xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
53void xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
54int xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
55 xmlDocPtr instance);
56int xmlRelaxNGValidateStream(xmlRelaxNGValidCtxtPtr ctxt,
57 xmlParserInputBufferPtr input,
58 xmlCharEncoding enc,
59 xmlSAXHandlerPtr sax,
60 void *user_data);
61void xmlRelaxNGCleanupTypes (void);
62#endif /* __XML_RELAX_NG__ */