Lines Matching refs:parser

64 	XML_Parser parser;  local
119 #define SKIP_TAGSTART(str) ((str) + (parser->toffset > strlen(str) ? strlen(str) : parser->toffset))
141 static void xml_add_to_info(xml_parser *parser, const char *name);
142 inline static zend_string *xml_decode_tag(xml_parser *parser, const XML_Char *tag);
268 static int xml_parse_helper(xml_parser *parser, const char *data, size_t data_len, bool is_final) in xml_parse_helper() argument
270 ZEND_ASSERT(!parser->isparsing); in xml_parse_helper()
277 if (parser->parsehuge) { in xml_parse_helper()
278 parser->parser->parser->options |= XML_PARSE_HUGE; in xml_parse_helper()
279 xmlDictSetLimit(parser->parser->parser->dict, 0); in xml_parse_helper()
281 parser->parser->parser->options &= ~XML_PARSE_HUGE; in xml_parse_helper()
282 xmlDictSetLimit(parser->parser->parser->dict, XML_MAX_DICTIONARY_LIMIT); in xml_parse_helper()
287 parser->isparsing = 1; in xml_parse_helper()
288 int ret = XML_Parse(parser->parser, (const XML_Char *) data, data_len, is_final); in xml_parse_helper()
289 parser->isparsing = 0; in xml_parse_helper()
322 static void xml_parser_free_ltags(xml_parser *parser) in xml_parser_free_ltags() argument
324 if (parser->ltags) { in xml_parser_free_ltags()
326 for (inx = 0; ((inx < parser->level) && (inx < XML_MAXLEVEL)); inx++) in xml_parser_free_ltags()
327 efree(parser->ltags[ inx ]); in xml_parser_free_ltags()
328 efree(parser->ltags); in xml_parser_free_ltags()
334 xml_parser *parser = xml_parser_from_obj(object); in xml_parser_free_obj() local
336 zval_ptr_dtor(&parser->info); in xml_parser_free_obj()
337 zval_ptr_dtor(&parser->data); in xml_parser_free_obj()
338 if (parser->parser) { in xml_parser_free_obj()
339 XML_ParserFree(parser->parser); in xml_parser_free_obj()
341 xml_parser_free_ltags(parser); in xml_parser_free_obj()
342 if (ZEND_FCC_INITIALIZED(parser->startElementHandler)) { in xml_parser_free_obj()
343 zend_fcc_dtor(&parser->startElementHandler); in xml_parser_free_obj()
344 parser->startElementHandler.function_handler = NULL; in xml_parser_free_obj()
346 if (ZEND_FCC_INITIALIZED(parser->endElementHandler)) { in xml_parser_free_obj()
347 zend_fcc_dtor(&parser->endElementHandler); in xml_parser_free_obj()
348 parser->endElementHandler.function_handler = NULL; in xml_parser_free_obj()
350 if (ZEND_FCC_INITIALIZED(parser->characterDataHandler)) { in xml_parser_free_obj()
351 zend_fcc_dtor(&parser->characterDataHandler); in xml_parser_free_obj()
352 parser->characterDataHandler.function_handler = NULL; in xml_parser_free_obj()
354 if (ZEND_FCC_INITIALIZED(parser->processingInstructionHandler)) { in xml_parser_free_obj()
355 zend_fcc_dtor(&parser->processingInstructionHandler); in xml_parser_free_obj()
356 parser->processingInstructionHandler.function_handler = NULL; in xml_parser_free_obj()
358 if (ZEND_FCC_INITIALIZED(parser->defaultHandler)) { in xml_parser_free_obj()
359 zend_fcc_dtor(&parser->defaultHandler); in xml_parser_free_obj()
360 parser->defaultHandler.function_handler = NULL; in xml_parser_free_obj()
362 if (ZEND_FCC_INITIALIZED(parser->unparsedEntityDeclHandler)) { in xml_parser_free_obj()
363 zend_fcc_dtor(&parser->unparsedEntityDeclHandler); in xml_parser_free_obj()
364 parser->unparsedEntityDeclHandler.function_handler = NULL; in xml_parser_free_obj()
366 if (ZEND_FCC_INITIALIZED(parser->notationDeclHandler)) { in xml_parser_free_obj()
367 zend_fcc_dtor(&parser->notationDeclHandler); in xml_parser_free_obj()
368 parser->notationDeclHandler.function_handler = NULL; in xml_parser_free_obj()
370 if (ZEND_FCC_INITIALIZED(parser->externalEntityRefHandler)) { in xml_parser_free_obj()
371 zend_fcc_dtor(&parser->externalEntityRefHandler); in xml_parser_free_obj()
372 parser->externalEntityRefHandler.function_handler = NULL; in xml_parser_free_obj()
374 if (ZEND_FCC_INITIALIZED(parser->startNamespaceDeclHandler)) { in xml_parser_free_obj()
375 zend_fcc_dtor(&parser->startNamespaceDeclHandler); in xml_parser_free_obj()
376 parser->startNamespaceDeclHandler.function_handler = NULL; in xml_parser_free_obj()
378 if (ZEND_FCC_INITIALIZED(parser->endNamespaceDeclHandler)) { in xml_parser_free_obj()
379 zend_fcc_dtor(&parser->endNamespaceDeclHandler); in xml_parser_free_obj()
380 parser->endNamespaceDeclHandler.function_handler = NULL; in xml_parser_free_obj()
382 if (parser->baseURI) { in xml_parser_free_obj()
383 efree(parser->baseURI); in xml_parser_free_obj()
385 if (parser->object) { in xml_parser_free_obj()
386 OBJ_RELEASE(parser->object); in xml_parser_free_obj()
389 zend_object_std_dtor(&parser->std); in xml_parser_free_obj()
394 xml_parser *parser = xml_parser_from_obj(object); in xml_parser_get_gc() local
397 if (parser->object) { in xml_parser_get_gc()
398 zend_get_gc_buffer_add_obj(gc_buffer, parser->object); in xml_parser_get_gc()
400 if (ZEND_FCC_INITIALIZED(parser->startElementHandler)) { in xml_parser_get_gc()
401 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->startElementHandler); in xml_parser_get_gc()
403 if (ZEND_FCC_INITIALIZED(parser->endElementHandler)) { in xml_parser_get_gc()
404 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->endElementHandler); in xml_parser_get_gc()
406 if (ZEND_FCC_INITIALIZED(parser->characterDataHandler)) { in xml_parser_get_gc()
407 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->characterDataHandler); in xml_parser_get_gc()
409 if (ZEND_FCC_INITIALIZED(parser->processingInstructionHandler)) { in xml_parser_get_gc()
410 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->processingInstructionHandler); in xml_parser_get_gc()
412 if (ZEND_FCC_INITIALIZED(parser->defaultHandler)) { in xml_parser_get_gc()
413 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->defaultHandler); in xml_parser_get_gc()
415 if (ZEND_FCC_INITIALIZED(parser->unparsedEntityDeclHandler)) { in xml_parser_get_gc()
416 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->unparsedEntityDeclHandler); in xml_parser_get_gc()
418 if (ZEND_FCC_INITIALIZED(parser->notationDeclHandler)) { in xml_parser_get_gc()
419 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->notationDeclHandler); in xml_parser_get_gc()
421 if (ZEND_FCC_INITIALIZED(parser->externalEntityRefHandler)) { in xml_parser_get_gc()
422 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->externalEntityRefHandler); in xml_parser_get_gc()
424 if (ZEND_FCC_INITIALIZED(parser->startNamespaceDeclHandler)) { in xml_parser_get_gc()
425 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->startNamespaceDeclHandler); in xml_parser_get_gc()
427 if (ZEND_FCC_INITIALIZED(parser->endNamespaceDeclHandler)) { in xml_parser_get_gc()
428 zend_get_gc_buffer_add_fcc(gc_buffer, &parser->endNamespaceDeclHandler); in xml_parser_get_gc()
430 zend_get_gc_buffer_add_zval(gc_buffer, &parser->data); in xml_parser_get_gc()
431 zend_get_gc_buffer_add_zval(gc_buffer, &parser->info); in xml_parser_get_gc()
556 static void xml_add_to_info(xml_parser *parser, const char *name) in xml_add_to_info() argument
560 if (Z_ISUNDEF(parser->info) || UNEXPECTED(Z_TYPE_P(Z_REFVAL(parser->info)) != IS_ARRAY)) { in xml_add_to_info()
564 SEPARATE_ARRAY(Z_REFVAL(parser->info)); in xml_add_to_info()
565 zend_array *arr = Z_ARRVAL_P(Z_REFVAL(parser->info)); in xml_add_to_info()
574 add_next_index_long(element, parser->curtag); in xml_add_to_info()
576 parser->curtag++; in xml_add_to_info()
581 static zend_string *xml_decode_tag(xml_parser *parser, const XML_Char *tag) in xml_decode_tag() argument
585 str = xml_utf8_decode(tag, xml_xmlcharlen(tag), parser->target_encoding); in xml_decode_tag()
587 if (parser->case_folding) { in xml_decode_tag()
595 static zval *xml_get_separated_data(xml_parser *parser) in xml_get_separated_data() argument
597 if (EXPECTED(Z_TYPE_P(Z_REFVAL(parser->data)) == IS_ARRAY)) { in xml_get_separated_data()
598 SEPARATE_ARRAY(Z_REFVAL(parser->data)); in xml_get_separated_data()
599 return Z_REFVAL(parser->data); in xml_get_separated_data()
604 static zval *xml_get_ctag(xml_parser *parser) in xml_get_ctag() argument
606 zval *data = xml_get_separated_data(parser); in xml_get_ctag()
608 zval *zv = zend_hash_index_find_deref(Z_ARRVAL_P(data), parser->ctag_index); in xml_get_ctag()
620 xml_parser *parser = (xml_parser *)userData; in xml_startElementHandler() local
624 if (!parser) { in xml_startElementHandler()
628 parser->level++; in xml_startElementHandler()
630 tag_name = xml_decode_tag(parser, name); in xml_startElementHandler()
632 if (ZEND_FCC_INITIALIZED(parser->startElementHandler)) { in xml_startElementHandler()
634 ZVAL_COPY(&args[0], &parser->index); in xml_startElementHandler()
641 att = xml_decode_tag(parser, attributes[0]); in xml_startElementHandler()
642 val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding); in xml_startElementHandler()
652 …zend_call_known_fcc(&parser->startElementHandler, /* retval */ NULL, /* param_count */ 3, args, /*… in xml_startElementHandler()
658 if (!Z_ISUNDEF(parser->data) && !EG(exception)) { in xml_startElementHandler()
659 if (parser->level <= XML_MAXLEVEL) { in xml_startElementHandler()
666 xml_add_to_info(parser, ZSTR_VAL(tag_name) + parser->toffset); in xml_startElementHandler()
670 add_assoc_long(&tag, "level", parser->level); in xml_startElementHandler()
672 parser->ltags[parser->level-1] = estrdup(ZSTR_VAL(tag_name)); in xml_startElementHandler()
673 parser->lastwasopen = 1; in xml_startElementHandler()
680 att = xml_decode_tag(parser, attributes[0]); in xml_startElementHandler()
681 val = xml_utf8_decode(attributes[1], strlen((char *)attributes[1]), parser->target_encoding); in xml_startElementHandler()
698 zval *data = xml_get_separated_data(parser); in xml_startElementHandler()
704 parser->ctag_index = arr->nNextFreeElement - 1; in xml_startElementHandler()
711 } else if (parser->level == (XML_MAXLEVEL + 1)) { in xml_startElementHandler()
723 xml_parser *parser = (xml_parser *)userData; in xml_endElementHandler() local
725 if (!parser) { in xml_endElementHandler()
729 zend_string *tag_name = xml_decode_tag(parser, name); in xml_endElementHandler()
731 if (ZEND_FCC_INITIALIZED(parser->endElementHandler)) { in xml_endElementHandler()
733 ZVAL_COPY(&args[0], &parser->index); in xml_endElementHandler()
736 …zend_call_known_fcc(&parser->endElementHandler, /* retval */ NULL, /* param_count */ 2, args, /* n… in xml_endElementHandler()
741 if (!Z_ISUNDEF(parser->data) && !EG(exception)) { in xml_endElementHandler()
744 if (parser->lastwasopen) { in xml_endElementHandler()
745 zval *zv = xml_get_ctag(parser); in xml_endElementHandler()
750 xml_add_to_info(parser, ZSTR_VAL(tag_name) + parser->toffset); in xml_endElementHandler()
752 zval *data = xml_get_separated_data(parser); in xml_endElementHandler()
757 add_assoc_long(&tag, "level", parser->level); in xml_endElementHandler()
762 parser->lastwasopen = 0; in xml_endElementHandler()
767 if ((parser->ltags) && (parser->level <= XML_MAXLEVEL)) { in xml_endElementHandler()
768 efree(parser->ltags[parser->level-1]); in xml_endElementHandler()
771 parser->level--; in xml_endElementHandler()
778 xml_parser *parser = (xml_parser *)userData; in xml_characterDataHandler() local
780 if (!parser) { in xml_characterDataHandler()
784 if (ZEND_FCC_INITIALIZED(parser->characterDataHandler)) { in xml_characterDataHandler()
786 ZVAL_COPY(&args[0], &parser->index); in xml_characterDataHandler()
787 xml_xmlchar_zval(s, len, parser->target_encoding, &args[1]); in xml_characterDataHandler()
789 …zend_call_known_fcc(&parser->characterDataHandler, /* retval */ NULL, /* param_count */ 2, args, /… in xml_characterDataHandler()
794 if (Z_ISUNDEF(parser->data) || EG(exception)) { in xml_characterDataHandler()
800 decoded_value = xml_utf8_decode(s, len, parser->target_encoding); in xml_characterDataHandler()
801 if (parser->skipwhite) { in xml_characterDataHandler()
817 if (parser->lastwasopen) { in xml_characterDataHandler()
818 zval *ctag = xml_get_ctag(parser); in xml_characterDataHandler()
833 if (doprint || (! parser->skipwhite)) { in xml_characterDataHandler()
843 zval *data = xml_get_separated_data(parser); in xml_characterDataHandler()
865 if (parser->level <= XML_MAXLEVEL && parser->level > 0 && (doprint || (! parser->skipwhite))) { in xml_characterDataHandler()
867 xml_add_to_info(parser,SKIP_TAGSTART(parser->ltags[parser->level-1])); in xml_characterDataHandler()
868 add_assoc_string(&tag, "tag", SKIP_TAGSTART(parser->ltags[parser->level-1])); in xml_characterDataHandler()
871 add_assoc_long(&tag, "level", parser->level); in xml_characterDataHandler()
873 } else if (parser->level == (XML_MAXLEVEL + 1)) { in xml_characterDataHandler()
885 xml_parser *parser = (xml_parser *)userData; in xml_processingInstructionHandler() local
887 if (!parser || !ZEND_FCC_INITIALIZED(parser->processingInstructionHandler)) { in xml_processingInstructionHandler()
893 ZVAL_COPY(&args[0], &parser->index); in xml_processingInstructionHandler()
894 xml_xmlchar_zval(target, 0, parser->target_encoding, &args[1]); in xml_processingInstructionHandler()
895 xml_xmlchar_zval(data, 0, parser->target_encoding, &args[2]); in xml_processingInstructionHandler()
897 …zend_call_known_fcc(&parser->processingInstructionHandler, /* retval */ NULL, /* param_count */ 3,… in xml_processingInstructionHandler()
907 xml_parser *parser = (xml_parser *)userData; in xml_defaultHandler() local
909 if (!parser || !ZEND_FCC_INITIALIZED(parser->defaultHandler)) { in xml_defaultHandler()
915 ZVAL_COPY(&args[0], &parser->index); in xml_defaultHandler()
916 xml_xmlchar_zval(s, len, parser->target_encoding, &args[1]); in xml_defaultHandler()
918 …zend_call_known_fcc(&parser->defaultHandler, /* retval */ NULL, /* param_count */ 2, args, /* name… in xml_defaultHandler()
929 xml_parser *parser = (xml_parser *)userData; in xml_unparsedEntityDeclHandler() local
931 if (!parser || !ZEND_FCC_INITIALIZED(parser->unparsedEntityDeclHandler)) { in xml_unparsedEntityDeclHandler()
937 ZVAL_COPY(&args[0], &parser->index); in xml_unparsedEntityDeclHandler()
938 xml_xmlchar_zval(entityName, 0, parser->target_encoding, &args[1]); in xml_unparsedEntityDeclHandler()
939 xml_xmlchar_zval(base, 0, parser->target_encoding, &args[2]); in xml_unparsedEntityDeclHandler()
940 xml_xmlchar_zval(systemId, 0, parser->target_encoding, &args[3]); in xml_unparsedEntityDeclHandler()
941 xml_xmlchar_zval(publicId, 0, parser->target_encoding, &args[4]); in xml_unparsedEntityDeclHandler()
942 xml_xmlchar_zval(notationName, 0, parser->target_encoding, &args[5]); in xml_unparsedEntityDeclHandler()
944 …zend_call_known_fcc(&parser->unparsedEntityDeclHandler, /* retval */ NULL, /* param_count */ 6, ar… in xml_unparsedEntityDeclHandler()
958 xml_parser *parser = (xml_parser *)userData; in xml_notationDeclHandler() local
960 if (!parser || !ZEND_FCC_INITIALIZED(parser->notationDeclHandler)) { in xml_notationDeclHandler()
966 ZVAL_COPY(&args[0], &parser->index); in xml_notationDeclHandler()
967 xml_xmlchar_zval(notationName, 0, parser->target_encoding, &args[1]); in xml_notationDeclHandler()
968 xml_xmlchar_zval(base, 0, parser->target_encoding, &args[2]); in xml_notationDeclHandler()
969 xml_xmlchar_zval(systemId, 0, parser->target_encoding, &args[3]); in xml_notationDeclHandler()
970 xml_xmlchar_zval(publicId, 0, parser->target_encoding, &args[4]); in xml_notationDeclHandler()
972 …zend_call_known_fcc(&parser->notationDeclHandler, /* retval */ NULL, /* param_count */ 5, args, /*… in xml_notationDeclHandler()
985 xml_parser *parser = XML_GetUserData(userData); in xml_externalEntityRefHandler() local
987 if (!parser || !ZEND_FCC_INITIALIZED(parser->externalEntityRefHandler)) { in xml_externalEntityRefHandler()
995 ZVAL_COPY(&args[0], &parser->index); in xml_externalEntityRefHandler()
996 xml_xmlchar_zval(openEntityNames, 0, parser->target_encoding, &args[1]); in xml_externalEntityRefHandler()
997 xml_xmlchar_zval(base, 0, parser->target_encoding, &args[2]); in xml_externalEntityRefHandler()
998 xml_xmlchar_zval(systemId, 0, parser->target_encoding, &args[3]); in xml_externalEntityRefHandler()
999 xml_xmlchar_zval(publicId, 0, parser->target_encoding, &args[4]); in xml_externalEntityRefHandler()
1001 …zend_call_known_fcc(&parser->externalEntityRefHandler, /* retval */ &retval, /* param_count */ 5, … in xml_externalEntityRefHandler()
1022 xml_parser *parser = (xml_parser *)userData; in xml_startNamespaceDeclHandler() local
1024 if (!parser || !ZEND_FCC_INITIALIZED(parser->startNamespaceDeclHandler)) { in xml_startNamespaceDeclHandler()
1030 ZVAL_COPY(&args[0], &parser->index); in xml_startNamespaceDeclHandler()
1031 xml_xmlchar_zval(prefix, 0, parser->target_encoding, &args[1]); in xml_startNamespaceDeclHandler()
1032 xml_xmlchar_zval(uri, 0, parser->target_encoding, &args[2]); in xml_startNamespaceDeclHandler()
1034 …zend_call_known_fcc(&parser->startNamespaceDeclHandler, /* retval */ NULL, /* param_count */ 3, ar… in xml_startNamespaceDeclHandler()
1044 xml_parser *parser = (xml_parser *)userData; in xml_endNamespaceDeclHandler() local
1046 if (!parser || !ZEND_FCC_INITIALIZED(parser->endNamespaceDeclHandler)) { in xml_endNamespaceDeclHandler()
1052 ZVAL_COPY(&args[0], &parser->index); in xml_endNamespaceDeclHandler()
1053 xml_xmlchar_zval(prefix, 0, parser->target_encoding, &args[1]); in xml_endNamespaceDeclHandler()
1055 …zend_call_known_fcc(&parser->endNamespaceDeclHandler, /* retval */ NULL, /* param_count */ 2, args… in xml_endNamespaceDeclHandler()
1065 xml_parser *parser; in php_xml_parser_create_impl() local
1105 parser = Z_XMLPARSER_P(return_value); in php_xml_parser_create_impl()
1106 parser->parser = XML_ParserCreate_MM((auto_detect ? NULL : encoding), in php_xml_parser_create_impl()
1109 parser->target_encoding = encoding; in php_xml_parser_create_impl()
1110 parser->case_folding = 1; in php_xml_parser_create_impl()
1111 parser->isparsing = 0; in php_xml_parser_create_impl()
1112 parser->parsehuge = false; /* It's the default for BC & DoS protection */ in php_xml_parser_create_impl()
1114 XML_SetUserData(parser->parser, parser); in php_xml_parser_create_impl()
1115 ZVAL_COPY_VALUE(&parser->index, return_value); in php_xml_parser_create_impl()
1192 xml_parser *parser; in PHP_FUNCTION() local
1200 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1203 if (parser->object) { in PHP_FUNCTION()
1204 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, startElementHandler, "xml_set_element_handler()"); in PHP_FUNCTION()
1205 PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, endElementHandler, "xml_set_element_handler()"); in PHP_FUNCTION()
1206 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, characterDataHandler, "xml_set_character_data_han… in PHP_FUNCTION()
1207 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, processingInstructionHandler, "xml_set_processing… in PHP_FUNCTION()
1208 PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, defaultHandler, "xml_set_default_handler()"); in PHP_FUNCTION()
1209 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, unparsedEntityDeclHandler, "xml_set_unparsed_enti… in PHP_FUNCTION()
1210 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, notationDeclHandler, "xml_set_notation_decl_handl… in PHP_FUNCTION()
1211 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, externalEntityRefHandler, "xml_set_external_entit… in PHP_FUNCTION()
1212 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, startNamespaceDeclHandler, "xml_set_start_namespa… in PHP_FUNCTION()
1213 …PHP_XML_CHECK_NEW_THIS_METHODS(parser, new_this, endNamespaceDeclHandler, "xml_set_end_namespace_d… in PHP_FUNCTION()
1215 OBJ_RELEASE(parser->object); in PHP_FUNCTION()
1218 parser->object = new_this; in PHP_FUNCTION()
1219 GC_ADDREF(parser->object); in PHP_FUNCTION()
1228 xml_parser *parser; in PHP_FUNCTION() local
1238 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1245 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1254 bool status = php_xml_check_string_method_arg(3, parser->object, end_method_name, &end_fcc); in PHP_FUNCTION()
1261 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1270 bool status = php_xml_check_string_method_arg(2, parser->object, start_method_name, &start_fcc); in PHP_FUNCTION()
1285 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1287 bool status = php_xml_check_string_method_arg(2, parser->object, start_method_name, &start_fcc); in PHP_FUNCTION()
1291 status = php_xml_check_string_method_arg(3, parser->object, end_method_name, &end_fcc); in PHP_FUNCTION()
1318 xml_set_handler(&parser->startElementHandler, &start_fcc); in PHP_FUNCTION()
1319 xml_set_handler(&parser->endElementHandler, &end_fcc); in PHP_FUNCTION()
1320 XML_SetElementHandler(parser->parser, xml_startElementHandler, xml_endElementHandler); in PHP_FUNCTION()
1328 xml_parser **const parser, in php_xml_set_handler_parse_callable() argument
1337 *parser = Z_XMLPARSER_P(pind); in php_xml_set_handler_parse_callable()
1344 *parser = Z_XMLPARSER_P(pind); in php_xml_set_handler_parse_callable()
1349 …bool status = php_xml_check_string_method_arg(2, (*parser)->object, method_name, parser_handler_fc… in php_xml_set_handler_parse_callable()
1366 xml_parser *parser = NULL; \
1368 php_xml_set_handler_parse_callable(INTERNAL_FUNCTION_PARAM_PASSTHRU, &parser, &handler_fcc); \
1370 ZEND_ASSERT(parser); \
1371 xml_set_handler(&parser->parser_handler_name, &handler_fcc); \
1372 parse_function(parser->parser, c_function); \
1388 xml_parser *parser; in PHP_FUNCTION() local
1398 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1399 if (parser->isparsing) { in PHP_FUNCTION()
1403 RETURN_LONG(xml_parse_helper(parser, data, data_len, isFinal)); in PHP_FUNCTION()
1411 xml_parser *parser; in PHP_FUNCTION() local
1420 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1422 if (parser->isparsing) { in PHP_FUNCTION()
1437 zval_ptr_dtor(&parser->data); in PHP_FUNCTION()
1438 ZVAL_COPY(&parser->data, xdata); in PHP_FUNCTION()
1441 zval_ptr_dtor(&parser->info); in PHP_FUNCTION()
1442 ZVAL_COPY(&parser->info, info); in PHP_FUNCTION()
1445 parser->level = 0; in PHP_FUNCTION()
1446 xml_parser_free_ltags(parser); in PHP_FUNCTION()
1447 parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); in PHP_FUNCTION()
1448 memset(parser->ltags, 0, XML_MAXLEVEL * sizeof(char *)); in PHP_FUNCTION()
1450 XML_SetElementHandler(parser->parser, xml_startElementHandler, xml_endElementHandler); in PHP_FUNCTION()
1451 XML_SetCharacterDataHandler(parser->parser, xml_characterDataHandler); in PHP_FUNCTION()
1453 RETURN_LONG(xml_parse_helper(parser, data, data_len, true)); in PHP_FUNCTION()
1460 xml_parser *parser; in PHP_FUNCTION() local
1467 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1468 RETURN_LONG((zend_long)XML_GetErrorCode(parser->parser)); in PHP_FUNCTION()
1492 xml_parser *parser; in PHP_FUNCTION() local
1499 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1500 RETVAL_LONG(XML_GetCurrentLineNumber(parser->parser)); in PHP_FUNCTION()
1507 xml_parser *parser; in PHP_FUNCTION() local
1514 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1515 RETVAL_LONG(XML_GetCurrentColumnNumber(parser->parser)); in PHP_FUNCTION()
1522 xml_parser *parser; in PHP_FUNCTION() local
1529 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1530 RETVAL_LONG(XML_GetCurrentByteIndex(parser->parser)); in PHP_FUNCTION()
1538 xml_parser *parser; in PHP_FUNCTION() local
1544 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1545 if (parser->isparsing == 1) { in PHP_FUNCTION()
1557 xml_parser *parser; in PHP_FUNCTION() local
1572 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1576 parser->case_folding = zend_is_true(value); in PHP_FUNCTION()
1580 parser->skipwhite = zend_is_true(value); in PHP_FUNCTION()
1585 if (UNEXPECTED(parser->isparsing)) { in PHP_FUNCTION()
1589 parser->parsehuge = zend_is_true(value); in PHP_FUNCTION()
1602 parser->toffset = (int) value_long; in PHP_FUNCTION()
1618 parser->target_encoding = enc->name; in PHP_FUNCTION()
1634 xml_parser *parser; in PHP_FUNCTION() local
1642 parser = Z_XMLPARSER_P(pind); in PHP_FUNCTION()
1645 RETURN_BOOL(parser->case_folding); in PHP_FUNCTION()
1648 RETURN_LONG(parser->toffset); in PHP_FUNCTION()
1651 RETURN_BOOL(parser->skipwhite); in PHP_FUNCTION()
1654 RETURN_BOOL(parser->parsehuge); in PHP_FUNCTION()
1657 RETURN_STRING((char *)parser->target_encoding); in PHP_FUNCTION()