[xml] xmlEncodeEntitiesReentrant with no "doc" parameter



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 *      xmlEncodeEntitiesReentrant     (xmlDocPtr doc, 
                                               const 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

 

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]