diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 01e5fe90..6759f01a 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -527,15 +527,11 @@ Interfaces, constants and types related to the XML parser Daniel Veillard - - - - - - - - + + + + @@ -595,6 +591,10 @@ + + + + @@ -632,6 +632,7 @@ + @@ -640,6 +641,7 @@ + @@ -3799,14 +3801,6 @@ Macro to extract the line number of an element node. - - - - - - - - A namespace declaration node. @@ -4077,14 +4071,6 @@ If the wildcard is complete. - - - - - - - - Both general and parameter entities need to be substituted. @@ -4699,6 +4685,10 @@ and not by parsing an instance'/> + + + + @@ -5455,6 +5445,10 @@ crash if you try to modify the tree)'/> + + + + @@ -6091,6 +6085,7 @@ crash if you try to modify the tree)'/> + @@ -6112,6 +6107,7 @@ crash if you try to modify the tree)'/> + @@ -8504,7 +8500,7 @@ crash if you try to modify the tree)'/> Get well-formedness and validation status after parsing. Also reports catastrophic errors which are not related to parsing like out-of-memory, I/O or other errors. Available since 2.14.0. - + @@ -10589,7 +10585,7 @@ crash if you try to modify the tree)'/> - + DEPRECATED: Use xmlNewInputFromUrl. Create a new input stream based on a file or an URL. @@ -10604,7 +10600,7 @@ crash if you try to modify the tree)'/> - + Creates a new parser input to read from a memory area. @url is used as base to resolve external entities and for error reporting. If the XML_INPUT_BUF_STATIC flag is set, the memory area must stay unchanged until parsing has finished. This can avoid temporary copies. If the XML_INPUT_BUF_ZERO_TERMINATED flag is set, the memory area must contain a zero byte after the buffer at position @size. This can avoid temporary copies. Available since 2.14.0. @@ -10612,20 +10608,20 @@ crash if you try to modify the tree)'/> - + Creates a new parser input to read from a zero-terminated string. @url is used as base to resolve external entities and for error reporting. If the XML_INPUT_BUF_STATIC flag is set, the string must stay unchanged until parsing has finished. This can avoid temporary copies. Available since 2.14.0. - + Create a new input stream based on a file or a URL. The flag XML_INPUT_UNZIP allows decompression. The flag XML_INPUT_NETWORK allows network access. The following resource loaders will be called if they were registered (in order of precedence): - the per-thread xmlParserInputBufferCreateFilenameFunc set with xmlParserInputBufferCreateFilenameDefault (deprecated) - the default loader which will return - the result from a matching global input callback set with xmlRegisterInputCallbacks (deprecated) - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in. Available since 2.14.0. - + @@ -12284,7 +12280,7 @@ crash if you try to modify the tree)'/> - + diff --git a/fuzz/fuzz.c b/fuzz/fuzz.c index 9c413686..816f5d3b 100644 --- a/fuzz/fuzz.c +++ b/fuzz/fuzz.c @@ -461,7 +461,8 @@ int xmlFuzzResourceLoader(void *data ATTRIBUTE_UNUSED, const char *URL, const char *ID ATTRIBUTE_UNUSED, xmlResourceType type ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, xmlParserInputPtr *out) { + xmlParserInputFlags flags ATTRIBUTE_UNUSED, + xmlParserInputPtr *out) { xmlParserInputPtr input; xmlFuzzEntityInfo *entity; diff --git a/fuzz/fuzz.h b/fuzz/fuzz.h index d036744e..adf52092 100644 --- a/fuzz/fuzz.h +++ b/fuzz/fuzz.h @@ -137,7 +137,8 @@ xmlFuzzSecondaryEntity(size_t *size); int xmlFuzzResourceLoader(void *data, const char *URL, const char *ID, - xmlResourceType type, int flags, xmlParserInputPtr *out); + xmlResourceType type, xmlParserInputFlags flags, + xmlParserInputPtr *out); char * xmlSlurpFile(const char *path, size_t *size); diff --git a/fuzz/genSeed.c b/fuzz/genSeed.c index 222bff89..fa2d3a73 100644 --- a/fuzz/genSeed.c +++ b/fuzz/genSeed.c @@ -57,7 +57,8 @@ static struct { static int fuzzResourceRecorder(void *data ATTRIBUTE_UNUSED, const char *URL, const char *ID ATTRIBUTE_UNUSED, - xmlResourceType type ATTRIBUTE_UNUSED, int flags, + xmlResourceType type ATTRIBUTE_UNUSED, + xmlParserInputFlags flags, xmlParserInputPtr *out) { xmlParserInputPtr in; static const int chunkSize = 16384; diff --git a/include/libxml/parser.h b/include/libxml/parser.h index 2d2a9917..1518ac8f 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -40,10 +40,12 @@ extern "C" { */ #define XML_DEFAULT_VERSION "1.0" -#define XML_STATUS_NOT_WELL_FORMED (1 << 0) -#define XML_STATUS_NOT_NS_WELL_FORMED (1 << 1) -#define XML_STATUS_DTD_VALIDATION_FAILED (1 << 2) -#define XML_STATUS_CATASTROPHIC_ERROR (1 << 3) +typedef enum { + XML_STATUS_NOT_WELL_FORMED = (1 << 0), + XML_STATUS_NOT_NS_WELL_FORMED = (1 << 1), + XML_STATUS_DTD_VALIDATION_FAILED = (1 << 2), + XML_STATUS_CATASTROPHIC_ERROR = (1 << 3) +} xmlParserStatus; typedef enum { XML_RESOURCE_UNKNOWN = 0, @@ -55,6 +57,13 @@ typedef enum { XML_RESOURCE_XINCLUDE_TEXT } xmlResourceType; +typedef enum { + XML_INPUT_BUF_STATIC = (1 << 1), + XML_INPUT_BUF_ZERO_TERMINATED = (1 << 2), + XML_INPUT_UNZIP = (1 << 3), + XML_INPUT_NETWORK = (1 << 4) +} xmlParserInputFlags; + /** * xmlParserInput: * @@ -213,7 +222,8 @@ typedef struct _xmlAttrHashBucket xmlAttrHashBucket; */ typedef int (*xmlResourceLoader)(void *ctxt, const char *url, const char *publicId, - xmlResourceType type, int flags, xmlParserInputPtr *out); + xmlResourceType type, xmlParserInputFlags flags, + xmlParserInputPtr *out); /** * xmlParserCtxt: @@ -1456,7 +1466,7 @@ XMLPUBFUN const xmlChar * xmlCtxtGetDeclaredEncoding(xmlParserCtxtPtr ctxt); XMLPUBFUN int xmlCtxtGetStandalone (xmlParserCtxtPtr ctxt); -XMLPUBFUN int +XMLPUBFUN xmlParserStatus xmlCtxtGetStatus (xmlParserCtxtPtr ctxt); XMLPUBFUN void xmlCtxtSetErrorHandler (xmlParserCtxtPtr ctxt, @@ -1545,23 +1555,21 @@ XMLPUBFUN xmlDocPtr * New input API */ -#define XML_INPUT_BUF_STATIC (1 << 1) -#define XML_INPUT_BUF_ZERO_TERMINATED (1 << 2) -#define XML_INPUT_UNZIP (1 << 3) -#define XML_INPUT_NETWORK (1 << 4) - XMLPUBFUN int -xmlNewInputFromUrl(const char *url, int flags, xmlParserInputPtr *out); +xmlNewInputFromUrl(const char *url, xmlParserInputFlags flags, + xmlParserInputPtr *out); XMLPUBFUN xmlParserInputPtr xmlNewInputFromMemory(const char *url, const void *mem, size_t size, - int flags); + xmlParserInputFlags flags); XMLPUBFUN xmlParserInputPtr -xmlNewInputFromString(const char *url, const char *str, int flags); +xmlNewInputFromString(const char *url, const char *str, + xmlParserInputFlags flags); XMLPUBFUN xmlParserInputPtr -xmlNewInputFromFd(const char *url, int fd, int flags); +xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags); XMLPUBFUN xmlParserInputPtr xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead, - xmlInputCloseCallback ioClose, void *ioCtxt, int flags); + xmlInputCloseCallback ioClose, void *ioCtxt, + xmlParserInputFlags flags); XMLPUBFUN int xmlInputSetEncodingHandler(xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler); diff --git a/include/private/io.h b/include/private/io.h index da2004fd..be44809b 100644 --- a/include/private/io.h +++ b/include/private/io.h @@ -23,16 +23,17 @@ xmlNoNetExists(const char *filename); XML_HIDDEN int xmlParserInputBufferCreateUrl(const char *URI, xmlCharEncoding enc, - int flags, xmlParserInputBufferPtr *out); + xmlParserInputFlags flags, + xmlParserInputBufferPtr *out); XML_HIDDEN xmlParserInputBufferPtr -xmlNewInputBufferString(const char *str, int flags); +xmlNewInputBufferString(const char *str, xmlParserInputFlags flags); XML_HIDDEN xmlParserInputBufferPtr -xmlNewInputBufferMemory(const void *mem, size_t size, int flags, - xmlCharEncoding enc); +xmlNewInputBufferMemory(const void *mem, size_t size, + xmlParserInputFlags flags, xmlCharEncoding enc); XML_HIDDEN int -xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, int unzip); +xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, xmlParserInputFlags flags); #ifdef LIBXML_OUTPUT_ENABLED XML_HIDDEN void diff --git a/include/private/parser.h b/include/private/parser.h index bae9f55b..d5f2fef9 100644 --- a/include/private/parser.h +++ b/include/private/parser.h @@ -21,6 +21,9 @@ */ #define XML_VCTXT_USE_PCTXT (1u << 1) +/* + * TODO: Rename to avoid confusion with xmlParserInputFlags + */ #define XML_INPUT_HAS_ENCODING (1u << 0) #define XML_INPUT_AUTO_ENCODING (7u << 1) #define XML_INPUT_AUTO_UTF8 (1u << 1) @@ -116,23 +119,26 @@ xmlLoadResource(xmlParserCtxtPtr ctxt, const char *url, const char *publicId, xmlResourceType type); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromUrl(xmlParserCtxtPtr ctxt, const char *url, - const char *publicId, const char *encoding, int flags); + const char *publicId, const char *encoding, + xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url, const void *mem, size_t size, - const char *encoding, int flags); + const char *encoding, + xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromString(xmlParserCtxtPtr ctxt, const char *url, - const char *str, const char *encoding, int flags); + const char *str, const char *encoding, + xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromFd(xmlParserCtxtPtr ctxt, const char *filename, int fd, - const char *encoding, int flags); + const char *encoding, xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromIO(xmlParserCtxtPtr ctxt, const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, void *ioCtxt, - const char *encoding, int flags); + const char *encoding, xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlNewPushInput(const char *url, const char *chunk, int size); diff --git a/parserInternals.c b/parserInternals.c index 01783530..34417cb0 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -443,9 +443,9 @@ xmlCtxtErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain, * * Returns a bitmask of XML_STATUS_* flags ORed together. */ -int +xmlParserStatus xmlCtxtGetStatus(xmlParserCtxt *ctxt) { - int bits = 0; + xmlParserStatus bits = 0; if (xmlCtxtIsCatastrophicError(ctxt)) { bits |= XML_STATUS_CATASTROPHIC_ERROR | @@ -1798,7 +1798,7 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) { xmlParserInputPtr xmlCtxtNewInputFromUrl(xmlParserCtxtPtr ctxt, const char *url, const char *publicId, const char *encoding, - int flags ATTRIBUTE_UNUSED) { + xmlParserInputFlags flags ATTRIBUTE_UNUSED) { xmlParserInputPtr input; if ((ctxt == NULL) || (url == NULL)) @@ -1876,7 +1876,7 @@ xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) { */ xmlParserInputPtr xmlNewInputFromMemory(const char *url, const void *mem, size_t size, - int flags) { + xmlParserInputFlags flags) { xmlParserInputBufferPtr buf; if (mem == NULL) @@ -1903,7 +1903,7 @@ xmlNewInputFromMemory(const char *url, const void *mem, size_t size, xmlParserInputPtr xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url, const void *mem, size_t size, - const char *encoding, int flags) { + const char *encoding, xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (mem == NULL)) @@ -1941,7 +1941,8 @@ xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url, * Returns a new parser input or NULL if a memory allocation failed. */ xmlParserInputPtr -xmlNewInputFromString(const char *url, const char *str, int flags) { +xmlNewInputFromString(const char *url, const char *str, + xmlParserInputFlags flags) { xmlParserInputBufferPtr buf; if (str == NULL) @@ -1966,7 +1967,8 @@ xmlNewInputFromString(const char *url, const char *str, int flags) { */ xmlParserInputPtr xmlCtxtNewInputFromString(xmlParserCtxtPtr ctxt, const char *url, - const char *str, const char *encoding, int flags) { + const char *str, const char *encoding, + xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (str == NULL)) @@ -2006,7 +2008,7 @@ xmlCtxtNewInputFromString(xmlParserCtxtPtr ctxt, const char *url, * Returns a new parser input or NULL if a memory allocation failed. */ xmlParserInputPtr -xmlNewInputFromFd(const char *url, int fd, int flags) { +xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags) { xmlParserInputBufferPtr buf; if (fd < 0) @@ -2036,7 +2038,8 @@ xmlNewInputFromFd(const char *url, int fd, int flags) { */ xmlParserInputPtr xmlCtxtNewInputFromFd(xmlParserCtxtPtr ctxt, const char *url, - int fd, const char *encoding, int flags) { + int fd, const char *encoding, + xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (fd < 0)) @@ -2086,7 +2089,7 @@ xmlCtxtNewInputFromFd(xmlParserCtxtPtr ctxt, const char *url, xmlParserInputPtr xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, void *ioCtxt, - int flags ATTRIBUTE_UNUSED) { + xmlParserInputFlags flags ATTRIBUTE_UNUSED) { xmlParserInputBufferPtr buf; if (ioRead == NULL) @@ -2122,7 +2125,8 @@ xmlParserInputPtr xmlCtxtNewInputFromIO(xmlParserCtxtPtr ctxt, const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, - void *ioCtxt, const char *encoding, int flags) { + void *ioCtxt, const char *encoding, + xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (ioRead == NULL)) @@ -2475,7 +2479,8 @@ xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret) { * Returns an xmlParserErrors code. */ int -xmlNewInputFromUrl(const char *filename, int flags, xmlParserInputPtr *out) { +xmlNewInputFromUrl(const char *filename, xmlParserInputFlags flags, + xmlParserInputPtr *out) { xmlParserInputBufferPtr buf; xmlParserInputPtr input; int code = XML_ERR_OK; @@ -2528,7 +2533,7 @@ xmlNewInputFromUrl(const char *filename, int flags, xmlParserInputPtr *out) { xmlParserInputPtr xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) { xmlParserInputPtr input; - int flags = 0; + xmlParserInputFlags flags = 0; int code; if ((ctxt == NULL) || (filename == NULL)) @@ -2697,7 +2702,7 @@ xmlLoadResource(xmlParserCtxtPtr ctxt, const char *url, const char *publicId, if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) { char *resource = NULL; - int flags = 0; + xmlParserInputFlags flags = 0; int code; #ifdef LIBXML_CATALOG_ENABLED diff --git a/runsuite.c b/runsuite.c index 126e1818..37315891 100644 --- a/runsuite.c +++ b/runsuite.c @@ -245,7 +245,8 @@ static int testResourceLoader(void *vctxt ATTRIBUTE_UNUSED, const char *URL, const char *ID ATTRIBUTE_UNUSED, xmlResourceType type ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, xmlParserInputPtr *out) { + xmlParserInputFlags flags ATTRIBUTE_UNUSED, + xmlParserInputPtr *out) { int i; for (i = 0; i < nb_entities; i++) { diff --git a/testapi.c b/testapi.c index 5270f5b9..f14b8f58 100644 --- a/testapi.c +++ b/testapi.c @@ -1107,6 +1107,21 @@ static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNU static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { } +#define gen_nb_xmlParserInputFlags 4 +static xmlParserInputFlags gen_xmlParserInputFlags(int no, int nr ATTRIBUTE_UNUSED) { + if (no == 1) return(XML_INPUT_BUF_STATIC); + if (no == 2) return(XML_INPUT_BUF_ZERO_TERMINATED); + if (no == 3) return(XML_INPUT_NETWORK); + if (no == 4) return(XML_INPUT_UNZIP); + return(0); +} + +static void des_xmlParserInputFlags(int no ATTRIBUTE_UNUSED, xmlParserInputFlags val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +static void desret_xmlParserStatus(xmlParserStatus val ATTRIBUTE_UNUSED) { +} + #ifdef LIBXML_SCHEMAS_ENABLED #define gen_nb_xmlSchemaValType 4 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) { @@ -12095,7 +12110,7 @@ test_xmlCtxtGetStatus(void) { int test_ret = 0; int mem_base; - int ret_val; + xmlParserStatus ret_val; xmlParserCtxt * ctxt; /* an XML parser context */ int n_ctxt; @@ -12104,7 +12119,7 @@ test_xmlCtxtGetStatus(void) { ctxt = gen_xmlParserCtxt_ptr(n_ctxt, 0); ret_val = xmlCtxtGetStatus(ctxt); - desret_int(ret_val); + desret_xmlParserStatus(ret_val); call_tests++; des_xmlParserCtxt_ptr(n_ctxt, ctxt, 0); xmlResetLastError(); @@ -13408,23 +13423,23 @@ test_xmlNewInputFromFd(void) { int n_url; int fd; /* file descriptor */ int n_fd; - int flags; /* input flags */ + xmlParserInputFlags flags; /* input flags */ int n_flags; for (n_url = 0;n_url < gen_nb_filepath;n_url++) { for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_flags = 0;n_flags < gen_nb_xmlParserInputFlags;n_flags++) { mem_base = xmlMemBlocks(); url = gen_filepath(n_url, 0); fd = gen_int(n_fd, 1); - flags = gen_int(n_flags, 2); + flags = gen_xmlParserInputFlags(n_flags, 2); ret_val = xmlNewInputFromFd(url, fd, flags); desret_xmlParserInputPtr(ret_val); call_tests++; des_filepath(n_url, url, 0); des_int(n_fd, fd, 1); - des_int(n_flags, flags, 2); + des_xmlParserInputFlags(n_flags, flags, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlNewInputFromFd", @@ -13474,23 +13489,23 @@ test_xmlNewInputFromString(void) { int n_url; const char * str; /* zero-terminated string */ int n_str; - int flags; /* optimization hints */ + xmlParserInputFlags flags; /* optimization hints */ int n_flags; for (n_url = 0;n_url < gen_nb_filepath;n_url++) { for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_flags = 0;n_flags < gen_nb_xmlParserInputFlags;n_flags++) { mem_base = xmlMemBlocks(); url = gen_filepath(n_url, 0); str = gen_const_char_ptr(n_str, 1); - flags = gen_int(n_flags, 2); + flags = gen_xmlParserInputFlags(n_flags, 2); ret_val = xmlNewInputFromString(url, str, flags); desret_xmlParserInputPtr(ret_val); call_tests++; des_filepath(n_url, url, 0); des_const_char_ptr(n_str, str, 1); - des_int(n_flags, flags, 2); + des_xmlParserInputFlags(n_flags, flags, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlNewInputFromString", @@ -13522,24 +13537,24 @@ test_xmlNewInputFromUrl(void) { int ret_val; const char * filename; /* the filename to use as entity */ int n_filename; - int flags; /* XML_INPUT flags */ + xmlParserInputFlags flags; /* XML_INPUT flags */ int n_flags; xmlParserInputPtr * out; /* pointer to new parser input */ int n_out; for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_flags = 0;n_flags < gen_nb_xmlParserInputFlags;n_flags++) { for (n_out = 0;n_out < gen_nb_xmlParserInputPtr_ptr;n_out++) { mem_base = xmlMemBlocks(); filename = gen_filepath(n_filename, 0); - flags = gen_int(n_flags, 1); + flags = gen_xmlParserInputFlags(n_flags, 1); out = gen_xmlParserInputPtr_ptr(n_out, 2); ret_val = xmlNewInputFromUrl(filename, flags, out); desret_int(ret_val); call_tests++; des_filepath(n_filename, filename, 0); - des_int(n_flags, flags, 1); + des_xmlParserInputFlags(n_flags, flags, 1); des_xmlParserInputPtr_ptr(n_out, out, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { diff --git a/xmlIO.c b/xmlIO.c index c02ac9c5..e2e2a7d0 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -1049,7 +1049,8 @@ xmlIODefaultMatch(const char *filename ATTRIBUTE_UNUSED) { * Returns an xmlParserError code. */ int -xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, int flags) { +xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, + xmlParserInputFlags flags) { xmlFdIOCtxt *fdctxt; int copy; @@ -1161,7 +1162,7 @@ xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, int flags) { */ static int xmlInputDefaultOpen(xmlParserInputBufferPtr buf, const char *filename, - int flags) { + xmlParserInputFlags flags) { int ret; int fd; @@ -1455,7 +1456,8 @@ xmlOutputBufferClose(xmlOutputBufferPtr out) */ int xmlParserInputBufferCreateUrl(const char *URI, xmlCharEncoding enc, - int flags, xmlParserInputBufferPtr *out) { + xmlParserInputFlags flags, + xmlParserInputBufferPtr *out) { xmlParserInputBufferPtr buf; int ret; int i; @@ -1862,8 +1864,8 @@ xmlMemClose(void *vctxt) { * Returns the new input buffer or NULL. */ xmlParserInputBufferPtr -xmlNewInputBufferMemory(const void *mem, size_t size, int flags, - xmlCharEncoding enc) { +xmlNewInputBufferMemory(const void *mem, size_t size, + xmlParserInputFlags flags, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; if ((flags & XML_INPUT_BUF_STATIC) && @@ -1978,7 +1980,7 @@ xmlParserInputBufferCreateStatic(const char *mem, int size, * Returns the new input buffer or NULL. */ xmlParserInputBufferPtr -xmlNewInputBufferString(const char *str, int flags) { +xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) { xmlParserInputBufferPtr ret; ret = xmlMalloc(sizeof(*ret)); diff --git a/xmllint.c b/xmllint.c index 9c7d4cd6..8967c887 100644 --- a/xmllint.c +++ b/xmllint.c @@ -255,8 +255,8 @@ parsePath(xmllintState *lint, const xmlChar *path) { static int xmllintResourceLoader(void *ctxt, const char *URL, - const char *ID, xmlResourceType type, int flags, - xmlParserInputPtr *out) { + const char *ID, xmlResourceType type, + xmlParserInputFlags flags, xmlParserInputPtr *out) { xmllintState *lint = ctxt; int code; int i;