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-2014, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
13 #ifndef PHP_HTTP_OPTIONS_H
14 #define PHP_HTTP_OPTIONS_H
16 typedef struct php_http_option php_http_option_t
;
17 typedef struct php_http_options php_http_options_t
;
19 typedef ZEND_RESULT_CODE (*php_http_option_set_callback_t
)(php_http_option_t
*opt
, zval
*val
, void *userdata
);
20 typedef zval
*(*php_http_option_get_callback_t
)(php_http_option_t
*opt
, HashTable
*options
, void *userdata
);
22 struct php_http_options
{
25 php_http_option_get_callback_t getter
;
26 php_http_option_set_callback_t setter
;
28 unsigned persistent
:1;
31 struct php_http_option
{
32 php_http_options_t suboptions
;
40 php_http_option_set_callback_t setter
;
41 unsigned persistent
:1;
44 PHP_HTTP_API php_http_options_t
*php_http_options_init(php_http_options_t
*registry
, zend_bool persistent
);
45 PHP_HTTP_API ZEND_RESULT_CODE
php_http_options_apply(php_http_options_t
*registry
, HashTable
*options
, void *userdata
);
46 PHP_HTTP_API
void php_http_options_dtor(php_http_options_t
*registry
);
47 PHP_HTTP_API
void php_http_options_free(php_http_options_t
**registry
);
49 PHP_HTTP_API php_http_option_t
*php_http_option_register(php_http_options_t
*registry
, const char *name_str
, size_t name_len
, ulong option
, zend_uchar type
);
50 PHP_HTTP_API zval
*php_http_option_get(php_http_option_t
*opt
, HashTable
*options
, void *userdata
);
52 #endif /* PHP_HTTP_OPTIONS_H */
59 * vim600: noet sw=4 ts=4 fdm=marker
60 * vim<600: noet sw=4 ts=4