49
49
#include "libxml_arginfo.h"
50
50
51
51
/* a true global for initialization */
52
- static int _php_libxml_initialized = 0 ;
53
- static int _php_libxml_per_request_initialization = 1 ;
54
- static xmlExternalEntityLoader _php_libxml_default_entity_loader ;
52
+ static int php_libxml_initialized = 0 ;
53
+ static int php_libxml_per_request_initialization = 1 ;
54
+ static xmlExternalEntityLoader php_libxml_default_entity_loader ;
55
55
56
- typedef struct _php_libxml_func_handler {
56
+ typedef struct php_libxml_func_handler {
57
57
php_libxml_export_node export_func ;
58
58
} php_libxml_func_handler ;
59
59
@@ -601,16 +601,16 @@ php_libxml_output_buffer_create_filename(const char *URI,
601
601
return (ret );
602
602
}
603
603
604
- static void _php_libxml_free_error (void * ptr )
604
+ static void php_libxml_free_error (void * ptr )
605
605
{
606
606
/* This will free the libxml alloc'd memory */
607
607
xmlResetError ((xmlErrorPtr ) ptr );
608
608
}
609
609
610
610
#if LIBXML_VERSION >= 21200
611
- static void _php_list_set_error_structure (const xmlError * error , const char * msg , int line , int column )
611
+ static void php_list_set_error_structure (const xmlError * error , const char * msg , int line , int column )
612
612
#else
613
- static void _php_list_set_error_structure (xmlError * error , const char * msg , int line , int column )
613
+ static void php_list_set_error_structure (xmlError * error , const char * msg , int line , int column )
614
614
#endif
615
615
{
616
616
xmlError error_copy ;
@@ -655,7 +655,7 @@ static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg, in
655
655
void php_libxml_issue_error (int level , const char * msg )
656
656
{
657
657
if (LIBXML (error_list )) {
658
- _php_list_set_error_structure (NULL , msg , 0 , 0 );
658
+ php_list_set_error_structure (NULL , msg , 0 , 0 );
659
659
} else {
660
660
php_error_docref (NULL , level , "%s" , msg );
661
661
}
@@ -681,7 +681,7 @@ static void php_libxml_internal_error_handler_ex(php_libxml_error_level error_ty
681
681
682
682
if (output ) {
683
683
if (LIBXML (error_list )) {
684
- _php_list_set_error_structure (NULL , ZSTR_VAL (LIBXML (error_buffer ).s ), line , column );
684
+ php_list_set_error_structure (NULL , ZSTR_VAL (LIBXML (error_buffer ).s ), line , column );
685
685
} else if (!EG (exception )) {
686
686
/* Don't throw additional notices/warnings if an exception has already been thrown. */
687
687
switch (error_type ) {
@@ -712,7 +712,7 @@ PHP_LIBXML_API void php_libxml_error_handler_va(php_libxml_error_level error_typ
712
712
php_libxml_internal_error_handler_ex (error_type , ctx , msg , ap , line , column );
713
713
}
714
714
715
- static xmlParserInputPtr _php_libxml_external_entity_loader (const char * URL ,
715
+ static xmlParserInputPtr php_libxml_external_entity_loader (const char * URL ,
716
716
const char * ID , xmlParserCtxtPtr context )
717
717
{
718
718
xmlParserInputPtr ret = NULL ;
@@ -722,7 +722,7 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
722
722
723
723
/* no custom user-land callback set up; delegate to original loader */
724
724
if (!ZEND_FCC_INITIALIZED (LIBXML (entity_loader_callback ))) {
725
- return _php_libxml_default_entity_loader (URL , ID , context );
725
+ return php_libxml_default_entity_loader (URL , ID , context );
726
726
}
727
727
728
728
if (ID != NULL ) {
@@ -821,7 +821,7 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
821
821
return ret ;
822
822
}
823
823
824
- static xmlParserInputPtr _php_libxml_pre_ext_ent_loader (const char * URL ,
824
+ static xmlParserInputPtr php_libxml_pre_ext_ent_loader (const char * URL ,
825
825
const char * ID , xmlParserCtxtPtr context )
826
826
{
827
827
@@ -833,11 +833,11 @@ static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL,
833
833
* we don't even have a resource list by then), but then whether one
834
834
* extension would be using the custom external entity loader or not
835
835
* could depend on extension loading order
836
- * (if _php_libxml_per_request_initialization */
836
+ * (if php_libxml_per_request_initialization */
837
837
if (xmlGenericError == php_libxml_error_handler && PG (modules_activated )) {
838
- return _php_libxml_external_entity_loader (URL , ID , context );
838
+ return php_libxml_external_entity_loader (URL , ID , context );
839
839
} else {
840
- return _php_libxml_default_entity_loader (URL , ID , context );
840
+ return php_libxml_default_entity_loader (URL , ID , context );
841
841
}
842
842
}
843
843
@@ -879,7 +879,7 @@ static void php_libxml_structured_error_handler(void *userData, const xmlError *
879
879
static void php_libxml_structured_error_handler (void * userData , xmlErrorPtr error )
880
880
#endif
881
881
{
882
- _php_list_set_error_structure (error , NULL , 0 , 0 );
882
+ php_list_set_error_structure (error , NULL , 0 , 0 );
883
883
}
884
884
885
885
PHP_LIBXML_API void php_libxml_error_handler (void * ctx , const char * msg , ...)
@@ -897,32 +897,32 @@ static void php_libxml_exports_dtor(zval *zv)
897
897
898
898
PHP_LIBXML_API void php_libxml_initialize (void )
899
899
{
900
- if (!_php_libxml_initialized ) {
900
+ if (!php_libxml_initialized ) {
901
901
/* we should be the only one's to ever init!! */
902
902
ZEND_IGNORE_LEAKS_BEGIN ();
903
903
xmlInitParser ();
904
904
ZEND_IGNORE_LEAKS_END ();
905
905
906
- _php_libxml_default_entity_loader = xmlGetExternalEntityLoader ();
907
- xmlSetExternalEntityLoader (_php_libxml_pre_ext_ent_loader );
906
+ php_libxml_default_entity_loader = xmlGetExternalEntityLoader ();
907
+ xmlSetExternalEntityLoader (php_libxml_pre_ext_ent_loader );
908
908
909
909
zend_hash_init (& php_libxml_exports , 0 , NULL , php_libxml_exports_dtor , 1 );
910
910
911
- _php_libxml_initialized = 1 ;
911
+ php_libxml_initialized = 1 ;
912
912
}
913
913
}
914
914
915
915
PHP_LIBXML_API void php_libxml_shutdown (void )
916
916
{
917
- if (_php_libxml_initialized ) {
917
+ if (php_libxml_initialized ) {
918
918
#if defined(LIBXML_SCHEMAS_ENABLED ) && LIBXML_VERSION < 21000
919
919
xmlRelaxNGCleanupTypes ();
920
920
#endif
921
921
/* xmlCleanupParser(); */
922
922
zend_hash_destroy (& php_libxml_exports );
923
923
924
- xmlSetExternalEntityLoader (_php_libxml_default_entity_loader );
925
- _php_libxml_initialized = 0 ;
924
+ xmlSetExternalEntityLoader (php_libxml_default_entity_loader );
925
+ php_libxml_initialized = 0 ;
926
926
}
927
927
}
928
928
@@ -954,13 +954,13 @@ static PHP_MINIT_FUNCTION(libxml)
954
954
955
955
for (sapi_name = supported_sapis ; * sapi_name ; sapi_name ++ ) {
956
956
if (strcmp (sapi_module .name , * sapi_name ) == 0 ) {
957
- _php_libxml_per_request_initialization = 0 ;
957
+ php_libxml_per_request_initialization = 0 ;
958
958
break ;
959
959
}
960
960
}
961
961
}
962
962
963
- if (!_php_libxml_per_request_initialization ) {
963
+ if (!php_libxml_per_request_initialization ) {
964
964
/* report errors via handler rather than stderr */
965
965
xmlSetGenericErrorFunc (NULL , php_libxml_error_handler );
966
966
xmlParserInputBufferCreateFilenameDefault (php_libxml_input_buffer_create_filename );
@@ -973,7 +973,7 @@ static PHP_MINIT_FUNCTION(libxml)
973
973
974
974
static PHP_RINIT_FUNCTION (libxml )
975
975
{
976
- if (_php_libxml_per_request_initialization ) {
976
+ if (php_libxml_per_request_initialization ) {
977
977
/* report errors via handler rather than stderr */
978
978
xmlSetGenericErrorFunc (NULL , php_libxml_error_handler );
979
979
xmlParserInputBufferCreateFilenameDefault (php_libxml_input_buffer_create_filename );
@@ -1000,7 +1000,7 @@ static PHP_RSHUTDOWN_FUNCTION(libxml)
1000
1000
1001
1001
static PHP_MSHUTDOWN_FUNCTION (libxml )
1002
1002
{
1003
- if (!_php_libxml_per_request_initialization ) {
1003
+ if (!php_libxml_per_request_initialization ) {
1004
1004
xmlSetGenericErrorFunc (NULL , NULL );
1005
1005
1006
1006
xmlParserInputBufferCreateFilenameDefault (NULL );
@@ -1014,7 +1014,7 @@ static PHP_MSHUTDOWN_FUNCTION(libxml)
1014
1014
static zend_result php_libxml_post_deactivate (void )
1015
1015
{
1016
1016
/* reset libxml generic error handling */
1017
- if (_php_libxml_per_request_initialization ) {
1017
+ if (php_libxml_per_request_initialization ) {
1018
1018
xmlSetGenericErrorFunc (NULL , NULL );
1019
1019
1020
1020
xmlParserInputBufferCreateFilenameDefault (NULL );
@@ -1097,7 +1097,7 @@ PHP_FUNCTION(libxml_use_internal_errors)
1097
1097
xmlSetStructuredErrorFunc (NULL , php_libxml_structured_error_handler );
1098
1098
if (LIBXML (error_list ) == NULL ) {
1099
1099
LIBXML (error_list ) = (zend_llist * ) emalloc (sizeof (zend_llist ));
1100
- zend_llist_init (LIBXML (error_list ), sizeof (xmlError ), _php_libxml_free_error , 0 );
1100
+ zend_llist_init (LIBXML (error_list ), sizeof (xmlError ), php_libxml_free_error , 0 );
1101
1101
}
1102
1102
}
1103
1103
RETURN_BOOL (retval );
0 commit comments