Skip to content

Commit 47b8e57

Browse files
committed
uri: Export the individual object handlers
1 parent 965308c commit 47b8e57

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

ext/uri/php_uri.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ PHP_METHOD(Uri_WhatWg_Url, __debugInfo)
950950
RETURN_ARR(uri_get_debug_properties(object));
951951
}
952952

953-
static uri_object_t *uri_create_object_handler(zend_class_entry *class_type, const uri_parser_t *parser)
953+
PHPAPI uri_object_t *php_uri_object_create(zend_class_entry *class_type, const uri_parser_t *parser)
954954
{
955955
uri_object_t *uri_object = zend_object_alloc(sizeof(*uri_object), class_type);
956956

@@ -965,17 +965,17 @@ static uri_object_t *uri_create_object_handler(zend_class_entry *class_type, con
965965
return uri_object;
966966
}
967967

968-
static zend_object *uri_create_object_handler_rfc3986(zend_class_entry *ce)
968+
static zend_object *php_uri_object_create_rfc3986(zend_class_entry *ce)
969969
{
970-
return &uri_create_object_handler(ce, &php_uri_parser_rfc3986)->std;
970+
return &php_uri_object_create(ce, &php_uri_parser_rfc3986)->std;
971971
}
972972

973-
static zend_object *uri_create_object_handler_whatwg(zend_class_entry *ce)
973+
static zend_object *php_uri_object_create_whatwg(zend_class_entry *ce)
974974
{
975-
return &uri_create_object_handler(ce, &php_uri_parser_whatwg)->std;
975+
return &php_uri_object_create(ce, &php_uri_parser_whatwg)->std;
976976
}
977977

978-
static void uri_free_obj_handler(zend_object *object)
978+
PHPAPI void php_uri_object_handler_free(zend_object *object)
979979
{
980980
uri_object_t *uri_object = uri_object_from_obj(object);
981981

@@ -988,7 +988,7 @@ static void uri_free_obj_handler(zend_object *object)
988988
zend_object_std_dtor(&uri_object->std);
989989
}
990990

991-
static zend_object *uri_clone_obj_handler(zend_object *object)
991+
PHPAPI zend_object *php_uri_object_handler_clone(zend_object *object)
992992
{
993993
uri_object_t *uri_object = uri_object_from_obj(object);
994994
uri_internal_t *internal_uri = uri_internal_from_obj(object);
@@ -1028,20 +1028,20 @@ PHPAPI zend_result php_uri_parser_register(const uri_parser_t *uri_parser)
10281028
static PHP_MINIT_FUNCTION(uri)
10291029
{
10301030
uri_rfc3986_uri_ce = register_class_Uri_Rfc3986_Uri();
1031-
uri_rfc3986_uri_ce->create_object = uri_create_object_handler_rfc3986;
1031+
uri_rfc3986_uri_ce->create_object = php_uri_object_create_rfc3986;
10321032
uri_rfc3986_uri_ce->default_object_handlers = &uri_rfc3986_uri_object_handlers;
10331033
memcpy(&uri_rfc3986_uri_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
10341034
uri_rfc3986_uri_object_handlers.offset = XtOffsetOf(uri_object_t, std);
1035-
uri_rfc3986_uri_object_handlers.free_obj = uri_free_obj_handler;
1036-
uri_rfc3986_uri_object_handlers.clone_obj = uri_clone_obj_handler;
1035+
uri_rfc3986_uri_object_handlers.free_obj = php_uri_object_handler_free;
1036+
uri_rfc3986_uri_object_handlers.clone_obj = php_uri_object_handler_clone;
10371037

10381038
uri_whatwg_url_ce = register_class_Uri_WhatWg_Url();
1039-
uri_whatwg_url_ce->create_object = uri_create_object_handler_whatwg;
1039+
uri_whatwg_url_ce->create_object = php_uri_object_create_whatwg;
10401040
uri_whatwg_url_ce->default_object_handlers = &uri_whatwg_uri_object_handlers;
10411041
memcpy(&uri_whatwg_uri_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
10421042
uri_whatwg_uri_object_handlers.offset = XtOffsetOf(uri_object_t, std);
1043-
uri_whatwg_uri_object_handlers.free_obj = uri_free_obj_handler;
1044-
uri_whatwg_uri_object_handlers.clone_obj = uri_clone_obj_handler;
1043+
uri_whatwg_uri_object_handlers.free_obj = php_uri_object_handler_free;
1044+
uri_whatwg_uri_object_handlers.clone_obj = php_uri_object_handler_clone;
10451045

10461046
uri_comparison_mode_ce = register_class_Uri_UriComparisonMode();
10471047
uri_exception_ce = register_class_Uri_UriException(zend_ce_exception);

ext/uri/php_uri_common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ static inline uri_internal_t *uri_internal_from_obj(const zend_object *object) {
159159
#define Z_URI_OBJECT_P(zv) uri_object_from_obj(Z_OBJ_P((zv)))
160160
#define Z_URI_INTERNAL_P(zv) uri_internal_from_obj(Z_OBJ_P((zv)))
161161

162+
PHPAPI uri_object_t *php_uri_object_create(zend_class_entry *class_type, const uri_parser_t *parser);
163+
PHPAPI void php_uri_object_handler_free(zend_object *object);
164+
PHPAPI zend_object *php_uri_object_handler_clone(zend_object *object);
165+
162166
#define PHP_URI_PARSER_RFC3986 "Uri\\Rfc3986\\Uri"
163167
#define PHP_URI_PARSER_WHATWG "Uri\\WhatWg\\Url"
164168
#define PHP_URI_PARSER_PHP_PARSE_URL "parse_url"

0 commit comments

Comments
 (0)