From 177e968e112ea8030065d5d7a4907bcaefa9b085 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 15 Jul 2015 10:55:05 +0200 Subject: [PATCH] provide RTLD_LAZY compatibility --- php_raphf.c | 13 +++++++++++++ php_raphf.h | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/php_raphf.c b/php_raphf.c index 3f27ab3..f867af6 100644 --- a/php_raphf.c +++ b/php_raphf.c @@ -115,6 +115,19 @@ void php_resource_factory_handle_dtor(php_resource_factory_t *f, void *handle) } } +php_resource_factory_t *php_persistent_handle_resource_factory_init( + php_resource_factory_t *a, php_persistent_handle_factory_t *pf) +{ + return php_resource_factory_init(a, + php_persistent_handle_get_resource_factory_ops(), pf, + (void(*)(void*)) php_persistent_handle_abandon); +} + +zend_bool php_resource_factory_is_persistent(php_resource_factory_t *a) +{ + return a->dtor == (void(*)(void *)) php_persistent_handle_abandon; +} + static inline php_persistent_handle_list_t *php_persistent_handle_list_init( php_persistent_handle_list_t *list) { diff --git a/php_raphf.h b/php_raphf.h index 9df45aa..c5e4f35 100644 --- a/php_raphf.h +++ b/php_raphf.h @@ -360,6 +360,13 @@ PHP_RAPHF_API void *php_persistent_handle_accrete( PHP_RAPHF_API php_resource_factory_ops_t * php_persistent_handle_get_resource_factory_ops(void); +PHP_RAPHF_API php_resource_factory_t * +php_persistent_handle_resource_factory_init(php_resource_factory_t *a, + php_persistent_handle_factory_t *pf); + +PHP_RAPHF_API zend_bool php_resource_factory_is_persistent( + php_resource_factory_t *a); + /** * Clean persistent handles up. * -- 2.30.2