1a0a8ecac2cd96845828df7ba368b2d315adc3bd
[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-2010, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_RESOURCE_FACTORY_H
16 #define PHP_HTTP_RESOURCE_FACTORY_H
17
18 typedef void *(*php_http_resource_factory_handle_ctor_t)(void *opaque TSRMLS_DC);
19 typedef void *(*php_http_resource_factory_handle_copy_t)(void *opaque, void *handle TSRMLS_DC);
20 typedef void (*php_http_resource_factory_handle_dtor_t)(void *opaque, void *handle TSRMLS_DC);
21
22 typedef struct php_http_resource_factory_ops {
23 php_http_resource_factory_handle_ctor_t ctor;
24 php_http_resource_factory_handle_copy_t copy;
25 php_http_resource_factory_handle_dtor_t dtor;
26 } php_http_resource_factory_ops_t;
27
28 typedef struct php_http_resource_factory {
29 php_http_resource_factory_ops_t fops;
30
31 void *data;
32 void (*dtor)(void *data);
33
34 } php_http_resource_factory_t;
35
36 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));
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 */