Daniel Veillard | 6eadf63 | 2003-01-23 18:29:16 +0000 | [diff] [blame^] | 1 | /* |
| 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 | |
| 14 | typedef struct _xmlRelaxNG xmlRelaxNG; |
| 15 | typedef xmlRelaxNG *xmlRelaxNGPtr; |
| 16 | |
| 17 | |
| 18 | /** |
| 19 | * A schemas validation context |
| 20 | */ |
| 21 | typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...); |
| 22 | typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...); |
| 23 | |
| 24 | typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt; |
| 25 | typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr; |
| 26 | |
| 27 | typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt; |
| 28 | typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr; |
| 29 | |
| 30 | /* |
| 31 | * Interfaces for parsing. |
| 32 | */ |
| 33 | xmlRelaxNGParserCtxtPtr xmlRelaxNGNewParserCtxt (const char *URL); |
| 34 | xmlRelaxNGParserCtxtPtr xmlRelaxNGNewMemParserCtxt(const char *buffer, |
| 35 | int size); |
| 36 | void xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt); |
| 37 | void xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, |
| 38 | xmlRelaxNGValidityErrorFunc err, |
| 39 | xmlRelaxNGValidityWarningFunc warn, |
| 40 | void *ctx); |
| 41 | xmlRelaxNGPtr xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); |
| 42 | void xmlRelaxNGFree (xmlRelaxNGPtr schema); |
| 43 | void xmlRelaxNGDump (FILE *output, |
| 44 | xmlRelaxNGPtr schema); |
| 45 | /* |
| 46 | * Interfaces for validating |
| 47 | */ |
| 48 | void xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, |
| 49 | xmlRelaxNGValidityErrorFunc err, |
| 50 | xmlRelaxNGValidityWarningFunc warn, |
| 51 | void *ctx); |
| 52 | xmlRelaxNGValidCtxtPtr xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); |
| 53 | void xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt); |
| 54 | int xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt, |
| 55 | xmlDocPtr instance); |
| 56 | int xmlRelaxNGValidateStream(xmlRelaxNGValidCtxtPtr ctxt, |
| 57 | xmlParserInputBufferPtr input, |
| 58 | xmlCharEncoding enc, |
| 59 | xmlSAXHandlerPtr sax, |
| 60 | void *user_data); |
| 61 | void xmlRelaxNGCleanupTypes (void); |
| 62 | #endif /* __XML_RELAX_NG__ */ |