diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/Makefile.in | 2 | ||||
| -rw-r--r-- | include/libxml/HTMLparser.h | 4 | ||||
| -rw-r--r-- | include/libxml/Makefile.am | 3 | ||||
| -rw-r--r-- | include/libxml/Makefile.in | 5 | ||||
| -rw-r--r-- | include/libxml/SAX2.h | 2 | ||||
| -rw-r--r-- | include/libxml/parser.h | 55 | ||||
| -rw-r--r-- | include/libxml/pattern.h | 4 | ||||
| -rw-r--r-- | include/libxml/relaxng.h | 7 | ||||
| -rw-r--r-- | include/libxml/schematron.h | 124 | ||||
| -rw-r--r-- | include/libxml/threads.h | 1 | ||||
| -rw-r--r-- | include/libxml/tree.h | 54 | ||||
| -rw-r--r-- | include/libxml/uri.h | 9 | ||||
| -rw-r--r-- | include/libxml/valid.h | 4 | ||||
| -rw-r--r-- | include/libxml/xmlIO.h | 16 | ||||
| -rw-r--r-- | include/libxml/xmlautomata.h | 8 | ||||
| -rw-r--r-- | include/libxml/xmlerror.h | 23 | ||||
| -rw-r--r-- | include/libxml/xmlexports.h | 21 | ||||
| -rw-r--r-- | include/libxml/xmlregexp.h | 108 | ||||
| -rw-r--r-- | include/libxml/xmlsave.h | 3 | ||||
| -rw-r--r-- | include/libxml/xmlschemas.h | 7 | ||||
| -rw-r--r-- | include/libxml/xmlversion.h | 33 | ||||
| -rw-r--r-- | include/libxml/xmlversion.h.in | 23 | ||||
| -rw-r--r-- | include/libxml/xpath.h | 19 |
23 files changed, 466 insertions, 69 deletions
diff --git a/include/Makefile.in b/include/Makefile.in index 6c67be8..2ba891f 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -161,6 +161,7 @@ TEST_PUSH = @TEST_PUSH@ TEST_REGEXPS = @TEST_REGEXPS@ TEST_SAX = @TEST_SAX@ TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_SCHEMATRON = @TEST_SCHEMATRON@ TEST_THREADS = @TEST_THREADS@ TEST_VALID = @TEST_VALID@ TEST_VTIME = @TEST_VTIME@ @@ -196,6 +197,7 @@ WITH_REGEXPS = @WITH_REGEXPS@ WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ WITH_SAX1 = @WITH_SAX1@ WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_SCHEMATRON = @WITH_SCHEMATRON@ WITH_THREADS = @WITH_THREADS@ WITH_TREE = @WITH_TREE@ WITH_TRIO = @WITH_TRIO@ diff --git a/include/libxml/HTMLparser.h b/include/libxml/HTMLparser.h index 2604d86..8477efb 100644 --- a/include/libxml/HTMLparser.h +++ b/include/libxml/HTMLparser.h @@ -173,11 +173,13 @@ XMLPUBFUN void XMLCALL * to the xmlReadDoc() and similar calls. */ typedef enum { + HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */ HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */ HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */ HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ - HTML_PARSE_NONET = 1<<11 /* Forbid network access */ + HTML_PARSE_NONET = 1<<11,/* Forbid network access */ + HTML_PARSE_COMPACT = 1<<16 /* compact small text nodes */ } htmlParserOption; XMLPUBFUN void XMLCALL diff --git a/include/libxml/Makefile.am b/include/libxml/Makefile.am index 03f9564..bf03a3b 100644 --- a/include/libxml/Makefile.am +++ b/include/libxml/Makefile.am @@ -48,7 +48,8 @@ xmlinc_HEADERS = \ xmlwriter.h \ chvalid.h \ pattern.h \ - xmlsave.h + xmlsave.h \ + schematron.h install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(xmlincdir) diff --git a/include/libxml/Makefile.in b/include/libxml/Makefile.in index bdcc706..f52f5b0 100644 --- a/include/libxml/Makefile.in +++ b/include/libxml/Makefile.in @@ -165,6 +165,7 @@ TEST_PUSH = @TEST_PUSH@ TEST_REGEXPS = @TEST_REGEXPS@ TEST_SAX = @TEST_SAX@ TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_SCHEMATRON = @TEST_SCHEMATRON@ TEST_THREADS = @TEST_THREADS@ TEST_VALID = @TEST_VALID@ TEST_VTIME = @TEST_VTIME@ @@ -200,6 +201,7 @@ WITH_REGEXPS = @WITH_REGEXPS@ WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ WITH_SAX1 = @WITH_SAX1@ WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_SCHEMATRON = @WITH_SCHEMATRON@ WITH_THREADS = @WITH_THREADS@ WITH_TREE = @WITH_TREE@ WITH_TRIO = @WITH_TRIO@ @@ -316,7 +318,8 @@ xmlinc_HEADERS = \ xmlwriter.h \ chvalid.h \ pattern.h \ - xmlsave.h + xmlsave.h \ + schematron.h EXTRA_DIST = xmlversion.h.in all: all-am diff --git a/include/libxml/SAX2.h b/include/libxml/SAX2.h index 6626564..8d2db02 100644 --- a/include/libxml/SAX2.h +++ b/include/libxml/SAX2.h @@ -98,7 +98,7 @@ XMLPUBFUN void XMLCALL xmlSAX2StartDocument (void *ctx); XMLPUBFUN void XMLCALL xmlSAX2EndDocument (void *ctx); -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) +#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) XMLPUBFUN void XMLCALL xmlSAX2StartElement (void *ctx, const xmlChar *fullname, diff --git a/include/libxml/parser.h b/include/libxml/parser.h index 7203ca3..2fe91d4 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -591,7 +591,7 @@ typedef void (*cdataBlockSAXFunc) ( * * Display and format a warning messages, callback. */ -typedef void (*warningSAXFunc) (void *ctx, +typedef void (XMLCDECL *warningSAXFunc) (void *ctx, const char *msg, ...); /** * errorSAXFunc: @@ -601,7 +601,7 @@ typedef void (*warningSAXFunc) (void *ctx, * * Display and format an error messages, callback. */ -typedef void (*errorSAXFunc) (void *ctx, +typedef void (XMLCDECL *errorSAXFunc) (void *ctx, const char *msg, ...); /** * fatalErrorSAXFunc: @@ -613,7 +613,7 @@ typedef void (*errorSAXFunc) (void *ctx, * Note: so far fatalError() SAX callbacks are not used, error() * get all the callbacks for errors. */ -typedef void (*fatalErrorSAXFunc) (void *ctx, +typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx, const char *msg, ...); /** * isStandaloneSAXFunc: @@ -1088,7 +1088,8 @@ typedef enum { XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ - XML_PARSE_NOXINCNODE= 1<<15 /* do not generate XINCLUDE START/END nodes */ + XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ + XML_PARSE_COMPACT = 1<<16 /* compact small text nodes */ } xmlParserOption; XMLPUBFUN void XMLCALL @@ -1162,6 +1163,52 @@ XMLPUBFUN xmlDocPtr XMLCALL const char *encoding, int options); +/* + * Library wide options + */ +/** + * xmlFeature: + * + * Used to examine the existance of features that can be enabled + * or disabled at compile-time. + */ +typedef enum { + XML_FEATURE_THREAD = 1, + XML_FEATURE_TREE = 2, + XML_FEATURE_OUTPUT = 3, + XML_FEATURE_PUSH = 4, + XML_FEATURE_READER = 5, + XML_FEATURE_PATTERN = 6, + XML_FEATURE_WRITER = 7, + XML_FEATURE_SAX1 = 8, + XML_FEATURE_FTP = 9, + XML_FEATURE_HTTP = 10, + XML_FEATURE_VALID = 11, + XML_FEATURE_HTML = 12, + XML_FEATURE_LEGACY = 13, + XML_FEATURE_C14N = 14, + XML_FEATURE_CATALOG = 15, + XML_FEATURE_XPATH = 16, + XML_FEATURE_XPTR = 17, + XML_FEATURE_XINCLUDE = 18, + XML_FEATURE_ICONV = 19, + XML_FEATURE_ISO8859X = 20, + XML_FEATURE_UNICODE = 21, + XML_FEATURE_REGEXP = 22, + XML_FEATURE_AUTOMATA = 23, + XML_FEATURE_EXPR = 24, + XML_FEATURE_SCHEMAS = 25, + XML_FEATURE_SCHEMATRON = 26, + XML_FEATURE_MODULES = 27, + XML_FEATURE_DEBUG = 28, + XML_FEATURE_DEBUG_MEM = 29, + XML_FEATURE_DEBUG_RUN = 30, + XML_FEATURE_NONE = 99999 /* just to be sure of allocation size */ +} xmlFeature; + +XMLPUBFUN int XMLCALL + xmlHasFeature (xmlFeature feature); + #ifdef __cplusplus } #endif diff --git a/include/libxml/pattern.h b/include/libxml/pattern.h index e3ee76d..1aa6704 100644 --- a/include/libxml/pattern.h +++ b/include/libxml/pattern.h @@ -52,7 +52,7 @@ XMLPUBFUN void XMLCALL XMLPUBFUN xmlPatternPtr XMLCALL xmlPatterncompile (const xmlChar *pattern, xmlDict *dict, - xmlPatternFlags flags, + int flags, const xmlChar **namespaces); XMLPUBFUN int XMLCALL xmlPatternMatch (xmlPatternPtr comp, @@ -67,6 +67,8 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlPatternMaxDepth (xmlPatternPtr comp); XMLPUBFUN int XMLCALL + xmlPatternMinDepth (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL xmlPatternFromRoot (xmlPatternPtr comp); XMLPUBFUN xmlStreamCtxtPtr XMLCALL xmlPatternGetStreamCtxt (xmlPatternPtr comp); diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h index ca3c13b..c75aba2 100644 --- a/include/libxml/relaxng.h +++ b/include/libxml/relaxng.h @@ -27,8 +27,8 @@ typedef xmlRelaxNG *xmlRelaxNGPtr; /** * A schemas validation context */ -typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...); -typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...); +typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...); +typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...); typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt; typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr; @@ -152,6 +152,9 @@ XMLPUBFUN int XMLCALL xmlRelaxNGValidityErrorFunc *err, xmlRelaxNGValidityWarningFunc *warn, void **ctx); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, void *ctx); XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); XMLPUBFUN void XMLCALL diff --git a/include/libxml/schematron.h b/include/libxml/schematron.h new file mode 100644 index 0000000..6eaa699 --- /dev/null +++ b/include/libxml/schematron.h @@ -0,0 +1,124 @@ +/* + * Summary: XML Schemastron implementation + * Description: interface to the XML Schematron validity checking. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMATRON_H__ +#define __XML_SCHEMATRON_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_SCHEMATRON_ENABLED + +#include <libxml/tree.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */ + XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */ + XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */ + XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */ + XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */ + XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */ +} xmlSchematronValidOptions; + +/** + * The schemas related types are kept internal + */ +typedef struct _xmlSchematron xmlSchematron; +typedef xmlSchematron *xmlSchematronPtr; + +/** + * A schemas validation context + */ +typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...); +typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...); + +typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt; +typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr; + +typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt; +typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr; + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewParserCtxt (const char *URL); +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewMemParserCtxt(const char *buffer, + int size); +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewDocParserCtxt(xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt); +/***** +XMLPUBFUN void XMLCALL + xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt, + xmlSchematronValidityErrorFunc err, + xmlSchematronValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt, + xmlSchematronValidityErrorFunc * err, + xmlSchematronValidityWarningFunc * warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt); + *****/ +XMLPUBFUN xmlSchematronPtr XMLCALL + xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchematronFree (xmlSchematronPtr schema); +/* + * Interfaces for validating + */ +/****** +XMLPUBFUN void XMLCALL + xmlSchematronSetValidStructuredErrors( + xmlSchematronValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN void XMLCALL + xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt, + xmlSchematronValidityErrorFunc err, + xmlSchematronValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt, + xmlSchematronValidityErrorFunc *err, + xmlSchematronValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt, + xmlNodePtr elem); + *******/ + +XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL + xmlSchematronNewValidCtxt (xmlSchematronPtr schema, + int options); +XMLPUBFUN void XMLCALL + xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt, + xmlDocPtr instance); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMATRON_ENABLED */ +#endif /* __XML_SCHEMATRON_H__ */ diff --git a/include/libxml/threads.h b/include/libxml/threads.h index fb6b704..4f7d10f 100644 --- a/include/libxml/threads.h +++ b/include/libxml/threads.h @@ -36,7 +36,6 @@ typedef xmlRMutex *xmlRMutexPtr; #ifdef __cplusplus extern "C" { #endif - XMLPUBFUN xmlMutexPtr XMLCALL xmlNewMutex (void); XMLPUBFUN void XMLCALL diff --git a/include/libxml/tree.h b/include/libxml/tree.h index d995e5c..bd62d0a 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -55,6 +55,33 @@ typedef xmlEntity *xmlEntityPtr; #define BASE_BUFFER_SIZE 4096 /** + * xmlBufferAllocationScheme: + * + * A buffer allocation scheme can be defined to either match exactly the + * need or double it's allocated size each time it is found too small. + */ + +typedef enum { + XML_BUFFER_ALLOC_DOUBLEIT, + XML_BUFFER_ALLOC_EXACT, + XML_BUFFER_ALLOC_IMMUTABLE +} xmlBufferAllocationScheme; + +/** + * xmlBuffer: + * + * A buffer structure. + */ +typedef struct _xmlBuffer xmlBuffer; +typedef xmlBuffer *xmlBufferPtr; +struct _xmlBuffer { + xmlChar *content; /* The buffer content UTF8 */ + unsigned int use; /* The buffer size used */ + unsigned int size; /* The buffer size */ + xmlBufferAllocationScheme alloc; /* The realloc method */ +}; + +/** * XML_XML_NAMESPACE: * * This is the namespace for the special xml: prefix predefined in the @@ -402,33 +429,6 @@ struct _xmlRef { }; /** - * xmlBufferAllocationScheme: - * - * A buffer allocation scheme can be defined to either match exactly the - * need or double it's allocated size each time it is found too small. - */ - -typedef enum { - XML_BUFFER_ALLOC_DOUBLEIT, - XML_BUFFER_ALLOC_EXACT, - XML_BUFFER_ALLOC_IMMUTABLE -} xmlBufferAllocationScheme; - -/** - * xmlBuffer: - * - * A buffer structure. - */ -typedef struct _xmlBuffer xmlBuffer; -typedef xmlBuffer *xmlBufferPtr; -struct _xmlBuffer { - xmlChar *content; /* The buffer content UTF8 */ - unsigned int use; /* The buffer size used */ - unsigned int size; /* The buffer size */ - xmlBufferAllocationScheme alloc; /* The realloc method */ -}; - -/** * xmlNode: * * A node in an XML tree. diff --git a/include/libxml/uri.h b/include/libxml/uri.h index 90ed06e..89e3653 100644 --- a/include/libxml/uri.h +++ b/include/libxml/uri.h @@ -47,13 +47,16 @@ struct _xmlURI { XMLPUBFUN xmlURIPtr XMLCALL xmlCreateURI (void); XMLPUBFUN xmlChar * XMLCALL - xmlBuildURI (const xmlChar *URI, - const xmlChar *base); + xmlBuildURI (const xmlChar *URI, + const xmlChar *base); XMLPUBFUN xmlChar * XMLCALL xmlBuildRelativeURI (const xmlChar *URI, - const xmlChar *base); + const xmlChar *base); XMLPUBFUN xmlURIPtr XMLCALL xmlParseURI (const char *str); +XMLPUBFUN xmlURIPtr XMLCALL + xmlParseURIRaw (const char *str, + int raw); XMLPUBFUN int XMLCALL xmlParseURIReference (xmlURIPtr uri, const char *str); diff --git a/include/libxml/valid.h b/include/libxml/valid.h index 86e3fce..d13e4eb 100644 --- a/include/libxml/valid.h +++ b/include/libxml/valid.h @@ -39,7 +39,7 @@ typedef xmlValidState *xmlValidStatePtr; * Callback called when a validity error is found. This is a message * oriented function similar to an *printf function. */ -typedef void (*xmlValidityErrorFunc) (void *ctx, +typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx, const char *msg, ...); @@ -54,7 +54,7 @@ typedef void (*xmlValidityErrorFunc) (void *ctx, * Callback called when a validity warning is found. This is a message * oriented function similar to an *printf function. */ -typedef void (*xmlValidityWarningFunc) (void *ctx, +typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx, const char *msg, ...); diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h index 0f7b8a8..e67b6e5 100644 --- a/include/libxml/xmlIO.h +++ b/include/libxml/xmlIO.h @@ -31,7 +31,7 @@ extern "C" { * * Returns 1 if yes and 0 if another Input module should be used */ -typedef int (*xmlInputMatchCallback) (char const *filename); +typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename); /** * xmlInputOpenCallback: * @filename: the filename or URI @@ -40,7 +40,7 @@ typedef int (*xmlInputMatchCallback) (char const *filename); * * Returns an Input context or NULL in case or error */ -typedef void * (*xmlInputOpenCallback) (char const *filename); +typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename); /** * xmlInputReadCallback: * @context: an Input context @@ -51,7 +51,7 @@ typedef void * (*xmlInputOpenCallback) (char const *filename); * * Returns the number of bytes read or -1 in case of error */ -typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len); +typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len); /** * xmlInputCloseCallback: * @context: an Input context @@ -60,7 +60,7 @@ typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len); * * Returns 0 or -1 in case of error */ -typedef int (*xmlInputCloseCallback) (void * context); +typedef int (XMLCALL *xmlInputCloseCallback) (void * context); #ifdef LIBXML_OUTPUT_ENABLED /* @@ -77,7 +77,7 @@ typedef int (*xmlInputCloseCallback) (void * context); * * Returns 1 if yes and 0 if another Output module should be used */ -typedef int (*xmlOutputMatchCallback) (char const *filename); +typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename); /** * xmlOutputOpenCallback: * @filename: the filename or URI @@ -86,7 +86,7 @@ typedef int (*xmlOutputMatchCallback) (char const *filename); * * Returns an Output context or NULL in case or error */ -typedef void * (*xmlOutputOpenCallback) (char const *filename); +typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename); /** * xmlOutputWriteCallback: * @context: an Output context @@ -97,7 +97,7 @@ typedef void * (*xmlOutputOpenCallback) (char const *filename); * * Returns the number of bytes written or -1 in case of error */ -typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer, +typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer, int len); /** * xmlOutputCloseCallback: @@ -107,7 +107,7 @@ typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer, * * Returns 0 or -1 in case of error */ -typedef int (*xmlOutputCloseCallback) (void * context); +typedef int (XMLCALL *xmlOutputCloseCallback) (void * context); #endif /* LIBXML_OUTPUT_ENABLED */ #ifdef __cplusplus diff --git a/include/libxml/xmlautomata.h b/include/libxml/xmlautomata.h index d29ddcf..f98b55e 100644 --- a/include/libxml/xmlautomata.h +++ b/include/libxml/xmlautomata.h @@ -65,6 +65,14 @@ XMLPUBFUN xmlAutomataStatePtr XMLCALL const xmlChar *token, const xmlChar *token2, void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewNegTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + void *data); + XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h index 04da1a6..cc35ca8 100644 --- a/include/libxml/xmlerror.h +++ b/include/libxml/xmlerror.h @@ -60,7 +60,8 @@ typedef enum { XML_FROM_VALID, /* The XML DTD validation with valid context */ XML_FROM_CHECK, /* The error checking module */ XML_FROM_WRITER, /* The xmlwriter module */ - XML_FROM_MODULE /* The dynamically loaded module module*/ + XML_FROM_MODULE, /* The dynamically loaded module module*/ + XML_FROM_I18N /* The module handling character conversion */ } xmlErrorDomain; /** @@ -760,6 +761,7 @@ typedef enum { XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */ XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */ XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */ + XML_SCHEMAP_SRC_REDEFINE, /* 3081 */ XML_MODULE_OPEN = 4900, /* 4900 */ XML_MODULE_CLOSE, /* 4901 */ XML_CHECK_FOUND_ELEMENT = 5000, @@ -799,7 +801,12 @@ typedef enum { XML_CHECK_NOT_NCNAME, /* 5034 */ XML_CHECK_OUTSIDE_DICT, /* 5035 */ XML_CHECK_WRONG_NAME, /* 5036 */ - XML_CHECK_NAME_NOT_NULL /* 5037 */ + XML_CHECK_NAME_NOT_NULL, /* 5037 */ + XML_I18N_NO_NAME = 6000, + XML_I18N_NO_HANDLER, /* 6001 */ + XML_I18N_EXCESS_HANDLER, /* 6002 */ + XML_I18N_CONV_FAILED, /* 6003 */ + XML_I18N_NO_OUTPUT /* 6004 */ #if 0 XML_CHECK_, /* 5033 */ XML_CHECK_X /* 503 */ @@ -815,7 +822,7 @@ typedef enum { * Signature of the function to use when there is an error and * no parsing or validity context available . */ -typedef void (*xmlGenericErrorFunc) (void *ctx, +typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx, const char *msg, ...); /** @@ -826,7 +833,7 @@ typedef void (*xmlGenericErrorFunc) (void *ctx, * Signature of the function to use when there is an error and * the module handles the new error reporting mechanism. */ -typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); +typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); /* * Use the following function to reset the two global variables @@ -845,19 +852,19 @@ XMLPUBFUN void XMLCALL * Default message routines used by SAX and Valid context for error * and warning reporting. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCDECL xmlParserError (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCDECL xmlParserWarning (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCDECL xmlParserValidityError (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCDECL xmlParserValidityWarning (void *ctx, const char *msg, ...); diff --git a/include/libxml/xmlexports.h b/include/libxml/xmlexports.h index ee03cad..29a6f54 100644 --- a/include/libxml/xmlexports.h +++ b/include/libxml/xmlexports.h @@ -40,6 +40,13 @@ * Macros which declare the called convention for exported functions */ #define XMLCALL +/** + * XMLCDECL: + * + * Macro which declares the calling convention for exported functions that + * use '...'. + */ +#define XMLCDECL /** DOC_DISABLE */ @@ -48,6 +55,7 @@ #undef XMLPUBFUN #undef XMLPUBVAR #undef XMLCALL + #undef XMLCDECL #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) #define XMLPUBFUN __declspec(dllexport) #define XMLPUBVAR __declspec(dllexport) @@ -59,7 +67,12 @@ #define XMLPUBVAR extern #endif #endif - #define XMLCALL __cdecl + #if defined(LIBXML_FASTCALL) + #define XMLCALL __fastcall + #else + #define XMLCALL __cdecl + #endif + #define XMLCDECL __cdecl #if !defined _REENTRANT #define _REENTRANT #endif @@ -70,6 +83,7 @@ #undef XMLPUBFUN #undef XMLPUBVAR #undef XMLCALL + #undef XMLCDECL #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) #define XMLPUBFUN __declspec(dllexport) #define XMLPUBVAR __declspec(dllexport) extern @@ -82,6 +96,7 @@ #endif #endif #define XMLCALL __cdecl + #define XMLCDECL __cdecl #if !defined _REENTRANT #define _REENTRANT #endif @@ -92,6 +107,7 @@ #undef XMLPUBFUN #undef XMLPUBVAR #undef XMLCALL + #undef XMLCDECL #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) #define XMLPUBFUN __declspec(dllexport) #define XMLPUBVAR __declspec(dllexport) @@ -104,6 +120,7 @@ #endif #endif #define XMLCALL __cdecl + #define XMLCDECL __cdecl #if !defined _REENTRANT #define _REENTRANT #endif @@ -114,6 +131,7 @@ #undef XMLPUBFUN #undef XMLPUBVAR #undef XMLCALL + #undef XMLCDECL #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) #define XMLPUBFUN __declspec(dllexport) #define XMLPUBVAR __declspec(dllexport) @@ -126,6 +144,7 @@ #endif #endif #define XMLCALL __cdecl + #define XMLCDECL __cdecl #endif /* Compatibility */ diff --git a/include/libxml/xmlregexp.h b/include/libxml/xmlregexp.h index a7b3b29..a257bb4 100644 --- a/include/libxml/xmlregexp.h +++ b/include/libxml/xmlregexp.h @@ -40,6 +40,7 @@ typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; } #endif #include <libxml/tree.h> +#include <libxml/dict.h> #ifdef __cplusplus extern "C" { #endif @@ -99,6 +100,113 @@ XMLPUBFUN int XMLCALL int *nbneg, xmlChar **values, int *terminal); +#ifdef LIBXML_EXPR_ENABLED +/* + * Formal regular expression handling + * Its goal is to do some formal work on content models + */ + +/* expressions are used within a context */ +typedef struct _xmlExpCtxt xmlExpCtxt; +typedef xmlExpCtxt *xmlExpCtxtPtr; + +XMLPUBFUN void XMLCALL + xmlExpFreeCtxt (xmlExpCtxtPtr ctxt); +XMLPUBFUN xmlExpCtxtPtr XMLCALL + xmlExpNewCtxt (int maxNodes, + xmlDictPtr dict); + +XMLPUBFUN int XMLCALL + xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt); + +/* Expressions are trees but the tree is opaque */ +typedef struct _xmlExpNode xmlExpNode; +typedef xmlExpNode *xmlExpNodePtr; + +typedef enum { + XML_EXP_EMPTY = 0, + XML_EXP_FORBID = 1, + XML_EXP_ATOM = 2, + XML_EXP_SEQ = 3, + XML_EXP_OR = 4, + XML_EXP_COUNT = 5 +} xmlExpNodeType; + +/* + * 2 core expressions shared by all for the empty language set + * and for the set with just the empty token + */ +XMLPUBVAR xmlExpNodePtr forbiddenExp; +XMLPUBVAR xmlExpNodePtr emptyExp; + +/* + * Expressions are reference counted internally + */ +XMLPUBFUN void XMLCALL + xmlExpFree (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr); +XMLPUBFUN void XMLCALL + xmlExpRef (xmlExpNodePtr expr); + +/* + * constructors can be either manual or from a string + */ +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpParse (xmlExpCtxtPtr ctxt, + const char *expr); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewAtom (xmlExpCtxtPtr ctxt, + const xmlChar *name, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewOr (xmlExpCtxtPtr ctxt, + xmlExpNodePtr left, + xmlExpNodePtr right); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewSeq (xmlExpCtxtPtr ctxt, + xmlExpNodePtr left, + xmlExpNodePtr right); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewRange (xmlExpCtxtPtr ctxt, + xmlExpNodePtr subset, + int min, + int max); +/* + * The really interesting APIs + */ +XMLPUBFUN int XMLCALL + xmlExpIsNillable(xmlExpNodePtr expr); +XMLPUBFUN int XMLCALL + xmlExpMaxToken (xmlExpNodePtr expr); +XMLPUBFUN int XMLCALL + xmlExpGetLanguage(xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar**list, + int len); +XMLPUBFUN int XMLCALL + xmlExpGetStart (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar**list, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpStringDerive(xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar *str, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpExpDerive (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + xmlExpNodePtr sub); +XMLPUBFUN int XMLCALL + xmlExpSubsume (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + xmlExpNodePtr sub); +XMLPUBFUN void XMLCALL + xmlExpDump (xmlBufferPtr buf, + xmlExpNodePtr expr); +#endif /* LIBXML_EXPR_ENABLED */ #ifdef __cplusplus } #endif diff --git a/include/libxml/xmlsave.h b/include/libxml/xmlsave.h index 534fefd..7b8f42c 100644 --- a/include/libxml/xmlsave.h +++ b/include/libxml/xmlsave.h @@ -27,7 +27,8 @@ extern "C" { * to the xmlSaveToFd() and similar calls. */ typedef enum { - XML_SAVE_FORMAT = 1<<0 /* format save output */ + XML_SAVE_FORMAT = 1<<0, /* format save output */ + XML_SAVE_NO_DECL = 1<<1 /* drop the xml declaration */ } xmlSaveOption; diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h index 6cecffd..ab47091 100644 --- a/include/libxml/xmlschemas.h +++ b/include/libxml/xmlschemas.h @@ -87,8 +87,8 @@ typedef xmlSchema *xmlSchemaPtr; /** * A schemas validation context */ -typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...); -typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...); +typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...); +typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...); typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt; typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr; @@ -138,6 +138,9 @@ XMLPUBFUN void XMLCALL xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, void *ctx); +XMLPUBFUN void XMLCALL + xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, void *ctx); XMLPUBFUN int XMLCALL xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt, xmlSchemaValidityErrorFunc *err, diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h index d6d6149..46cb36d 100644 --- a/include/libxml/xmlversion.h +++ b/include/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.6.20" +#define LIBXML_DOTTED_VERSION "2.6.21" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 1002003 */ -#define LIBXML_VERSION 20620 +#define LIBXML_VERSION 20621 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "1002003" */ -#define LIBXML_VERSION_STRING "20620" +#define LIBXML_VERSION_STRING "20621" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "-CVS2521" +#define LIBXML_VERSION_EXTRA "-CVS2619" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20620); +#define LIBXML_TEST_VERSION xmlCheckVersion(20621); #ifndef VMS #if 0 @@ -331,6 +331,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif /** + * LIBXML_EXPR_ENABLED: + * + * Whether the formal expressions interfaces are compiled in + */ +#if 1 +#define LIBXML_EXPR_ENABLED +#endif + +/** * LIBXML_SCHEMAS_ENABLED: * * Whether the Schemas validation interfaces are compiled in @@ -340,12 +349,26 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif /** + * LIBXML_SCHEMATRON_ENABLED: + * + * Whether the Schematron validation interfaces are compiled in + */ +#if 1 +#define LIBXML_SCHEMATRON_ENABLED +#endif + +/** * LIBXML_MODULES_ENABLED: * * Whether the module interfaces are compiled in */ #if 1 #define LIBXML_MODULES_ENABLED +/** + * LIBXML_MODULE_EXTENSION: + * + * the string suffix used by dynamic modules (usually shared libraries) + */ #define LIBXML_MODULE_EXTENSION ".so" #endif diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index 47a28b9..a628741 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -331,6 +331,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif /** + * LIBXML_EXPR_ENABLED: + * + * Whether the formal expressions interfaces are compiled in + */ +#if @WITH_SCHEMAS@ +#define LIBXML_EXPR_ENABLED +#endif + +/** * LIBXML_SCHEMAS_ENABLED: * * Whether the Schemas validation interfaces are compiled in @@ -340,12 +349,26 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif /** + * LIBXML_SCHEMATRON_ENABLED: + * + * Whether the Schematron validation interfaces are compiled in + */ +#if @WITH_SCHEMATRON@ +#define LIBXML_SCHEMATRON_ENABLED +#endif + +/** * LIBXML_MODULES_ENABLED: * * Whether the module interfaces are compiled in */ #if @WITH_MODULES@ #define LIBXML_MODULES_ENABLED +/** + * LIBXML_MODULE_EXTENSION: + * + * the string suffix used by dynamic modules (usually shared libraries) + */ #define LIBXML_MODULE_EXTENSION "@MODULE_EXTENSION@" #endif diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h index eee2630..76473a6 100644 --- a/include/libxml/xpath.h +++ b/include/libxml/xpath.h @@ -249,6 +249,23 @@ typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, const xmlChar *ns_uri); /** + * xmlXPathFlags: + * Flags for XPath engine compilation and runtime + */ +/** + * XML_XPATH_CHECKNS: + * + * check namespaces at compilation + */ +#define XML_XPATH_CHECKNS (1<<0) +/** + * XML_XPATH_NOVAR: + * + * forbid variables in expression + */ +#define XML_XPATH_NOVAR (1<<1) + +/** * xmlXPathContext: * * Expression evaluation occurs with respect to a context. @@ -324,6 +341,8 @@ struct _xmlXPathContext { /* dictionnary */ xmlDictPtr dict; /* dictionnary if any */ + + int flags; /* flags to control compilation */ }; /* |
