mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
Make xmlNewSAXParserCtx take a const sax handler
Also improve documentation.
This commit is contained in:
@ -5047,7 +5047,8 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
htmlInitParserCtxt(htmlParserCtxtPtr ctxt, htmlSAXHandler *sax, void *userData)
|
htmlInitParserCtxt(htmlParserCtxtPtr ctxt, const htmlSAXHandler *sax,
|
||||||
|
void *userData)
|
||||||
{
|
{
|
||||||
if (ctxt == NULL) return(-1);
|
if (ctxt == NULL) return(-1);
|
||||||
memset(ctxt, 0, sizeof(htmlParserCtxt));
|
memset(ctxt, 0, sizeof(htmlParserCtxt));
|
||||||
@ -5181,13 +5182,14 @@ htmlNewParserCtxt(void)
|
|||||||
* @sax: SAX handler
|
* @sax: SAX handler
|
||||||
* @userData: user data
|
* @userData: user data
|
||||||
*
|
*
|
||||||
* Allocate and initialize a new parser context.
|
* Allocate and initialize a new SAX parser context. If userData is NULL,
|
||||||
|
* the parser context will be passed as user data.
|
||||||
*
|
*
|
||||||
* Returns the htmlParserCtxtPtr or NULL in case of allocation error
|
* Returns the htmlParserCtxtPtr or NULL in case of allocation error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
htmlParserCtxtPtr
|
htmlParserCtxtPtr
|
||||||
htmlNewSAXParserCtxt(htmlSAXHandlerPtr sax, void *userData)
|
htmlNewSAXParserCtxt(const htmlSAXHandler *sax, void *userData)
|
||||||
{
|
{
|
||||||
xmlParserCtxtPtr ctxt;
|
xmlParserCtxtPtr ctxt;
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ XMLPUBFUN void XMLCALL
|
|||||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
||||||
htmlNewParserCtxt(void);
|
htmlNewParserCtxt(void);
|
||||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
||||||
htmlNewSAXParserCtxt(htmlSAXHandlerPtr sax,
|
htmlNewSAXParserCtxt(const htmlSAXHandler *sax,
|
||||||
void *userData);
|
void *userData);
|
||||||
|
|
||||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
||||||
htmlCreateMemoryParserCtxt(const char *buffer,
|
htmlCreateMemoryParserCtxt(const char *buffer,
|
||||||
|
@ -990,7 +990,8 @@ XMLPUBFUN int XMLCALL
|
|||||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||||
xmlNewParserCtxt (void);
|
xmlNewParserCtxt (void);
|
||||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||||
xmlNewSAXParserCtxt (xmlSAXHandlerPtr sax, void *userData);
|
xmlNewSAXParserCtxt (const xmlSAXHandler *sax,
|
||||||
|
void *userData);
|
||||||
XMLPUBFUN int XMLCALL
|
XMLPUBFUN int XMLCALL
|
||||||
xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
|
xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
|
||||||
XMLPUBFUN void XMLCALL
|
XMLPUBFUN void XMLCALL
|
||||||
|
@ -1455,7 +1455,7 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xmlInitSAXParserCtxt(xmlParserCtxtPtr ctxt, xmlSAXHandlerPtr sax,
|
xmlInitSAXParserCtxt(xmlParserCtxtPtr ctxt, const xmlSAXHandler *sax,
|
||||||
void *userData)
|
void *userData)
|
||||||
{
|
{
|
||||||
xmlParserInputPtr input;
|
xmlParserInputPtr input;
|
||||||
@ -1765,13 +1765,14 @@ xmlNewParserCtxt(void)
|
|||||||
* @sax: SAX handler
|
* @sax: SAX handler
|
||||||
* @userData: user data
|
* @userData: user data
|
||||||
*
|
*
|
||||||
* Allocate and initialize a new SAX parser context.
|
* Allocate and initialize a new SAX parser context. If userData is NULL,
|
||||||
|
* the parser context will be passed as user data.
|
||||||
*
|
*
|
||||||
* Returns the xmlParserCtxtPtr or NULL
|
* Returns the xmlParserCtxtPtr or NULL if memory allocation failed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xmlParserCtxtPtr
|
xmlParserCtxtPtr
|
||||||
xmlNewSAXParserCtxt(xmlSAXHandlerPtr sax, void *userData)
|
xmlNewSAXParserCtxt(const xmlSAXHandler *sax, void *userData)
|
||||||
{
|
{
|
||||||
xmlParserCtxtPtr ctxt;
|
xmlParserCtxtPtr ctxt;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user