diff --git a/doc/devhelp/libxml2-HTMLparser.html b/doc/devhelp/libxml2-HTMLparser.html index b66c3ebb9dd60a5548f20068ae907960f6aed997_ZG9jL2RldmhlbHAvbGlieG1sMi1IVE1McGFyc2VyLmh0bWw=..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_ZG9jL2RldmhlbHAvbGlieG1sMi1IVE1McGFyc2VyLmh0bWw= 100644 --- a/doc/devhelp/libxml2-HTMLparser.html +++ b/doc/devhelp/libxml2-HTMLparser.html @@ -42,6 +42,7 @@ int <a href="#UTF8ToHtml">UTF8ToHtml</a> (unsigned char * out, <br> int * outlen, <br> const unsigned char * in, <br> int * inlen); <a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a> <a href="#htmlAttrAllowed">htmlAttrAllowed</a> (const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * elt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * attr, <br> int legacy); int <a href="#htmlAutoCloseTag">htmlAutoCloseTag</a> (<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br> <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem); +<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlCreateFileParserCtxt">htmlCreateFileParserCtxt</a> (const char * filename, <br> const char * encoding); <a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlCreateMemoryParserCtxt">htmlCreateMemoryParserCtxt</a> (const char * buffer, <br> int size); <a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlCreatePushParserCtxt">htmlCreatePushParserCtxt</a> (<a href="libxml2-HTMLparser.html#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a> sax, <br> void * user_data, <br> const char * chunk, <br> int size, <br> const char * filename, <br> <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc); <a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> <a href="#htmlCtxtReadDoc">htmlCtxtReadDoc</a> (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * cur, <br> const char * URL, <br> const char * encoding, <br> int options); @@ -58,6 +59,7 @@ const <a href="libxml2-HTMLparser.html#htmlEntityDesc">htmlEntityDesc</a> * <a href="#htmlEntityValueLookup">htmlEntityValueLookup</a> (unsigned int value); void <a href="#htmlFreeParserCtxt">htmlFreeParserCtxt</a> (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt); int <a href="#htmlHandleOmittedElem">htmlHandleOmittedElem</a> (int val); +void <a href="#htmlInitAutoClose">htmlInitAutoClose</a> (void); int <a href="#htmlIsAutoClosed">htmlIsAutoClosed</a> (<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br> <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem); int <a href="#htmlIsScriptAttribute">htmlIsScriptAttribute</a> (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name); <a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlNewParserCtxt">htmlNewParserCtxt</a> (void); @@ -386,6 +388,31 @@ <hr> <div class="refsect2" lang="en"> <h3> +<a name="htmlCreateFileParserCtxt"></a>htmlCreateFileParserCtxt ()</h3> +<pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> htmlCreateFileParserCtxt (const char * filename, <br> const char * encoding)<br> +</pre> +<p>Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p> +<div class="variablelist"><table border="0"> +<col align="left"> +<tbody> +<tr> +<td><span class="term"><i><tt>filename</tt></i>:</span></td> +<td>the filename</td> +</tr> +<tr> +<td><span class="term"><i><tt>encoding</tt></i>:</span></td> +<td>a free form C string describing the HTML document encoding, or NULL</td> +</tr> +<tr> +<td><span class="term"><i><tt>Returns</tt></i>:</span></td> +<td>the new parser context or NULL</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2" lang="en"> +<h3> <a name="htmlCreateMemoryParserCtxt"></a>htmlCreateMemoryParserCtxt ()</h3> <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> htmlCreateMemoryParserCtxt (const char * buffer, <br> int size)<br> </pre> @@ -851,6 +878,14 @@ <hr> <div class="refsect2" lang="en"> <h3> +<a name="htmlInitAutoClose"></a>htmlInitAutoClose ()</h3> +<pre class="programlisting">void htmlInitAutoClose (void)<br> +</pre> +<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. This is a no-op now.</p> +</div> +<hr> +<div class="refsect2" lang="en"> +<h3> <a name="htmlIsAutoClosed"></a>htmlIsAutoClosed ()</h3> <pre class="programlisting">int htmlIsAutoClosed (<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br> <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem)<br> </pre> diff --git a/doc/devhelp/libxml2-parserInternals.html b/doc/devhelp/libxml2-parserInternals.html index b66c3ebb9dd60a5548f20068ae907960f6aed997_ZG9jL2RldmhlbHAvbGlieG1sMi1wYXJzZXJJbnRlcm5hbHMuaHRtbA==..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_ZG9jL2RldmhlbHAvbGlieG1sMi1wYXJzZXJJbnRlcm5hbHMuaHRtbA== 100644 --- a/doc/devhelp/libxml2-parserInternals.html +++ b/doc/devhelp/libxml2-parserInternals.html @@ -54,8 +54,6 @@ #define <a href="#XML_SUBSTITUTE_NONE">XML_SUBSTITUTE_NONE</a>; #define <a href="#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a>; #define <a href="#XML_SUBSTITUTE_REF">XML_SUBSTITUTE_REF</a>; -<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlCreateFileParserCtxt">htmlCreateFileParserCtxt</a> (const char * filename, <br> const char * encoding); -void <a href="#htmlInitAutoClose">htmlInitAutoClose</a> (void); <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="#inputPop">inputPop</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt); int <a href="#inputPush">inputPush</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value); const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#namePop">namePop</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt); @@ -620,39 +618,6 @@ <hr> <div class="refsect2" lang="en"> <h3> -<a name="htmlCreateFileParserCtxt"></a>htmlCreateFileParserCtxt ()</h3> -<pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> htmlCreateFileParserCtxt (const char * filename, <br> const char * encoding)<br> -</pre> -<p>Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p> -<div class="variablelist"><table border="0"> -<col align="left"> -<tbody> -<tr> -<td><span class="term"><i><tt>filename</tt></i>:</span></td> -<td>the filename</td> -</tr> -<tr> -<td><span class="term"><i><tt>encoding</tt></i>:</span></td> -<td>a free form C string describing the HTML document encoding, or NULL</td> -</tr> -<tr> -<td><span class="term"><i><tt>Returns</tt></i>:</span></td> -<td>the new parser context or NULL</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2" lang="en"> -<h3> -<a name="htmlInitAutoClose"></a>htmlInitAutoClose ()</h3> -<pre class="programlisting">void htmlInitAutoClose (void)<br> -</pre> -<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. This is a no-op now.</p> -</div> -<hr> -<div class="refsect2" lang="en"> -<h3> <a name="inputPop"></a>inputPop ()</h3> <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> inputPop (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br> </pre> diff --git a/doc/devhelp/libxml2.devhelp2 b/doc/devhelp/libxml2.devhelp2 index b66c3ebb9dd60a5548f20068ae907960f6aed997_ZG9jL2RldmhlbHAvbGlieG1sMi5kZXZoZWxwMg==..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_ZG9jL2RldmhlbHAvbGlieG1sMi5kZXZoZWxwMg== 100644 --- a/doc/devhelp/libxml2.devhelp2 +++ b/doc/devhelp/libxml2.devhelp2 @@ -1966,7 +1966,7 @@ <keyword type="function" name="hasInternalSubset ()" link="libxml2-SAX.html#hasInternalSubset"/> <keyword type="function" name="htmlAttrAllowed ()" link="libxml2-HTMLparser.html#htmlAttrAllowed"/> <keyword type="function" name="htmlAutoCloseTag ()" link="libxml2-HTMLparser.html#htmlAutoCloseTag"/> - <keyword type="function" name="htmlCreateFileParserCtxt ()" link="libxml2-parserInternals.html#htmlCreateFileParserCtxt"/> + <keyword type="function" name="htmlCreateFileParserCtxt ()" link="libxml2-HTMLparser.html#htmlCreateFileParserCtxt"/> <keyword type="function" name="htmlCreateMemoryParserCtxt ()" link="libxml2-HTMLparser.html#htmlCreateMemoryParserCtxt"/> <keyword type="function" name="htmlCreatePushParserCtxt ()" link="libxml2-HTMLparser.html#htmlCreatePushParserCtxt"/> <keyword type="function" name="htmlCtxtReadDoc ()" link="libxml2-HTMLparser.html#htmlCtxtReadDoc"/> @@ -1990,7 +1990,7 @@ <keyword type="function" name="htmlFreeParserCtxt ()" link="libxml2-HTMLparser.html#htmlFreeParserCtxt"/> <keyword type="function" name="htmlGetMetaEncoding ()" link="libxml2-HTMLtree.html#htmlGetMetaEncoding"/> <keyword type="function" name="htmlHandleOmittedElem ()" link="libxml2-HTMLparser.html#htmlHandleOmittedElem"/> - <keyword type="function" name="htmlInitAutoClose ()" link="libxml2-parserInternals.html#htmlInitAutoClose"/> + <keyword type="function" name="htmlInitAutoClose ()" link="libxml2-HTMLparser.html#htmlInitAutoClose"/> <keyword type="function" name="htmlIsAutoClosed ()" link="libxml2-HTMLparser.html#htmlIsAutoClosed"/> <keyword type="function" name="htmlIsBooleanAttr ()" link="libxml2-HTMLtree.html#htmlIsBooleanAttr"/> <keyword type="function" name="htmlIsScriptAttribute ()" link="libxml2-HTMLparser.html#htmlIsScriptAttribute"/> diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index b66c3ebb9dd60a5548f20068ae907960f6aed997_ZG9jL2xpYnhtbDItYXBpLnhtbA==..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_ZG9jL2xpYnhtbDItYXBpLnhtbA== 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -43,6 +43,7 @@ <exports symbol='UTF8ToHtml' type='function'/> <exports symbol='htmlAttrAllowed' type='function'/> <exports symbol='htmlAutoCloseTag' type='function'/> + <exports symbol='htmlCreateFileParserCtxt' type='function'/> <exports symbol='htmlCreateMemoryParserCtxt' type='function'/> <exports symbol='htmlCreatePushParserCtxt' type='function'/> <exports symbol='htmlCtxtReadDoc' type='function'/> @@ -59,6 +60,7 @@ <exports symbol='htmlEntityValueLookup' type='function'/> <exports symbol='htmlFreeParserCtxt' type='function'/> <exports symbol='htmlHandleOmittedElem' type='function'/> + <exports symbol='htmlInitAutoClose' type='function'/> <exports symbol='htmlIsAutoClosed' type='function'/> <exports symbol='htmlIsScriptAttribute' type='function'/> <exports symbol='htmlNewParserCtxt' type='function'/> @@ -898,8 +900,6 @@ <exports symbol='xmlStringComment' type='variable'/> <exports symbol='xmlStringText' type='variable'/> <exports symbol='xmlStringTextNoenc' type='variable'/> - <exports symbol='htmlCreateFileParserCtxt' type='function'/> - <exports symbol='htmlInitAutoClose' type='function'/> <exports symbol='inputPop' type='function'/> <exports symbol='inputPush' type='function'/> <exports symbol='namePop' type='function'/> @@ -7397,7 +7397,7 @@ <arg name='name' type='const xmlChar *' info='The tag name'/> <arg name='elem' type='htmlNodePtr' info='the HTML element'/> </function> - <function name='htmlCreateFileParserCtxt' file='parserInternals' module='HTMLparser'> + <function name='htmlCreateFileParserCtxt' file='HTMLparser' module='HTMLparser'> <cond>defined(LIBXML_HTML_ENABLED)</cond> <info>Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</info> <return type='htmlParserCtxtPtr' info='the new parser context or NULL'/> @@ -7587,7 +7587,7 @@ <return type='int' info='the last value for 0 for no handling, 1 for auto insertion.'/> <arg name='val' type='int' info='int 0 or 1'/> </function> - <function name='htmlInitAutoClose' file='parserInternals' module='HTMLparser'> + <function name='htmlInitAutoClose' file='HTMLparser' module='HTMLparser'> <cond>defined(LIBXML_HTML_ENABLED)</cond> <info>DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library. This is a no-op now.</info> <return type='void'/> diff --git a/doc/symbols.xml b/doc/symbols.xml index b66c3ebb9dd60a5548f20068ae907960f6aed997_ZG9jL3N5bWJvbHMueG1s..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_ZG9jL3N5bWJvbHMueG1s 100644 --- a/doc/symbols.xml +++ b/doc/symbols.xml @@ -94,8 +94,8 @@ <symbol file="SAX">startElement</symbol> <symbol file="SAX">unparsedEntityDecl</symbol> <symbol file="SAX2">xmlDefaultSAXHandlerInit</symbol> - <symbol file="parserInternals">htmlCreateFileParserCtxt</symbol> - <symbol file="parserInternals">htmlInitAutoClose</symbol> + <symbol file="HTMLparser">htmlCreateFileParserCtxt</symbol> + <symbol file="HTMLparser">htmlInitAutoClose</symbol> <symbol file="parserInternals">inputPop</symbol> <symbol file="parserInternals">inputPush</symbol> <symbol file="parserInternals">namePop</symbol> diff --git a/include/libxml/HTMLparser.h b/include/libxml/HTMLparser.h index b66c3ebb9dd60a5548f20068ae907960f6aed997_aW5jbHVkZS9saWJ4bWwvSFRNTHBhcnNlci5o..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_aW5jbHVkZS9saWJ4bWwvSFRNTHBhcnNlci5o 100644 --- a/include/libxml/HTMLparser.h +++ b/include/libxml/HTMLparser.h @@ -83,6 +83,9 @@ /* * There is only few public functions. */ +XML_DEPRECATED +XMLPUBFUN void XMLCALL + htmlInitAutoClose (void); XMLPUBFUN const htmlElemDesc * XMLCALL htmlTagLookup (const xmlChar *tag); XMLPUBFUN const htmlEntityDesc * XMLCALL @@ -125,6 +128,9 @@ XMLPUBFUN htmlDocPtr XMLCALL htmlParseDoc (const xmlChar *cur, const char *encoding); +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreateFileParserCtxt(const char *filename, + const char *encoding); XMLPUBFUN htmlDocPtr XMLCALL htmlSAXParseFile(const char *filename, const char *encoding, diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h index b66c3ebb9dd60a5548f20068ae907960f6aed997_aW5jbHVkZS9saWJ4bWwvcGFyc2VySW50ZXJuYWxzLmg=..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_aW5jbHVkZS9saWJ4bWwvcGFyc2VySW50ZXJuYWxzLmg= 100644 --- a/include/libxml/parserInternals.h +++ b/include/libxml/parserInternals.h @@ -571,16 +571,6 @@ XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); -#ifdef LIBXML_HTML_ENABLED -/* - * Actually comes from the HTML parser but launched from the init stuff. - */ -XML_DEPRECATED -XMLPUBFUN void XMLCALL htmlInitAutoClose (void); -XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename, - const char *encoding); -#endif - /* * Specific function to keep track of entities references * and used by the XSLT debugger. diff --git a/libxml2.syms b/libxml2.syms index b66c3ebb9dd60a5548f20068ae907960f6aed997_bGlieG1sMi5zeW1z..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_bGlieG1sMi5zeW1z 100644 --- a/libxml2.syms +++ b/libxml2.syms @@ -119,6 +119,6 @@ # SAX2 xmlDefaultSAXHandlerInit; -# parserInternals +# HTMLparser htmlCreateFileParserCtxt; htmlInitAutoClose; @@ -123,5 +123,7 @@ htmlCreateFileParserCtxt; htmlInitAutoClose; + +# parserInternals inputPop; inputPush; namePop; diff --git a/parser.c b/parser.c index b66c3ebb9dd60a5548f20068ae907960f6aed997_cGFyc2VyLmM=..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_cGFyc2VyLmM= 100644 --- a/parser.c +++ b/parser.c @@ -57,6 +57,7 @@ #include <libxml/tree.h> #include <libxml/parser.h> #include <libxml/parserInternals.h> +#include <libxml/HTMLparser.h> #include <libxml/valid.h> #include <libxml/entities.h> #include <libxml/xmlerror.h> diff --git a/testapi.c b/testapi.c index b66c3ebb9dd60a5548f20068ae907960f6aed997_dGVzdGFwaS5j..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_dGVzdGFwaS5j 100644 --- a/testapi.c +++ b/testapi.c @@ -1458,6 +1458,47 @@ static int +test_htmlCreateFileParserCtxt(void) { + int test_ret = 0; + +#if defined(LIBXML_HTML_ENABLED) + int mem_base; + htmlParserCtxtPtr ret_val; + const char * filename; /* the filename */ + int n_filename; + char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ + int n_encoding; + + for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { + for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { + mem_base = xmlMemBlocks(); + filename = gen_fileoutput(n_filename, 0); + encoding = gen_const_char_ptr(n_encoding, 1); + + ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding); + desret_htmlParserCtxtPtr(ret_val); + call_tests++; + des_fileoutput(n_filename, filename, 0); + des_const_char_ptr(n_encoding, (const char *)encoding, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in htmlCreateFileParserCtxt", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_filename); + printf(" %d", n_encoding); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_htmlCreateMemoryParserCtxt(void) { int test_ret = 0; @@ -2077,6 +2118,31 @@ static int +test_htmlInitAutoClose(void) { + int test_ret = 0; + +#if defined(LIBXML_HTML_ENABLED) + int mem_base; + + mem_base = xmlMemBlocks(); + + htmlInitAutoClose(); + call_tests++; + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in htmlInitAutoClose", + xmlMemBlocks() - mem_base); + test_ret++; + printf("\n"); + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_htmlIsAutoClosed(void) { int test_ret = 0; @@ -2824,7 +2890,7 @@ test_HTMLparser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing HTMLparser : 33 of 39 functions ...\n"); + if (quiet == 0) printf("Testing HTMLparser : 35 of 41 functions ...\n"); test_ret += test_UTF8ToHtml(); test_ret += test_htmlAttrAllowed(); test_ret += test_htmlAutoCloseTag(); @@ -2828,6 +2894,7 @@ test_ret += test_UTF8ToHtml(); test_ret += test_htmlAttrAllowed(); test_ret += test_htmlAutoCloseTag(); + test_ret += test_htmlCreateFileParserCtxt(); test_ret += test_htmlCreateMemoryParserCtxt(); test_ret += test_htmlCreatePushParserCtxt(); test_ret += test_htmlCtxtReadDoc(); @@ -2841,6 +2908,7 @@ test_ret += test_htmlEntityLookup(); test_ret += test_htmlEntityValueLookup(); test_ret += test_htmlHandleOmittedElem(); + test_ret += test_htmlInitAutoClose(); test_ret += test_htmlIsAutoClosed(); test_ret += test_htmlIsScriptAttribute(); test_ret += test_htmlNewParserCtxt(); @@ -14734,72 +14802,6 @@ } static int -test_htmlCreateFileParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlParserCtxtPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ - int n_encoding; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - - ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding); - desret_htmlParserCtxtPtr(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCreateFileParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlInitAutoClose(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - htmlInitAutoClose(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlInitAutoClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int test_inputPop(void) { int test_ret = 0; @@ -16049,9 +16051,7 @@ test_parserInternals(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n"); - test_ret += test_htmlCreateFileParserCtxt(); - test_ret += test_htmlInitAutoClose(); + if (quiet == 0) printf("Testing parserInternals : 31 of 88 functions ...\n"); test_ret += test_inputPop(); test_ret += test_inputPush(); test_ret += test_namePop(); diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src index b66c3ebb9dd60a5548f20068ae907960f6aed997_d2luMzIvbGlieG1sMi5kZWYuc3Jj..ee986788914dbf6b01a19b6374ab3c7a6d1f4448_d2luMzIvbGlieG1sMi5kZWYuc3Jj 100644 --- a/win32/libxml2.def.src +++ b/win32/libxml2.def.src @@ -204,5 +204,6 @@ htmlAutoCloseTag #endif #ifdef LIBXML_HTML_ENABLED +#ifdef LIBXML_HTML_ENABLED htmlCreateFileParserCtxt #endif @@ -207,5 +208,6 @@ htmlCreateFileParserCtxt #endif +#endif #ifdef LIBXML_HTML_ENABLED htmlCreateMemoryParserCtxt #endif @@ -276,5 +278,6 @@ htmlHandleOmittedElem #endif #ifdef LIBXML_HTML_ENABLED +#ifdef LIBXML_HTML_ENABLED htmlInitAutoClose #endif @@ -279,5 +282,6 @@ htmlInitAutoClose #endif +#endif #ifdef LIBXML_HTML_ENABLED htmlIsAutoClosed #endif