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 ;
52
+ static bool php_libxml_initialized = false ;
53
+ static bool php_libxml_per_request_initialization = true ;
54
54
static xmlExternalEntityLoader php_libxml_default_entity_loader ;
55
55
56
56
typedef struct php_libxml_func_handler {
@@ -404,7 +404,7 @@ PHP_LIBXML_API php_stream_context *php_libxml_get_stream_context(void)
404
404
/* Channel libxml file io layer through the PHP streams subsystem.
405
405
* This allows use of ftps:// and https:// urls */
406
406
407
- static void * php_libxml_streams_IO_open_wrapper (const char * filename , const char * mode , const int read_only )
407
+ static void * php_libxml_streams_IO_open_wrapper (const char * filename , const char * mode , const bool read_only )
408
408
{
409
409
php_stream_statbuf ssbuf ;
410
410
char * resolved_path ;
@@ -480,12 +480,12 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
480
480
481
481
static void * php_libxml_streams_IO_open_read_wrapper (const char * filename )
482
482
{
483
- return php_libxml_streams_IO_open_wrapper (filename , "rb" , 1 );
483
+ return php_libxml_streams_IO_open_wrapper (filename , "rb" , true );
484
484
}
485
485
486
486
static void * php_libxml_streams_IO_open_write_wrapper (const char * filename )
487
487
{
488
- return php_libxml_streams_IO_open_wrapper (filename , "wb" , 0 );
488
+ return php_libxml_streams_IO_open_wrapper (filename , "wb" , false );
489
489
}
490
490
491
491
static int php_libxml_streams_IO_read (void * context , char * buffer , int len )
@@ -916,7 +916,7 @@ PHP_LIBXML_API void php_libxml_initialize(void)
916
916
917
917
zend_hash_init (& php_libxml_exports , 0 , NULL , php_libxml_exports_dtor , 1 );
918
918
919
- php_libxml_initialized = 1 ;
919
+ php_libxml_initialized = true ;
920
920
}
921
921
}
922
922
@@ -930,7 +930,7 @@ PHP_LIBXML_API void php_libxml_shutdown(void)
930
930
zend_hash_destroy (& php_libxml_exports );
931
931
932
932
xmlSetExternalEntityLoader (php_libxml_default_entity_loader );
933
- php_libxml_initialized = 0 ;
933
+ php_libxml_initialized = false ;
934
934
}
935
935
}
936
936
@@ -962,7 +962,7 @@ static PHP_MINIT_FUNCTION(libxml)
962
962
963
963
for (sapi_name = supported_sapis ; * sapi_name ; sapi_name ++ ) {
964
964
if (strcmp (sapi_module .name , * sapi_name ) == 0 ) {
965
- php_libxml_per_request_initialization = 0 ;
965
+ php_libxml_per_request_initialization = false ;
966
966
break ;
967
967
}
968
968
}
@@ -1242,7 +1242,7 @@ PHP_FUNCTION(libxml_get_external_entity_loader)
1242
1242
/* }}} */
1243
1243
1244
1244
/* {{{ Common functions shared by extensions */
1245
- int php_libxml_xmlCheckUTF8 (const unsigned char * s )
1245
+ bool php_libxml_xmlCheckUTF8 (const unsigned char * s )
1246
1246
{
1247
1247
size_t i ;
1248
1248
unsigned char c ;
@@ -1251,21 +1251,21 @@ int php_libxml_xmlCheckUTF8(const unsigned char *s)
1251
1251
if ((c & 0x80 ) == 0 ) {
1252
1252
} else if ((c & 0xe0 ) == 0xc0 ) {
1253
1253
if ((s [i ++ ] & 0xc0 ) != 0x80 ) {
1254
- return 0 ;
1254
+ return false ;
1255
1255
}
1256
1256
} else if ((c & 0xf0 ) == 0xe0 ) {
1257
1257
if ((s [i ++ ] & 0xc0 ) != 0x80 || (s [i ++ ] & 0xc0 ) != 0x80 ) {
1258
- return 0 ;
1258
+ return false ;
1259
1259
}
1260
1260
} else if ((c & 0xf8 ) == 0xf0 ) {
1261
1261
if ((s [i ++ ] & 0xc0 ) != 0x80 || (s [i ++ ] & 0xc0 ) != 0x80 || (s [i ++ ] & 0xc0 ) != 0x80 ) {
1262
- return 0 ;
1262
+ return false ;
1263
1263
}
1264
1264
} else {
1265
- return 0 ;
1265
+ return false ;
1266
1266
}
1267
1267
}
1268
- return 1 ;
1268
+ return true ;
1269
1269
}
1270
1270
1271
1271
zval * php_libxml_register_export (const zend_class_entry * ce , php_libxml_export_node export_function )
0 commit comments