less intrusive fix
[m6w6/ext-http] / php_http_resource_factory.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2011, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 #ifndef PHP_HTTP_RESOURCE_FACTORY_H
14 #define PHP_HTTP_RESOURCE_FACTORY_H
15
16 typedef void *(*php_http_resource_factory_handle_ctor_t)(void *opaque TSRMLS_DC);
17 typedef void *(*php_http_resource_factory_handle_copy_t)(void *opaque, void *handle TSRMLS_DC);
18 typedef void (*php_http_resource_factory_handle_dtor_t)(void *opaque, void *handle TSRMLS_DC);
19
20 typedef struct php_http_resource_factory_ops {
21 php_http_resource_factory_handle_ctor_t ctor;
22 php_http_resource_factory_handle_copy_t copy;
23 php_http_resource_factory_handle_dtor_t dtor;
24 } php_http_resource_factory_ops_t;
25
26 typedef struct php_http_resource_factory {
27 php_http_resource_factory_ops_t fops;
28
29 void *data;
30 void (*dtor)(void *data);
31
32 unsigned refcount;
33 } php_http_resource_factory_t;
34
35 PHP_HTTP_API php_http_resource_factory_t *php_http_resource_factory_init(php_http_resource_factory_t *f, php_http_resource_factory_ops_t *fops, void *data, void (*dtor)(void *data));
36 PHP_HTTP_API unsigned php_http_resource_factory_addref(php_http_resource_factory_t *rf);
37 PHP_HTTP_API void php_http_resource_factory_dtor(php_http_resource_factory_t *f);
38 PHP_HTTP_API void php_http_resource_factory_free(php_http_resource_factory_t **f);
39
40 PHP_HTTP_API void *php_http_resource_factory_handle_ctor(php_http_resource_factory_t *f TSRMLS_DC);
41 PHP_HTTP_API void *php_http_resource_factory_handle_copy(php_http_resource_factory_t *f, void *handle TSRMLS_DC);
42 PHP_HTTP_API void php_http_resource_factory_handle_dtor(php_http_resource_factory_t *f, void *handle TSRMLS_DC);
43
44 #endif /* PHP_HTTP_RESOURCE_FACTORY_H */
45
46 /*
47 * Local variables:
48 * tab-width: 4
49 * c-basic-offset: 4
50 * End:
51 * vim600: noet sw=4 ts=4 fdm=marker
52 * vim<600: noet sw=4 ts=4
53 */