Is it legal, from an API perspective, to pass "NULL" to xmlEncodeEntitiesReentrant? Looking at the code, passing NULL as the "doc" parameter will not cause adverse affect. What I want to confirm is that, long term, the doc parameter is optional. Thanks. Here is the documentation in question:
Function: xmlEncodeEntitiesReentrant xmlChar <http://xmlsoft.org/html/libxml-xmlstring.html#xmlChar> * xmlEncodeEntitiesReentrant (xmlDocPtr <http://xmlsoft.org/html/libxml-tree.html#xmlDocPtr> doc, const xmlChar <http://xmlsoft.org/html/libxml-xmlstring.html#xmlChar> * input) Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated. doc: the document containing the string input: A string to convert to XML. Returns: A newly allocated string with the substitution done. The code for version 2.6.26 always checks for NULL, and avoids doing some things ( but not all things ) if it is NULL. This is perfect, and what I want. I just want to make sure it is by design. Tony
_______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
