add max-age to http\Cookie
[m6w6/ext-http] / php_http_params.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_PARAMS_H
14 #define PHP_HTTP_PARAMS_H
15
16 typedef struct php_http_params_token {
17 char *str;
18 size_t len;
19 } php_http_params_token_t;
20
21 #define PHP_HTTP_PARAMS_RAW 0x00
22 #define PHP_HTTP_PARAMS_DEFAULT 0x01
23 #define PHP_HTTP_PARAMS_URLENCODED 0x04
24 #define PHP_HTTP_PARAMS_DIMENSION 0x08
25 #define PHP_HTTP_PARAMS_QUERY (PHP_HTTP_PARAMS_URLENCODED|PHP_HTTP_PARAMS_DIMENSION)
26
27 typedef struct php_http_params_opts {
28 php_http_params_token_t input;
29 php_http_params_token_t **param;
30 php_http_params_token_t **arg;
31 php_http_params_token_t **val;
32 zval *defval;
33 unsigned flags;
34 } php_http_params_opts_t;
35
36 PHP_HTTP_API php_http_params_opts_t *php_http_params_opts_default_get(php_http_params_opts_t *opts);
37 PHP_HTTP_API HashTable *php_http_params_parse(HashTable *params, const php_http_params_opts_t *opts TSRMLS_DC);
38 PHP_HTTP_API php_http_buffer_t *php_http_params_to_string(php_http_buffer_t *buf, HashTable *params, const char *pss, size_t psl, const char *ass, size_t asl, const char *vss, size_t vsl, unsigned flags TSRMLS_DC);
39
40 PHP_HTTP_API php_http_params_token_t **php_http_params_separator_init(zval *zv TSRMLS_DC);
41 PHP_HTTP_API void php_http_params_separator_free(php_http_params_token_t **separator);
42
43 typedef php_http_object_t php_http_params_object_t;
44
45 zend_class_entry *php_http_params_get_class_entry(void);
46
47 PHP_MINIT_FUNCTION(http_params);
48
49 #define php_http_params_object_new php_http_object_new
50 #define php_http_params_object_new_ex php_http_object_new_ex
51
52 PHP_METHOD(HttpParams, __construct);
53 PHP_METHOD(HttpParams, toString);
54 PHP_METHOD(HttpParams, toArray);
55 PHP_METHOD(HttpParams, offsetExists);
56 PHP_METHOD(HttpParams, offsetUnset);
57 PHP_METHOD(HttpParams, offsetSet);
58 PHP_METHOD(HttpParams, offsetGet);
59
60 #endif
61
62 /*
63 * Local variables:
64 * tab-width: 4
65 * c-basic-offset: 4
66 * End:
67 * vim600: noet sw=4 ts=4 fdm=marker
68 * vim<600: noet sw=4 ts=4
69 */
70