2 +--------------------------------------------------------------------+
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 +--------------------------------------------------------------------+
13 #ifndef PHP_HTTP_RESOURCE_FACTORY_H
14 #define PHP_HTTP_RESOURCE_FACTORY_H
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
);
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
;
26 typedef struct php_http_resource_factory
{
27 php_http_resource_factory_ops_t fops
;
30 void (*dtor
)(void *data
);
33 } php_http_resource_factory_t
;
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
);
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
);
44 #endif /* PHP_HTTP_RESOURCE_FACTORY_H */
51 * vim600: noet sw=4 ts=4 fdm=marker
52 * vim<600: noet sw=4 ts=4