mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Rename php_uri_parser free to destroy (#19888)
This is to fix Windows debug build when it is macro for _free_dbg
This commit is contained in:
@@ -167,7 +167,7 @@ ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_uri_get_fragment(const uri_interna
|
||||
|
||||
ZEND_ATTRIBUTE_NONNULL PHPAPI void php_uri_free(uri_internal_t *internal_uri)
|
||||
{
|
||||
internal_uri->parser->free(internal_uri->uri);
|
||||
internal_uri->parser->destroy(internal_uri->uri);
|
||||
internal_uri->uri = NULL;
|
||||
internal_uri->parser = NULL;
|
||||
efree(internal_uri);
|
||||
@@ -366,7 +366,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 2) PHPAPI void php_uri_instantiate_uri(
|
||||
}
|
||||
|
||||
if (pass_errors_by_ref_and_free(errors_zv, &errors) == FAILURE) {
|
||||
uri_parser->free(uri);
|
||||
uri_parser->destroy(uri);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
@@ -1045,7 +1045,7 @@ PHPAPI void php_uri_object_handler_free(zend_object *object)
|
||||
{
|
||||
uri_object_t *uri_object = uri_object_from_obj(object);
|
||||
|
||||
uri_object->internal.parser->free(uri_object->internal.uri);
|
||||
uri_object->internal.parser->destroy(uri_object->internal.uri);
|
||||
zend_object_std_dtor(&uri_object->std);
|
||||
}
|
||||
|
||||
@@ -1077,7 +1077,7 @@ PHPAPI zend_result php_uri_parser_register(const php_uri_parser *uri_parser)
|
||||
ZEND_ASSERT(uri_parser->parse != NULL);
|
||||
ZEND_ASSERT(uri_parser->clone != NULL || strcmp(uri_parser->name, PHP_URI_PARSER_PHP_PARSE_URL) == 0);
|
||||
ZEND_ASSERT(uri_parser->to_string != NULL || strcmp(uri_parser->name, PHP_URI_PARSER_PHP_PARSE_URL) == 0);
|
||||
ZEND_ASSERT(uri_parser->free != NULL);
|
||||
ZEND_ASSERT(uri_parser->destroy != NULL);
|
||||
|
||||
zend_result result = zend_hash_add_ptr(&uri_parsers, key, (void *) uri_parser) != NULL ? SUCCESS : FAILURE;
|
||||
|
||||
|
||||
@@ -119,11 +119,11 @@ typedef struct php_uri_parser {
|
||||
zend_string *(*to_string)(void *uri, php_uri_recomposition_mode recomposition_mode, bool exclude_fragment);
|
||||
|
||||
/**
|
||||
* Frees the provided URI.
|
||||
* Destroy (free) the provided URI.
|
||||
*
|
||||
* @param uri The URI to free. Must do nothing if NULL.
|
||||
*/
|
||||
void (*free)(void *uri);
|
||||
void (*destroy)(void *uri);
|
||||
|
||||
struct {
|
||||
php_uri_property_handler scheme;
|
||||
|
||||
@@ -154,7 +154,7 @@ static void *uri_parser_php_parse_url_parse(const char *uri_str, size_t uri_str_
|
||||
return url;
|
||||
}
|
||||
|
||||
static void uri_parser_php_parse_url_free(void *uri)
|
||||
static void uri_parser_php_parse_url_destroy(void *uri)
|
||||
{
|
||||
php_url *parse_url_uri = uri;
|
||||
|
||||
@@ -170,7 +170,7 @@ const php_uri_parser php_uri_parser_php_parse_url = {
|
||||
.parse = uri_parser_php_parse_url_parse,
|
||||
.clone = NULL,
|
||||
.to_string = NULL,
|
||||
.free = uri_parser_php_parse_url_free,
|
||||
.destroy = uri_parser_php_parse_url_destroy,
|
||||
{
|
||||
.scheme = {.read = uri_parser_php_parse_url_scheme_read, .write = NULL},
|
||||
.username = {.read = uri_parser_php_parse_url_username_read, .write = NULL},
|
||||
|
||||
@@ -40,7 +40,7 @@ static void *php_uri_parser_rfc3986_memory_manager_reallocarray(UriMemoryManager
|
||||
return safe_erealloc(ptr, nmemb, size, 0);
|
||||
}
|
||||
|
||||
static void php_uri_parser_rfc3986_memory_manager_free(UriMemoryManager *memory_manager, void *ptr)
|
||||
static void php_uri_parser_rfc3986_memory_manager_destroy(UriMemoryManager *memory_manager, void *ptr)
|
||||
{
|
||||
efree(ptr);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ static const UriMemoryManager php_uri_parser_rfc3986_memory_manager = {
|
||||
.calloc = php_uri_parser_rfc3986_memory_manager_calloc,
|
||||
.realloc = php_uri_parser_rfc3986_memory_manager_realloc,
|
||||
.reallocarray = php_uri_parser_rfc3986_memory_manager_reallocarray,
|
||||
.free = php_uri_parser_rfc3986_memory_manager_free,
|
||||
.free = php_uri_parser_rfc3986_memory_manager_destroy,
|
||||
.userData = NULL,
|
||||
};
|
||||
|
||||
@@ -593,7 +593,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_string *php_uri_parser_rfc3986_to_string(void
|
||||
return uri_string;
|
||||
}
|
||||
|
||||
static void php_uri_parser_rfc3986_free(void *uri)
|
||||
static void php_uri_parser_rfc3986_destroy(void *uri)
|
||||
{
|
||||
php_uri_parser_rfc3986_uris *uriparser_uris = uri;
|
||||
|
||||
@@ -612,7 +612,7 @@ const php_uri_parser php_uri_parser_rfc3986 = {
|
||||
.parse = php_uri_parser_rfc3986_parse,
|
||||
.clone = php_uri_parser_rfc3986_clone,
|
||||
.to_string = php_uri_parser_rfc3986_to_string,
|
||||
.free = php_uri_parser_rfc3986_free,
|
||||
.destroy = php_uri_parser_rfc3986_destroy,
|
||||
{
|
||||
.scheme = {.read = php_uri_parser_rfc3986_scheme_read, .write = php_uri_parser_rfc3986_scheme_write},
|
||||
.username = {.read = php_uri_parser_rfc3986_username_read, .write = NULL},
|
||||
|
||||
@@ -614,7 +614,7 @@ static zend_string *php_uri_parser_whatwg_to_string(void *uri, php_uri_recomposi
|
||||
return smart_str_extract(&uri_str);
|
||||
}
|
||||
|
||||
static void php_uri_parser_whatwg_free(void *uri)
|
||||
static void php_uri_parser_whatwg_destroy(void *uri)
|
||||
{
|
||||
lxb_url_t *lexbor_uri = uri;
|
||||
|
||||
@@ -626,7 +626,7 @@ const php_uri_parser php_uri_parser_whatwg = {
|
||||
.parse = php_uri_parser_whatwg_parse,
|
||||
.clone = php_uri_parser_whatwg_clone,
|
||||
.to_string = php_uri_parser_whatwg_to_string,
|
||||
.free = php_uri_parser_whatwg_free,
|
||||
.destroy = php_uri_parser_whatwg_destroy,
|
||||
{
|
||||
.scheme = {.read = php_uri_parser_whatwg_scheme_read, .write = php_uri_parser_whatwg_scheme_write},
|
||||
.username = {.read = php_uri_parser_whatwg_username_read, .write = php_uri_parser_whatwg_username_write},
|
||||
|
||||
Reference in New Issue
Block a user