X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php__raphf_8h_source.html;h=65d8b21d179ce6845da46bfa2c97bf641d913273;hb=7db0710f32e0c6faa5b61b868b27e6e92ad49825;hp=e3add35d163e6d77b985a277339b316d18741e8f;hpb=35969f40f26e580bb4750c8ba524f8dc56bda84d;p=m6w6%2Fext-raphf diff --git a/php__raphf_8h_source.html b/php__raphf_8h_source.html index e3add35..65d8b21 100644 --- a/php__raphf_8h_source.html +++ b/php__raphf_8h_source.html @@ -3,22 +3,24 @@ - + Resource and persistent handle factory API: php_raphf.h Source File + + @@ -39,7 +41,7 @@ - + @@ -92,7 +94,7 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');}); onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> - All Data Structures Files Functions Variables Typedefs +
@@ -119,48 +121,48 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');});
11 */
12 
13 #ifndef PHP_RAPHF_H
-
14 #define PHP_RAPHF_H
-
15 
+
14 #define PHP_RAPHF_H
+
15 
16 #ifndef DOXYGEN
-
17 
+
17 
18 extern zend_module_entry raphf_module_entry;
19 #define phpext_raphf_ptr &raphf_module_entry
-
20 
-
21 #define PHP_RAPHF_VERSION "1.0.4"
-
22 
+
20 
+
21 #define PHP_RAPHF_VERSION "1.1.0"
+
22 
23 #ifdef PHP_WIN32
-
24 # define PHP_RAPHF_API __declspec(dllexport)
-
25 #elif defined(__GNUC__) && __GNUC__ >= 4
-
26 # define PHP_RAPHF_API extern __attribute__ ((visibility("default")))
-
27 #else
-
28 # define PHP_RAPHF_API extern
-
29 #endif
-
30 
+
24 # define PHP_RAPHF_API __declspec(dllexport)
+
25 #elif defined(__GNUC__) && __GNUC__ >= 4
+
26 # define PHP_RAPHF_API extern __attribute__ ((visibility("default")))
+
27 #else
+
28 # define PHP_RAPHF_API extern
+
29 #endif
+
30 
31 #ifdef ZTS
-
32 # include "TSRM.h"
+
32 # include "TSRM.h"
33 #endif
-
34 
+
34 
35 #endif
-
36 
-
44 typedef void *(*php_resource_factory_handle_ctor_t)(void *opaque,
+
36 
+
44 typedef void *(*php_resource_factory_handle_ctor_t)(void *opaque,
45  void *init_arg TSRMLS_DC);
46 
-
53 typedef void *(*php_resource_factory_handle_copy_t)(void *opaque,
+
53 typedef void *(*php_resource_factory_handle_copy_t)(void *opaque,
54  void *handle TSRMLS_DC);
55 
-
62 typedef void (*php_resource_factory_handle_dtor_t)(void *opaque,
+
62 typedef void (*php_resource_factory_handle_dtor_t)(void *opaque,
63  void *handle TSRMLS_DC);
64 
71 typedef struct php_resource_factory_ops {
-
73  php_resource_factory_handle_ctor_t ctor;
-
75  php_resource_factory_handle_copy_t copy;
-
77  php_resource_factory_handle_dtor_t dtor;
+
73  php_resource_factory_handle_ctor_t ctor;
+
75  php_resource_factory_handle_copy_t copy;
+
77  php_resource_factory_handle_dtor_t dtor;
78 } php_resource_factory_ops_t;
79 
83 typedef struct php_resource_factory {
85  php_resource_factory_ops_t fops;
87  void *data;
-
89  void (*dtor)(void *data);
+
89  void (*dtor)(void *data);
91  unsigned refcount;
92 } php_resource_factory_t;
93 
@@ -196,15 +198,15 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');});
196 
197 typedef struct php_persistent_handle_factory php_persistent_handle_factory_t;
198 
-
202 typedef void (*php_persistent_handle_wakeup_t)(
+
202 typedef void (*php_persistent_handle_wakeup_t)(
203  php_persistent_handle_factory_t *f, void **handle TSRMLS_DC);
-
207 typedef void (*php_persistent_handle_retire_t)(
+
207 typedef void (*php_persistent_handle_retire_t)(
208  php_persistent_handle_factory_t *f, void **handle TSRMLS_DC);
209 
217 struct php_persistent_handle_factory {
219  php_persistent_handle_provider_t *provider;
-
221  php_persistent_handle_wakeup_t wakeup;
-
223  php_persistent_handle_retire_t retire;
+
221  php_persistent_handle_wakeup_t wakeup;
+
223  php_persistent_handle_retire_t retire;
224 
226  struct {
228  char *str;
@@ -221,8 +223,8 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');});
280 PHP_RAPHF_API php_persistent_handle_factory_t *php_persistent_handle_concede(
281  php_persistent_handle_factory_t *a, const char *name_str,
282  size_t name_len, const char *ident_str, size_t ident_len,
-
283  php_persistent_handle_wakeup_t wakeup,
-
284  php_persistent_handle_retire_t retire TSRMLS_DC);
+
283  php_persistent_handle_wakeup_t wakeup,
+
284  php_persistent_handle_retire_t retire TSRMLS_DC);
285 
295 PHP_RAPHF_API void php_persistent_handle_abandon(
296  php_persistent_handle_factory_t *a);
@@ -239,50 +241,60 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');});
373 PHP_RAPHF_API php_resource_factory_ops_t *
374 php_persistent_handle_get_resource_factory_ops(void);
375 
-
400 PHP_RAPHF_API void php_persistent_handle_cleanup(const char *name_str,
-
401  size_t name_len, const char *ident_str, size_t ident_len TSRMLS_DC);
-
402 
-
418 PHP_RAPHF_API HashTable *php_persistent_handle_statall(HashTable *ht TSRMLS_DC);
-
419 
-
420 #endif /* PHP_RAPHF_H */
-
421 
-
422 
-
423 /*
-
424  * Local variables:
-
425  * tab-width: 4
-
426  * c-basic-offset: 4
-
427  * End:
-
428  * vim600: noet sw=4 ts=4 fdm=marker
-
429  * vim<600: noet sw=4 ts=4
-
430  */
-
void(* php_persistent_handle_retire_t)(php_persistent_handle_factory_t *f, void **handle)
Retire the persistent handle on release.
Definition: php_raphf.h:207
+
385 PHP_RAPHF_API php_resource_factory_t *
+
386 php_persistent_handle_resource_factory_init(php_resource_factory_t *a,
+
387  php_persistent_handle_factory_t *pf);
+
388 
+
394 PHP_RAPHF_API zend_bool php_resource_factory_is_persistent(
+
395  php_resource_factory_t *a);
+
396 
+
421 PHP_RAPHF_API void php_persistent_handle_cleanup(const char *name_str,
+
422  size_t name_len, const char *ident_str, size_t ident_len TSRMLS_DC);
+
423 
+
439 PHP_RAPHF_API HashTable *php_persistent_handle_statall(HashTable *ht TSRMLS_DC);
+
440 
+
441 #endif /* PHP_RAPHF_H */
+
442 
+
443 
+
444 /*
+
445  * Local variables:
+
446  * tab-width: 4
+
447  * c-basic-offset: 4
+
448  * End:
+
449  * vim600: noet sw=4 ts=4 fdm=marker
+
450  * vim<600: noet sw=4 ts=4
+
451  */
+
void(* dtor)(void *data)
User data destructor.
Definition: php_raphf.h:89
void * data
Opaque user data.
Definition: php_raphf.h:87
-
php_resource_factory_handle_copy_t copy
The resource&#39;s copy constructor.
Definition: php_raphf.h:75
+
php_resource_factory_handle_copy_t copy
The resource's copy constructor.
Definition: php_raphf.h:75
ulong used
Count of acquired resources.
Definition: php_raphf.h:175
php_persistent_handle_list_t list
The list of free handles.
Definition: php_raphf.h:188
void php_resource_factory_free(php_resource_factory_t **f)
Destroy and free the resource factory.
-
php_resource_factory_handle_dtor_t dtor
The resource&#39;s destructor.
Definition: php_raphf.h:77
-
void(* dtor)(void *data)
User data destructor.
Definition: php_raphf.h:89
+
void(* php_persistent_handle_retire_t)(php_persistent_handle_factory_t *f, void **handle)
Retire the persistent handle on release.
Definition: php_raphf.h:207
+
void *(* php_resource_factory_handle_ctor_t)(void *opaque, void *init_arg)
A resource constructor.
Definition: php_raphf.h:44
+
php_resource_factory_handle_dtor_t dtor
The resource's destructor.
Definition: php_raphf.h:77
+
zend_bool php_resource_factory_is_persistent(php_resource_factory_t *a)
Check whether a resource factory is a persistent handle resource factory.
php_persistent_handle_factory_t * php_persistent_handle_concede(php_persistent_handle_factory_t *a, const char *name_str, size_t name_len, const char *ident_str, size_t ident_len, php_persistent_handle_wakeup_t wakeup, php_persistent_handle_retire_t retire)
Retrieve a persistent handle factory at runtime.
unsigned php_resource_factory_addref(php_resource_factory_t *rf)
Increase the refcount of the resource factory.
php_resource_factory_t * php_resource_factory_init(php_resource_factory_t *f, php_resource_factory_ops_t *fops, void *data, void(*dtor)(void *data))
Initialize a resource factory.
void php_persistent_handle_release(php_persistent_handle_factory_t *a, void *handle)
Release a persistent handle.
The resource ops consisting of a ctor, a copy ctor and a dtor.
Definition: php_raphf.h:71
-
void *(* php_resource_factory_handle_ctor_t)(void *opaque, void *init_arg)
A resource constructor.
Definition: php_raphf.h:44
-
void(* php_resource_factory_handle_dtor_t)(void *opaque, void *handle)
The destructor of a resource.
Definition: php_raphf.h:62
unsigned refcount
How often this factory is referenced.
Definition: php_raphf.h:91
void php_resource_factory_handle_dtor(php_resource_factory_t *f, void *handle)
Destroy (and free) the resource.
struct php_resource_factory_ops php_resource_factory_ops_t
The resource ops consisting of a ctor, a copy ctor and a dtor.
-
void(* php_persistent_handle_wakeup_t)(php_persistent_handle_factory_t *f, void **handle)
Wakeup the persistent handle on re-acquisition.
Definition: php_raphf.h:202
void php_resource_factory_dtor(php_resource_factory_t *f)
Destroy the resource factory.
+
void *(* php_resource_factory_handle_copy_t)(void *opaque, void *handle)
The copy constructor of a resource.
Definition: php_raphf.h:53
Persistent handles storage.
Definition: php_raphf.h:171
php_persistent_handle_retire_t retire
The persistent handle retire routine; may be NULL.
Definition: php_raphf.h:223
-
HashTable * php_persistent_handle_statall(HashTable *ht)
Retrieve statistics about the current process/thread&#39;s persistent handles.
+
HashTable * php_persistent_handle_statall(HashTable *ht)
Retrieve statistics about the current process/thread's persistent handles.
HashTable free
Storage of free resources.
Definition: php_raphf.h:173
Definition of a persistent handle factory.
Definition: php_raphf.h:217
+
void(* php_resource_factory_handle_dtor_t)(void *opaque, void *handle)
The destructor of a resource.
Definition: php_raphf.h:62
+
php_resource_factory_t * php_persistent_handle_resource_factory_init(php_resource_factory_t *a, php_persistent_handle_factory_t *pf)
Create a resource factory for persistent handles.
Definition of a persistent handle provider.
Definition: php_raphf.h:182
struct php_resource_factory php_resource_factory_t
The resource factory.
php_persistent_handle_provider_t * provider
The persistent handle provider.
Definition: php_raphf.h:219
+
void(* php_persistent_handle_wakeup_t)(php_persistent_handle_factory_t *f, void **handle)
Wakeup the persistent handle on re-acquisition.
Definition: php_raphf.h:202
void * php_resource_factory_handle_copy(php_resource_factory_t *f, void *handle)
Create a copy of the resource handle.
php_resource_factory_t rf
The resource factory.
Definition: php_raphf.h:194
void * php_persistent_handle_accrete(php_persistent_handle_factory_t *a, void *handle)
Copy a persistent handle.
@@ -291,13 +303,12 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');});
void * php_persistent_handle_acquire(php_persistent_handle_factory_t *a, void *init_arg)
Acquire a persistent handle.
void * php_resource_factory_handle_ctor(php_resource_factory_t *f, void *init_arg)
Construct a resource by the resource factory f.
The resource factory.
Definition: php_raphf.h:83
-
void *(* php_resource_factory_handle_copy_t)(void *opaque, void *handle)
The copy constructor of a resource.
Definition: php_raphf.h:53
php_resource_factory_ops_t * php_persistent_handle_get_resource_factory_ops(void)
Retrieve persistent handle resource factory ops.
struct php_persistent_handle_list php_persistent_handle_list_t
Persistent handles storage.
void php_persistent_handle_cleanup(const char *name_str, size_t name_len, const char *ident_str, size_t ident_len)
Clean persistent handles up.
int php_persistent_handle_provide(const char *name_str, size_t name_len, php_resource_factory_ops_t *fops, void *data, void(*dtor)(void *))
Register a persistent handle provider in MINIT.
void php_persistent_handle_abandon(php_persistent_handle_factory_t *a)
Abandon the persistent handle factory.
-
unsigned free_on_abandon
Whether it has to be free&#39;d on php_persistent_handle_abandon()
Definition: php_raphf.h:234
+
unsigned free_on_abandon
Whether it has to be free'd on php_persistent_handle_abandon()
Definition: php_raphf.h:234
php_resource_factory_ops_t fops
The resource ops.
Definition: php_raphf.h:85
struct php_persistent_handle_factory::@0 ident
The ident for which this factory manages resources.
php_persistent_handle_wakeup_t wakeup
The persistent handle wakeup routine; may be NULL.
Definition: php_raphf.h:221
@@ -309,7 +320,7 @@ $(document).ready(function(){initNavTree('php__raphf_8h_source.html','');}); + doxygen 1.8.9.1