芝麻web文件管理V1.00
编辑当前文件:/home/conskgoa/doughi.co.uk/http.zip
PK \ ) ) php_http_buffer.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_BUFFER_H #define PHP_HTTP_BUFFER_H #ifndef PHP_HTTP_BUFFER_DEFAULT_SIZE # define PHP_HTTP_BUFFER_DEFAULT_SIZE 256 #endif #define PHP_HTTP_BUFFER_ERROR ((size_t) -1) #define PHP_HTTP_BUFFER_NOMEM PHP_HTTP_BUFFER_ERROR #define PHP_HTTP_BUFFER_PASS0 PHP_HTTP_BUFFER_ERROR #ifndef PTR_FREE # define PTR_FREE(PTR) \ { \ if (EXPECTED(PTR)) { \ efree(PTR); \ } \ } #endif #ifndef PTR_SET # define PTR_SET(PTR, SET) \ { \ PTR_FREE(PTR); \ PTR = SET; \ } #endif #ifdef PHP_ATTRIBUTE_FORMAT # define PHP_HTTP_BUFFER_ATTRIBUTE_FORMAT(f, a, b) PHP_ATTRIBUTE_FORMAT(f, a, b) #else # define PHP_HTTP_BUFFER_ATTRIBUTE_FORMAT(f, a, b) #endif #ifndef pemalloc # define pemalloc(s,p) malloc(s) # define pefree(x,p) free(x) # define perealloc(x,s,p) realloc(x,s) # define perealloc_recoverable perealloc # define ecalloc calloc static inline void *estrndup(void *p, size_t s) { char *r = (char *) malloc(s+1); if (r) memcpy((void *) r, p, s), r[s] = '\0'; return (void *) r; } #endif #if defined(PHP_WIN32) # if defined(PHP_HTTP_BUFFER_EXPORTS) # define PHP_HTTP_BUFFER_API __declspec(dllexport) # elif defined(COMPILE_DL_PHP_HTTP_BUFFER) # define PHP_HTTP_BUFFER_API __declspec(dllimport) # else # define PHP_HTTP_BUFFER_API # endif #else # define PHP_HTTP_BUFFER_API #endif #define PHP_HTTP_BUFFER(p) ((php_http_buffer_t *) (p)) #define FREE_PHP_HTTP_BUFFER_PTR(STR) pefree(STR, STR->pmem) #define FREE_PHP_HTTP_BUFFER_VAL(STR) php_http_buffer_dtor(STR) #define FREE_PHP_HTTP_BUFFER_ALL(STR) php_http_buffer_free(&(STR)) #define FREE_PHP_HTTP_BUFFER(free, STR) \ switch (free) \ { \ case PHP_HTTP_BUFFER_FREE_NOT: \ break; \ case PHP_HTTP_BUFFER_FREE_PTR: \ pefree(STR, STR->pmem); \ break; \ case PHP_HTTP_BUFFER_FREE_VAL: \ php_http_buffer_dtor(STR); \ break; \ case PHP_HTTP_BUFFER_FREE_ALL: { \ php_http_buffer_t *PTR = (STR); \ php_http_buffer_free(&PTR); \ break; \ } \ default:\ break; \ } #define RETURN_PHP_HTTP_BUFFER_PTR(STR) RETURN_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_PTR, 0) #define RETURN_PHP_HTTP_BUFFER_VAL(STR) RETURN_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_NOT, 0) #define RETURN_PHP_HTTP_BUFFER_DUP(STR) RETURN_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_NOT, 1) #define RETVAL_PHP_HTTP_BUFFER_PTR(STR) RETVAL_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_PTR, 0) #define RETVAL_PHP_HTTP_BUFFER_VAL(STR) RETVAL_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_NOT, 0) #define RETVAL_PHP_HTTP_BUFFER_DUP(STR) RETVAL_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_NOT, 1) /* RETURN_PHP_HTTP_BUFFER(buf, PHP_HTTP_BUFFER_FREE_PTR, 0) */ #define RETURN_PHP_HTTP_BUFFER(STR, free, dup) \ RETVAL_PHP_HTTP_BUFFER((STR), (free), (dup)); \ return; #define RETVAL_PHP_HTTP_BUFFER(STR, free, dup) \ php_http_buffer_fix(STR); \ RETVAL_STRINGL((STR)->data, (STR)->used, (dup)); \ FREE_PHP_HTTP_BUFFER((free), (STR)); typedef struct php_http_buffer { char *data; size_t used; size_t free; size_t size; unsigned pmem:1; unsigned reserved:31; } php_http_buffer_t; typedef enum php_http_buffer_free { PHP_HTTP_BUFFER_FREE_NOT = 0, PHP_HTTP_BUFFER_FREE_PTR, /* pefree() */ PHP_HTTP_BUFFER_FREE_VAL, /* php_http_buffer_dtor() */ PHP_HTTP_BUFFER_FREE_ALL /* php_http_buffer_free() */ } php_http_buffer_free_t; #define PHP_HTTP_BUFFER_ALL_FREE(STR) PHP_HTTP_BUFFER_FREE_ALL,(STR) #define PHP_HTTP_BUFFER_PTR_FREE(STR) PHP_HTTP_BUFFER_FREE_PTR,(STR) #define PHP_HTTP_BUFFER_VAL_FREE(STR) PHP_HTTP_BUFFER_FREE_VAL,(STR) #define PHP_HTTP_BUFFER_NOT_FREE(STR) PHP_HTTP_BUFFER_FREE_NOT,(STR) #define PHP_HTTP_BUFFER_INIT_PREALLOC 0x01 #define PHP_HTTP_BUFFER_INIT_PERSISTENT 0x02 /* create a new php_http_buffer_t */ #define php_http_buffer_new() php_http_buffer_init(NULL) #define php_http_buffer_init(b) php_http_buffer_init_ex(b, PHP_HTTP_BUFFER_DEFAULT_SIZE, 0) #define php_http_buffer_clone(from, to) php_http_buffer_init_ex((to), (from)->size, (from)->pmem ? PHP_HTTP_BUFFER_INIT_PERSISTENT:0) PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_init_ex(php_http_buffer_t *buf, size_t chunk_size, unsigned flags); /* create a php_http_buffer_t from a zval or c-string */ #define php_http_buffer_from_zval(z) php_http_buffer_from_string(Z_STRVAL(z), Z_STRLEN(z)) #define php_http_buffer_from_zval_ex(b, z) php_http_buffer_from_string_ex(b, Z_STRVAL(z), Z_STRLEN(z)) #define php_http_buffer_from_string(s, l) php_http_buffer_from_string_ex(NULL, (s), (l)) PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_from_string_ex(php_http_buffer_t *buf, const char *string, size_t length); /* usually only called from within the internal functions */ #define php_http_buffer_resize(b, s) php_http_buffer_resize_ex((b), (s), 0, 0) PHP_HTTP_BUFFER_API size_t php_http_buffer_resize_ex(php_http_buffer_t *buf, size_t len, size_t override_size, zend_bool allow_error); PHP_HTTP_BUFFER_API char *php_http_buffer_account(php_http_buffer_t *buf, size_t to_account); /* shrink memory chunk to actually used size (+1) */ PHP_HTTP_BUFFER_API size_t php_http_buffer_shrink(php_http_buffer_t *buf); /* append data to the php_http_buffer_t */ #define php_http_buffer_appends(b, a) php_http_buffer_append((b), (a), sizeof(a)-1) #define php_http_buffer_appendl(b, a) php_http_buffer_append((b), (a), strlen(a)) #define php_http_buffer_appendz(b, z) php_http_buffer_append((b), (z)->val, (z)->len) PHP_HTTP_BUFFER_API size_t php_http_buffer_append(php_http_buffer_t *buf, const char *append, size_t append_len); PHP_HTTP_BUFFER_API size_t php_http_buffer_appendf(php_http_buffer_t *buf, const char *format, ...) PHP_HTTP_BUFFER_ATTRIBUTE_FORMAT(printf, 2, 3); /* get a zero-terminated string */ PHP_HTTP_BUFFER_API char *php_http_buffer_data(const php_http_buffer_t *buf, char **into, size_t *len); /* remove a substring */ PHP_HTTP_BUFFER_API size_t php_http_buffer_cut(php_http_buffer_t *buf, size_t offset, size_t length); /* sets a trailing NUL byte */ PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_fix(php_http_buffer_t *buf); /* reset php_http_buffer_t object */ PHP_HTTP_BUFFER_API void php_http_buffer_reset(php_http_buffer_t *buf); /* free a php_http_buffer_t objects contents */ PHP_HTTP_BUFFER_API void php_http_buffer_dtor(php_http_buffer_t *buf); /* free a php_http_buffer_t object completely */ PHP_HTTP_BUFFER_API void php_http_buffer_free(php_http_buffer_t **buf); /* stores data in a php_http_buffer_t until it reaches chunk_size */ PHP_HTTP_BUFFER_API size_t php_http_buffer_chunk_buffer(php_http_buffer_t **s, const char *data, size_t data_len, char **chunk, size_t chunk_size); typedef size_t (*php_http_buffer_pass_func_t)(void *opaque, char *, size_t); PHP_HTTP_BUFFER_API ssize_t php_http_buffer_passthru(php_http_buffer_t **s, size_t chunk_size, php_http_buffer_pass_func_t passin, void *passin_arg, php_http_buffer_pass_func_t passon, void *passon_arg); /* wrapper around php_http_buffer_chunk_buffer, which passes available chunks to passthru() */ PHP_HTTP_BUFFER_API size_t php_http_buffer_chunked_output(php_http_buffer_t **s, const char *data, size_t data_len, size_t chunk_size, php_http_buffer_pass_func_t passout, void *opaque); /* write chunks directly into php_http_buffer_t buffer */ PHP_HTTP_BUFFER_API size_t php_http_buffer_chunked_input(php_http_buffer_t **s, size_t chunk_size, php_http_buffer_pass_func_t passin, void *opaque); # ifdef PHP_HTTP_BUFFER_EXTENDED /* memcmp for php_http_buffer_t objects */ PHP_HTTP_BUFFER_API int php_http_buffer_cmp(php_http_buffer_t *left, php_http_buffer_t *right); /* get a complete php_http_buffer_t duplicate */ PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_copy(const php_http_buffer_t *from, php_http_buffer_t *to); /* merge several php_http_buffer_t objects use like: php_http_buffer_t *final = php_http_buffer_merge(3, PHP_HTTP_BUFFER_NOT_FREE(&keep), PHP_HTTP_BUFFER_ALL_FREE(middle_ptr), PHP_HTTP_BUFFER_VAL_FREE(&local); */ PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_merge(unsigned argc, ...); PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_merge_ex(php_http_buffer_t *buf, unsigned argc, ...); PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_merge_va(php_http_buffer_t *buf, unsigned argc, va_list argv); /* insert data at a specific position of the php_http_buffer_t */ #define php_http_buffer_inserts(b, i, o) php_http_buffer_insert((b), (i), sizeof(i)-1, (o)) #define php_http_buffer_insertl(b, i, o) php_http_buffer_insert((b), (i), strlen(i), (o)) PHP_HTTP_BUFFER_API size_t php_http_buffer_insert(php_http_buffer_t *buf, const char *insert, size_t insert_len, size_t offset); PHP_HTTP_BUFFER_API size_t php_http_buffer_insertf(php_http_buffer_t *buf, size_t offset, const char *format, ...) PHP_HTTP_BUFFER_ATTRIBUTE_FORMAT(printf, 3, 4); /* prepend data */ #define php_http_buffer_prepends(b, p) php_http_buffer_prepend((b), (p), sizeof(p)-1) #define php_http_buffer_prependl(b, p) php_http_buffer_prepend((b), (p), strlen(p)) PHP_HTTP_BUFFER_API size_t php_http_buffer_prepend(php_http_buffer_t *buf, const char *prepend, size_t prepend_len); PHP_HTTP_BUFFER_API size_t php_http_buffer_prependf(php_http_buffer_t *buf, const char *format, ...) PHP_HTTP_BUFFER_ATTRIBUTE_FORMAT(printf, 2, 3); /* get a part of the php_http_buffer_t */ #define php_http_buffer_mid(b, o, l) php_http_buffer_sub((b), (o), (l)) #define php_http_buffer_left(b, l) php_http_buffer_sub((b), 0, (l)) PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_right(const php_http_buffer_t *buf, size_t length); PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_sub(const php_http_buffer_t *buf, size_t offset, size_t len); # endif /* PHP_HTTP_BUFFER_EXTENDED */ #endif /* PHP_HTTP_BUFFER_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK \4* * php_http_curl.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CURL_H #define PHP_HTTP_CURL_H #if PHP_HTTP_HAVE_LIBCURL #include
#define PHP_HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z))) #define PHP_HTTP_CURL_FEATURE(f) (curl_version_info(CURLVERSION_NOW)->features & (f)) #if !PHP_HTTP_CURL_VERSION(7,21,5) # define CURLE_UNKNOWN_OPTION CURLE_FAILED_INIT #endif PHP_MINIT_FUNCTION(http_curl); PHP_MSHUTDOWN_FUNCTION(http_curl); #endif /* PHP_HTTP_HAVE_LIBCURL */ #endif /* PHP_HTTP_CURL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \x"8 8 php_http_url.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_URL_H #define PHP_HTTP_URL_H #include "ext/standard/url.h" /* php_http_url_mod() */ #define PHP_HTTP_URL_REPLACE 0x000 #define PHP_HTTP_URL_JOIN_PATH 0x001 #define PHP_HTTP_URL_JOIN_QUERY 0x002 #define PHP_HTTP_URL_STRIP_USER 0x004 #define PHP_HTTP_URL_STRIP_PASS 0x008 #define PHP_HTTP_URL_STRIP_AUTH (PHP_HTTP_URL_STRIP_USER|PHP_HTTP_URL_STRIP_PASS) #define PHP_HTTP_URL_STRIP_PORT 0x020 #define PHP_HTTP_URL_STRIP_PATH 0x040 #define PHP_HTTP_URL_STRIP_QUERY 0x080 #define PHP_HTTP_URL_STRIP_FRAGMENT 0x100 #define PHP_HTTP_URL_STRIP_ALL ( \ PHP_HTTP_URL_STRIP_AUTH | \ PHP_HTTP_URL_STRIP_PORT | \ PHP_HTTP_URL_STRIP_PATH | \ PHP_HTTP_URL_STRIP_QUERY | \ PHP_HTTP_URL_STRIP_FRAGMENT \ ) #define PHP_HTTP_URL_FROM_ENV 0x1000 #define PHP_HTTP_URL_SANITIZE_PATH 0x2000 /* parse multibyte according to locale */ #define PHP_HTTP_URL_PARSE_MBLOC 0x10000 /* parse utf8 multibyte sequences */ #define PHP_HTTP_URL_PARSE_MBUTF8 0x20000 /* convert multibyte hostnames to IDNA */ #define PHP_HTTP_URL_PARSE_TOIDN 0x100000 /* percent encode multibyte sequences in userinfo, path, query and fragment */ #define PHP_HTTP_URL_PARSE_TOPCT 0x200000 #if PHP_HTTP_HAVE_IDNA2008 #define PHP_HTTP_URL_PARSE_TOIDN_2008 \ (PHP_HTTP_URL_PARSE_TOIDN | 0x400000) #endif #if PHP_HTTP_HAVE_IDNA2003 #define PHP_HTTP_URL_PARSE_TOIDN_2003 \ (PHP_HTTP_URL_PARSE_TOIDN | 0x800000) #endif /* ignore errors */ #define PHP_HTTP_URL_IGNORE_ERRORS 0x10000000 /* do not report errors */ #define PHP_HTTP_URL_SILENT_ERRORS 0x20000000 #define PHP_HTTP_URL_STDFLAGS 0x00332003 typedef struct php_http_url { char *scheme; char *user; char *pass; char *host; unsigned short port; char *path; char *query; char *fragment; } php_http_url_t; PHP_HTTP_API php_http_url_t *php_http_url_parse(const char *str, size_t len, unsigned flags); PHP_HTTP_API php_http_url_t *php_http_url_parse_authority(const char *str, size_t len, unsigned flags); PHP_HTTP_API php_http_url_t *php_http_url_mod(const php_http_url_t *old_url, const php_http_url_t *new_url, unsigned flags); PHP_HTTP_API php_http_url_t *php_http_url_copy(const php_http_url_t *url, zend_bool persistent); PHP_HTTP_API php_http_url_t *php_http_url_from_struct(HashTable *ht); PHP_HTTP_API php_http_url_t *php_http_url_from_zval(zval *value, unsigned flags); PHP_HTTP_API HashTable *php_http_url_to_struct(const php_http_url_t *url, zval *strct); PHP_HTTP_API char *php_http_url_to_string(const php_http_url_t *url, char **url_str, size_t *url_len, zend_bool persistent); PHP_HTTP_API char *php_http_url_authority_to_string(const php_http_url_t *url, char **url_str, size_t *url_len); PHP_HTTP_API void php_http_url_free(php_http_url_t **url); PHP_HTTP_API ZEND_RESULT_CODE php_http_url_encode_hash(HashTable *hash, const char *pre_encoded_str, size_t pre_encoded_len, char **encoded_str, size_t *encoded_len); PHP_HTTP_API ZEND_RESULT_CODE php_http_url_encode_hash_ex(HashTable *hash, php_http_buffer_t *qstr, const char *arg_sep_str, size_t arg_sep_len, const char *val_sep_str, size_t val_sep_len, const char *pre_encoded_str, size_t pre_encoded_len); static inline void php_http_url_argsep(const char **str, size_t *len) { if (SUCCESS != php_http_ini_entry(ZEND_STRL("arg_separator.output"), str, len, 0) || !*len) { *str = PHP_HTTP_URL_ARGSEP; *len = lenof(PHP_HTTP_URL_ARGSEP); } } static inline zend_bool php_http_url_is_empty(const php_http_url_t *url) { return !(url->scheme || url->pass || url->user || url->host || url->port || url->path || url->query || url->fragment); } PHP_HTTP_API zend_class_entry *php_http_url_get_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_env_url_class_entry(void); PHP_MINIT_FUNCTION(http_url); #define php_http_url_object_new php_http_object_new #define php_http_url_object_new_ex php_http_object_new_ex #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \Y php_http_options.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_OPTIONS_H #define PHP_HTTP_OPTIONS_H typedef struct php_http_option php_http_option_t; typedef struct php_http_options php_http_options_t; typedef ZEND_RESULT_CODE (*php_http_option_set_callback_t)(php_http_option_t *opt, zval *val, void *userdata); typedef zval *(*php_http_option_get_callback_t)(php_http_option_t *opt, HashTable *options, void *userdata); struct php_http_options { HashTable options; php_http_option_get_callback_t getter; php_http_option_set_callback_t setter; unsigned persistent:1; }; struct php_http_option { php_http_options_t suboptions; zend_string *name; unsigned long option; zend_uchar type; unsigned flags; zval defval; php_http_option_set_callback_t setter; unsigned persistent:1; }; PHP_HTTP_API php_http_options_t *php_http_options_init(php_http_options_t *registry, zend_bool persistent); PHP_HTTP_API ZEND_RESULT_CODE php_http_options_apply(php_http_options_t *registry, HashTable *options, void *userdata); PHP_HTTP_API void php_http_options_dtor(php_http_options_t *registry); PHP_HTTP_API void php_http_options_free(php_http_options_t **registry); PHP_HTTP_API php_http_option_t *php_http_option_register(php_http_options_t *registry, const char *name_str, size_t name_len, unsigned long option, zend_uchar type); PHP_HTTP_API zval *php_http_option_get(php_http_option_t *opt, HashTable *options, void *userdata); #endif /* PHP_HTTP_OPTIONS_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \y>7M php_http_client_response.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CLIENT_RESPONSE_H #define PHP_HTTP_CLIENT_RESPONSE_H PHP_HTTP_API zend_class_entry *php_http_get_client_response_class_entry(void); PHP_MINIT_FUNCTION(http_client_response); #endif /* PHP_HTTP_CLIENT_RESPONSE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ php_http_client.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CLIENT_H #define PHP_HTTP_CLIENT_H typedef enum php_http_client_setopt_opt { PHP_HTTP_CLIENT_OPT_ENABLE_PIPELINING, PHP_HTTP_CLIENT_OPT_USE_EVENTS, PHP_HTTP_CLIENT_OPT_CONFIGURATION, } php_http_client_setopt_opt_t; typedef enum php_http_client_getopt_opt { PHP_HTTP_CLIENT_OPT_PROGRESS_INFO, /* php_http_client_enqueue_t*, php_http_client_progress_state_t** */ PHP_HTTP_CLIENT_OPT_TRANSFER_INFO, /* php_http_client_enqueue_t*, HashTable* */ PHP_HTTP_CLIENT_OPT_AVAILABLE_OPTIONS, /* NULL, HashTable* */ PHP_HTTP_CLIENT_OPT_AVAILABLE_CONFIGURATION,/* NULL, HashTable */ } php_http_client_getopt_opt_t; typedef struct php_http_client_enqueue { php_http_message_t *request; /* unique */ HashTable *options; void (*dtor)(struct php_http_client_enqueue *); void *opaque; struct { zend_fcall_info fci; zend_fcall_info_cache fcc; } closure; php_http_message_object_t *request_obj; /* supplemental to request */ } php_http_client_enqueue_t; typedef struct php_http_client *(*php_http_client_init_func_t)(struct php_http_client *p, void *init_arg); typedef struct php_http_client *(*php_http_client_copy_func_t)(struct php_http_client *from, struct php_http_client *to); typedef void (*php_http_client_dtor_func_t)(struct php_http_client *p); typedef void (*php_http_client_reset_func_t)(struct php_http_client *p); typedef ZEND_RESULT_CODE (*php_http_client_exec_func_t)(struct php_http_client *p); typedef int (*php_http_client_once_func_t)(struct php_http_client *p); typedef ZEND_RESULT_CODE (*php_http_client_wait_func_t)(struct php_http_client *p, struct timeval *custom_timeout); typedef ZEND_RESULT_CODE (*php_http_client_enqueue_func_t)(struct php_http_client *p, php_http_client_enqueue_t *enqueue); typedef ZEND_RESULT_CODE (*php_http_client_dequeue_func_t)(struct php_http_client *p, php_http_client_enqueue_t *enqueue); typedef ZEND_RESULT_CODE (*php_http_client_requeue_func_t)(struct php_http_client *p, php_http_client_enqueue_t *enqueue); typedef ZEND_RESULT_CODE (*php_http_client_setopt_func_t)(struct php_http_client *p, php_http_client_setopt_opt_t opt, void *arg); typedef ZEND_RESULT_CODE (*php_http_client_getopt_func_t)(struct php_http_client *h, php_http_client_getopt_opt_t opt, void *arg, void **res); typedef struct php_http_client_ops { php_resource_factory_ops_t *rsrc; php_http_client_init_func_t init; php_http_client_copy_func_t copy; php_http_client_dtor_func_t dtor; php_http_client_reset_func_t reset; php_http_client_exec_func_t exec; php_http_client_wait_func_t wait; php_http_client_once_func_t once; php_http_client_enqueue_func_t enqueue; php_http_client_dequeue_func_t dequeue; php_http_client_requeue_func_t requeue; php_http_client_setopt_func_t setopt; php_http_client_getopt_func_t getopt; } php_http_client_ops_t; typedef struct php_http_client_driver { zend_string *driver_name; zend_string *client_name; zend_string *request_name; php_http_client_ops_t *client_ops; } php_http_client_driver_t; PHP_HTTP_API ZEND_RESULT_CODE php_http_client_driver_add(php_http_client_driver_t *driver); PHP_HTTP_API php_http_client_driver_t *php_http_client_driver_get(zend_string *name); typedef struct php_http_client_progress_state { struct { double now; double total; } ul; struct { double now; double total; } dl; const char *info; unsigned started:1; unsigned finished:1; } php_http_client_progress_state_t; typedef ZEND_RESULT_CODE (*php_http_client_response_callback_t)(void *arg, struct php_http_client *client, php_http_client_enqueue_t *e, php_http_message_t **response); typedef void (*php_http_client_progress_callback_t)(void *arg, struct php_http_client *client, php_http_client_enqueue_t *e, php_http_client_progress_state_t *state); typedef void (*php_http_client_debug_callback_t)(void *arg, struct php_http_client *client, php_http_client_enqueue_t *e, unsigned type, const char *data, size_t size); #define PHP_HTTP_CLIENT_DEBUG_INFO 0x00 #define PHP_HTTP_CLIENT_DEBUG_IN 0x01 #define PHP_HTTP_CLIENT_DEBUG_OUT 0x02 #define PHP_HTTP_CLIENT_DEBUG_HEADER 0x10 #define PHP_HTTP_CLIENT_DEBUG_BODY 0x20 #define PHP_HTTP_CLIENT_DEBUG_SSL 0x40 typedef struct php_http_client { void *ctx; php_resource_factory_t *rf; php_http_client_ops_t *ops; struct { struct { php_http_client_response_callback_t func; void *arg; } response; struct { php_http_client_progress_callback_t func; void *arg; } progress; struct { php_http_client_debug_callback_t func; void *arg; } debug; unsigned depth; } callback; zend_llist requests; zend_llist responses; } php_http_client_t; PHP_HTTP_API zend_class_entry *php_http_client_get_class_entry(); typedef struct php_http_client_object { php_http_client_t *client; php_http_object_method_t *update; php_http_object_method_t notify; struct { zend_fcall_info fci; zend_fcall_info_cache fcc; } debug; long iterator; zval *gc; zend_object zo; } php_http_client_object_t; PHP_HTTP_API php_http_client_t *php_http_client_init(php_http_client_t *h, php_http_client_ops_t *ops, php_resource_factory_t *rf, void *init_arg); PHP_HTTP_API php_http_client_t *php_http_client_copy(php_http_client_t *from, php_http_client_t *to); PHP_HTTP_API void php_http_client_dtor(php_http_client_t *h); PHP_HTTP_API void php_http_client_free(php_http_client_t **h); PHP_HTTP_API ZEND_RESULT_CODE php_http_client_enqueue(php_http_client_t *h, php_http_client_enqueue_t *enqueue); PHP_HTTP_API ZEND_RESULT_CODE php_http_client_dequeue(php_http_client_t *h, php_http_message_t *request); PHP_HTTP_API ZEND_RESULT_CODE php_http_client_wait(php_http_client_t *h, struct timeval *custom_timeout); PHP_HTTP_API int php_http_client_once(php_http_client_t *h); PHP_HTTP_API ZEND_RESULT_CODE php_http_client_exec(php_http_client_t *h); PHP_HTTP_API void php_http_client_reset(php_http_client_t *h); PHP_HTTP_API ZEND_RESULT_CODE php_http_client_setopt(php_http_client_t *h, php_http_client_setopt_opt_t opt, void *arg); PHP_HTTP_API ZEND_RESULT_CODE php_http_client_getopt(php_http_client_t *h, php_http_client_getopt_opt_t opt, void *arg, void *res_ptr); typedef int (*php_http_client_enqueue_cmp_func_t)(php_http_client_enqueue_t *cmp, void *arg); /* compare with request message pointer if compare_func is NULL */ PHP_HTTP_API php_http_client_enqueue_t *php_http_client_enqueued(php_http_client_t *h, void *compare_arg, php_http_client_enqueue_cmp_func_t compare_func); PHP_MINIT_FUNCTION(http_client); PHP_MSHUTDOWN_FUNCTION(http_client); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ ZU U php_http_querystring.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_QUERYSTRING_H #define PHP_HTTP_QUERYSTRING_H #if PHP_HTTP_HAVE_ICONV PHP_HTTP_API ZEND_RESULT_CODE php_http_querystring_xlate(zval *dst, zval *src, const char *ie, const char *oe); #endif /* PHP_HTTP_HAVE_ICONV */ PHP_HTTP_API ZEND_RESULT_CODE php_http_querystring_update(zval *qarray, zval *params, zval *qstring); PHP_HTTP_API ZEND_RESULT_CODE php_http_querystring_ctor(zval *instance, zval *params); typedef php_http_object_t php_http_querystring_object_t; #define PHP_HTTP_QUERYSTRING_TYPE_BOOL _IS_BOOL #define PHP_HTTP_QUERYSTRING_TYPE_INT IS_LONG #define PHP_HTTP_QUERYSTRING_TYPE_FLOAT IS_DOUBLE #define PHP_HTTP_QUERYSTRING_TYPE_STRING IS_STRING #define PHP_HTTP_QUERYSTRING_TYPE_ARRAY IS_ARRAY #define PHP_HTTP_QUERYSTRING_TYPE_OBJECT IS_OBJECT PHP_HTTP_API zend_class_entry *php_http_querystring_get_class_entry(void); PHP_MINIT_FUNCTION(http_querystring); #define php_http_querystring_object_new php_http_object_new #define php_http_querystring_object_new_ex php_http_object_new_ex #endif /* PHP_HTTP_QUERYSTRING_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \k! ! php_http_response_codes.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2015, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_RESPONSE_CODE # define PHP_HTTP_RESPONSE_CODE(code, status) #endif PHP_HTTP_RESPONSE_CODE(100, "Continue") PHP_HTTP_RESPONSE_CODE(101, "Switching Protocols") PHP_HTTP_RESPONSE_CODE(102, "Processing") PHP_HTTP_RESPONSE_CODE(200, "OK") PHP_HTTP_RESPONSE_CODE(201, "Created") PHP_HTTP_RESPONSE_CODE(202, "Accepted") PHP_HTTP_RESPONSE_CODE(203, "Non-Authoritative Information") PHP_HTTP_RESPONSE_CODE(204, "No Content") PHP_HTTP_RESPONSE_CODE(205, "Reset Content") PHP_HTTP_RESPONSE_CODE(206, "Partial Content") PHP_HTTP_RESPONSE_CODE(207, "Multi-Status") PHP_HTTP_RESPONSE_CODE(208, "Already Reported") PHP_HTTP_RESPONSE_CODE(226, "IM Used") PHP_HTTP_RESPONSE_CODE(300, "Multiple Choices") PHP_HTTP_RESPONSE_CODE(301, "Moved Permanently") PHP_HTTP_RESPONSE_CODE(302, "Found") PHP_HTTP_RESPONSE_CODE(303, "See Other") PHP_HTTP_RESPONSE_CODE(304, "Not Modified") PHP_HTTP_RESPONSE_CODE(305, "Use Proxy") PHP_HTTP_RESPONSE_CODE(307, "Temporary Redirect") PHP_HTTP_RESPONSE_CODE(308, "Permanent Redirect") PHP_HTTP_RESPONSE_CODE(400, "Bad Request") PHP_HTTP_RESPONSE_CODE(401, "Unauthorized") PHP_HTTP_RESPONSE_CODE(402, "Payment Required") PHP_HTTP_RESPONSE_CODE(403, "Forbidden") PHP_HTTP_RESPONSE_CODE(404, "Not Found") PHP_HTTP_RESPONSE_CODE(405, "Method Not Allowed") PHP_HTTP_RESPONSE_CODE(406, "Not Acceptable") PHP_HTTP_RESPONSE_CODE(407, "Proxy Authentication Required") PHP_HTTP_RESPONSE_CODE(408, "Request Timeout") PHP_HTTP_RESPONSE_CODE(409, "Conflict") PHP_HTTP_RESPONSE_CODE(410, "Gone") PHP_HTTP_RESPONSE_CODE(411, "Length Required") PHP_HTTP_RESPONSE_CODE(412, "Precondition Failed") PHP_HTTP_RESPONSE_CODE(413, "Request Entity Too Large") PHP_HTTP_RESPONSE_CODE(414, "Request URI Too Long") PHP_HTTP_RESPONSE_CODE(415, "Unsupported Media Type") PHP_HTTP_RESPONSE_CODE(416, "Requested Range Not Satisfiable") PHP_HTTP_RESPONSE_CODE(417, "Expectation Failed") PHP_HTTP_RESPONSE_CODE(422, "Unprocessible Entity") PHP_HTTP_RESPONSE_CODE(423, "Locked") PHP_HTTP_RESPONSE_CODE(424, "Failed Dependency") PHP_HTTP_RESPONSE_CODE(426, "Upgrade Required") PHP_HTTP_RESPONSE_CODE(428, "Precondition Required") PHP_HTTP_RESPONSE_CODE(429, "Too Many Requests") PHP_HTTP_RESPONSE_CODE(431, "Request Header Fields Too Large") PHP_HTTP_RESPONSE_CODE(500, "Internal Server Error") PHP_HTTP_RESPONSE_CODE(501, "Not Implemented") PHP_HTTP_RESPONSE_CODE(502, "Bad Gateway") PHP_HTTP_RESPONSE_CODE(503, "Service Unavailable") PHP_HTTP_RESPONSE_CODE(504, "Gateway Timeout") PHP_HTTP_RESPONSE_CODE(505, "HTTP Version Not Supported") PHP_HTTP_RESPONSE_CODE(506, "Variant Also Negotiates") PHP_HTTP_RESPONSE_CODE(507, "Insufficient Storage") PHP_HTTP_RESPONSE_CODE(508, "Loop Detected") PHP_HTTP_RESPONSE_CODE(510, "Not Extended") PHP_HTTP_RESPONSE_CODE(511, "Network Authentication Required") /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \M&( php_http.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_EXT_HTTP_H #define PHP_EXT_HTTP_H #define PHP_PECL_HTTP_VERSION "4.2.6" extern zend_module_entry http_module_entry; #define phpext_http_ptr &http_module_entry extern int http_module_number; #endif /* PHP_EXT_HTTP_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ = php_http_negotiate.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_NEGOTIATE_H #define PHP_HTTP_NEGOTIATE_H PHP_HTTP_API HashTable *php_http_negotiate(const char *value_str, size_t value_len, HashTable *supported, const char *primary_sep_str, size_t primary_sep_len); static inline HashTable *php_http_negotiate_language(HashTable *supported, php_http_message_t *request) { HashTable *result = NULL; size_t length; char *value = php_http_env_get_request_header(ZEND_STRL("Accept-Language"), &length, request); if (value) { result = php_http_negotiate(value, length, supported, "-", 1); } PTR_FREE(value); return result; } static inline HashTable *php_http_negotiate_encoding(HashTable *supported, php_http_message_t *request) { HashTable *result = NULL; size_t length; char *value = php_http_env_get_request_header(ZEND_STRL("Accept-Encoding"), &length, request); if (value) { result = php_http_negotiate(value, length, supported, NULL, 0); } PTR_FREE(value); return result; } static inline HashTable *php_http_negotiate_charset(HashTable *supported, php_http_message_t *request) { HashTable *result = NULL; size_t length; char *value = php_http_env_get_request_header(ZEND_STRL("Accept-Charset"), &length, request); if (value) { result = php_http_negotiate(value, length, supported, NULL, 0); } PTR_FREE(value); return result; } static inline HashTable *php_http_negotiate_content_type(HashTable *supported, php_http_message_t *request) { HashTable *result = NULL; size_t length; char *value = php_http_env_get_request_header(ZEND_STRL("Accept"), &length, request); if (value) { result = php_http_negotiate(value, length, supported, "/", 1); } PTR_FREE(value); return result; } #define PHP_HTTP_DO_NEGOTIATE_DEFAULT(supported) \ { \ zval *value; \ HashPosition pos; \ \ zend_hash_internal_pointer_reset_ex((supported), &pos); \ if ((value = zend_hash_get_current_data_ex((supported), &pos))) { \ RETVAL_ZVAL(value, 1, 0); \ } else { \ RETVAL_NULL(); \ } \ } #define PHP_HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array) \ PHP_HTTP_DO_NEGOTIATE_DEFAULT(supported); \ if (rs_array) { \ zval *value; \ \ ZEND_HASH_FOREACH_VAL(supported, value) \ { \ zend_string *zs = zval_get_string(value); \ add_assoc_double_ex(rs_array, zs->val, zs->len, 1.0); \ zend_string_release(zs); \ } \ ZEND_HASH_FOREACH_END(); \ } #define PHP_HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array) \ { \ zend_string *key; \ zend_ulong idx; \ \ if (zend_hash_num_elements(result) && HASH_KEY_IS_STRING == zend_hash_get_current_key(result, &key, &idx)) { \ RETVAL_STR_COPY(key); \ } else { \ PHP_HTTP_DO_NEGOTIATE_DEFAULT(supported); \ } \ \ if (rs_array) { \ zend_hash_copy(Z_ARRVAL_P(rs_array), result, (copy_ctor_func_t) zval_add_ref); \ } \ \ zend_hash_destroy(result); \ FREE_HASHTABLE(result); \ } #define PHP_HTTP_DO_NEGOTIATE(type, supported, rs_array) \ { \ HashTable *result; \ if ((result = php_http_negotiate_ ##type(supported, NULL))) { \ PHP_HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array); \ } else { \ PHP_HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array); \ } \ } #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \/ php_http_message_parser.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_MESSAGE_PARSER_H #define PHP_HTTP_MESSAGE_PARSER_H #include "php_http_header_parser.h" #include "php_http_encoding.h" #include "php_http_message.h" typedef enum php_http_message_parser_state { PHP_HTTP_MESSAGE_PARSER_STATE_FAILURE = FAILURE, PHP_HTTP_MESSAGE_PARSER_STATE_START = 0, PHP_HTTP_MESSAGE_PARSER_STATE_HEADER, PHP_HTTP_MESSAGE_PARSER_STATE_HEADER_DONE, PHP_HTTP_MESSAGE_PARSER_STATE_BODY, PHP_HTTP_MESSAGE_PARSER_STATE_BODY_DUMB, PHP_HTTP_MESSAGE_PARSER_STATE_BODY_LENGTH, PHP_HTTP_MESSAGE_PARSER_STATE_BODY_CHUNKED, PHP_HTTP_MESSAGE_PARSER_STATE_BODY_DONE, PHP_HTTP_MESSAGE_PARSER_STATE_UPDATE_CL, PHP_HTTP_MESSAGE_PARSER_STATE_DONE } php_http_message_parser_state_t; #define PHP_HTTP_MESSAGE_PARSER_CLEANUP 0x1 #define PHP_HTTP_MESSAGE_PARSER_DUMB_BODIES 0x2 #define PHP_HTTP_MESSAGE_PARSER_EMPTY_REDIRECTS 0x4 #define PHP_HTTP_MESSAGE_PARSER_GREEDY 0x8 typedef struct php_http_message_parser { php_http_header_parser_t header; zend_ptr_stack stack; size_t body_length; php_http_message_t *message; php_http_encoding_stream_t *dechunk; php_http_encoding_stream_t *inflate; } php_http_message_parser_t; PHP_HTTP_API php_http_message_parser_t *php_http_message_parser_init(php_http_message_parser_t *parser); PHP_HTTP_API php_http_message_parser_state_t php_http_message_parser_state_is(php_http_message_parser_t *parser); PHP_HTTP_API void php_http_message_parser_dtor(php_http_message_parser_t *parser); PHP_HTTP_API void php_http_message_parser_free(php_http_message_parser_t **parser); PHP_HTTP_API php_http_message_parser_state_t php_http_message_parser_parse(php_http_message_parser_t *parser, php_http_buffer_t *buffer, unsigned flags, php_http_message_t **message); PHP_HTTP_API php_http_message_parser_state_t php_http_message_parser_parse_stream(php_http_message_parser_t *parser, php_http_buffer_t *buffer, php_stream *s, unsigned flags, php_http_message_t **message); typedef struct php_http_message_parser_object { php_http_buffer_t buffer; php_http_message_parser_t *parser; zend_object zo; } php_http_message_parser_object_t; PHP_HTTP_API zend_class_entry *php_http_get_message_parser_class_entry(void); PHP_MINIT_FUNCTION(http_message_parser); zend_object *php_http_message_parser_object_new(zend_class_entry *ce); php_http_message_parser_object_t *php_http_message_parser_object_new_ex(zend_class_entry *ce, php_http_message_parser_t *parser); void php_http_message_parser_object_free(zend_object *object); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ /R /R php_http_utf8.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_UTF8_H #define PHP_HTTP_UTF8_H static const unsigned char utf8_mblen[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,5,5,5,5,6,6,6,6 }; static const unsigned char utf8_mask[] = { 0, 0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; typedef struct utf8_range { const unsigned int start; const unsigned int end; } utf8_range_t; /* BEGIN::UTF8TABLE */ static const utf8_range_t utf8_ranges[] = { {0x00000041, 0x0000005A}, {0x00000061, 0x0000007A}, {0x000000C0, 0x000000D6}, {0x000000D8, 0x000000F6}, {0x000000F8, 0x000002C1}, {0x000002C6, 0x000002D1}, {0x000002E0, 0x000002E4}, {0x00000370, 0x00000374}, {0x00000376, 0x00000377}, {0x0000037A, 0x0000037D}, {0x00000388, 0x0000038A}, {0x0000038E, 0x000003A1}, {0x000003A3, 0x000003F5}, {0x000003F7, 0x00000481}, {0x0000048A, 0x0000052F}, {0x00000531, 0x00000556}, {0x00000561, 0x00000587}, {0x000005B0, 0x000005BD}, {0x000005C1, 0x000005C2}, {0x000005C4, 0x000005C5}, {0x000005D0, 0x000005EA}, {0x000005F0, 0x000005F2}, {0x00000610, 0x0000061A}, {0x00000620, 0x00000657}, {0x00000659, 0x00000669}, {0x0000066E, 0x000006D3}, {0x000006D5, 0x000006DC}, {0x000006E1, 0x000006E8}, {0x000006ED, 0x000006FC}, {0x00000710, 0x0000073F}, {0x0000074D, 0x000007B1}, {0x000007C0, 0x000007EA}, {0x000007F4, 0x000007F5}, {0x00000800, 0x00000817}, {0x0000081A, 0x0000082C}, {0x00000840, 0x00000858}, {0x00000860, 0x0000086A}, {0x000008A0, 0x000008B4}, {0x000008B6, 0x000008BD}, {0x000008D4, 0x000008DF}, {0x000008E3, 0x000008E9}, {0x000008F0, 0x0000093B}, {0x0000093D, 0x0000094C}, {0x0000094E, 0x00000950}, {0x00000955, 0x00000963}, {0x00000966, 0x0000096F}, {0x00000971, 0x00000983}, {0x00000985, 0x0000098C}, {0x0000098F, 0x00000990}, {0x00000993, 0x000009A8}, {0x000009AA, 0x000009B0}, {0x000009B6, 0x000009B9}, {0x000009BD, 0x000009C4}, {0x000009C7, 0x000009C8}, {0x000009CB, 0x000009CC}, {0x000009DC, 0x000009DD}, {0x000009DF, 0x000009E3}, {0x000009E6, 0x000009F1}, {0x00000A01, 0x00000A03}, {0x00000A05, 0x00000A0A}, {0x00000A0F, 0x00000A10}, {0x00000A13, 0x00000A28}, {0x00000A2A, 0x00000A30}, {0x00000A32, 0x00000A33}, {0x00000A35, 0x00000A36}, {0x00000A38, 0x00000A39}, {0x00000A3E, 0x00000A42}, {0x00000A47, 0x00000A48}, {0x00000A4B, 0x00000A4C}, {0x00000A59, 0x00000A5C}, {0x00000A66, 0x00000A75}, {0x00000A81, 0x00000A83}, {0x00000A85, 0x00000A8D}, {0x00000A8F, 0x00000A91}, {0x00000A93, 0x00000AA8}, {0x00000AAA, 0x00000AB0}, {0x00000AB2, 0x00000AB3}, {0x00000AB5, 0x00000AB9}, {0x00000ABD, 0x00000AC5}, {0x00000AC7, 0x00000AC9}, {0x00000ACB, 0x00000ACC}, {0x00000AE0, 0x00000AE3}, {0x00000AE6, 0x00000AEF}, {0x00000AF9, 0x00000AFC}, {0x00000B01, 0x00000B03}, {0x00000B05, 0x00000B0C}, {0x00000B0F, 0x00000B10}, {0x00000B13, 0x00000B28}, {0x00000B2A, 0x00000B30}, {0x00000B32, 0x00000B33}, {0x00000B35, 0x00000B39}, {0x00000B3D, 0x00000B44}, {0x00000B47, 0x00000B48}, {0x00000B4B, 0x00000B4C}, {0x00000B56, 0x00000B57}, {0x00000B5C, 0x00000B5D}, {0x00000B5F, 0x00000B63}, {0x00000B66, 0x00000B6F}, {0x00000B82, 0x00000B83}, {0x00000B85, 0x00000B8A}, {0x00000B8E, 0x00000B90}, {0x00000B92, 0x00000B95}, {0x00000B99, 0x00000B9A}, {0x00000B9E, 0x00000B9F}, {0x00000BA3, 0x00000BA4}, {0x00000BA8, 0x00000BAA}, {0x00000BAE, 0x00000BB9}, {0x00000BBE, 0x00000BC2}, {0x00000BC6, 0x00000BC8}, {0x00000BCA, 0x00000BCC}, {0x00000BE6, 0x00000BEF}, {0x00000C00, 0x00000C03}, {0x00000C05, 0x00000C0C}, {0x00000C0E, 0x00000C10}, {0x00000C12, 0x00000C28}, {0x00000C2A, 0x00000C39}, {0x00000C3D, 0x00000C44}, {0x00000C46, 0x00000C48}, {0x00000C4A, 0x00000C4C}, {0x00000C55, 0x00000C56}, {0x00000C58, 0x00000C5A}, {0x00000C60, 0x00000C63}, {0x00000C66, 0x00000C6F}, {0x00000C80, 0x00000C83}, {0x00000C85, 0x00000C8C}, {0x00000C8E, 0x00000C90}, {0x00000C92, 0x00000CA8}, {0x00000CAA, 0x00000CB3}, {0x00000CB5, 0x00000CB9}, {0x00000CBD, 0x00000CC4}, {0x00000CC6, 0x00000CC8}, {0x00000CCA, 0x00000CCC}, {0x00000CD5, 0x00000CD6}, {0x00000CE0, 0x00000CE3}, {0x00000CE6, 0x00000CEF}, {0x00000CF1, 0x00000CF2}, {0x00000D00, 0x00000D03}, {0x00000D05, 0x00000D0C}, {0x00000D0E, 0x00000D10}, {0x00000D12, 0x00000D3A}, {0x00000D3D, 0x00000D44}, {0x00000D46, 0x00000D48}, {0x00000D4A, 0x00000D4C}, {0x00000D54, 0x00000D57}, {0x00000D5F, 0x00000D63}, {0x00000D66, 0x00000D6F}, {0x00000D7A, 0x00000D7F}, {0x00000D82, 0x00000D83}, {0x00000D85, 0x00000D96}, {0x00000D9A, 0x00000DB1}, {0x00000DB3, 0x00000DBB}, {0x00000DC0, 0x00000DC6}, {0x00000DCF, 0x00000DD4}, {0x00000DD8, 0x00000DDF}, {0x00000DE6, 0x00000DEF}, {0x00000DF2, 0x00000DF3}, {0x00000E01, 0x00000E3A}, {0x00000E40, 0x00000E46}, {0x00000E50, 0x00000E59}, {0x00000E81, 0x00000E82}, {0x00000E87, 0x00000E88}, {0x00000E94, 0x00000E97}, {0x00000E99, 0x00000E9F}, {0x00000EA1, 0x00000EA3}, {0x00000EAA, 0x00000EAB}, {0x00000EAD, 0x00000EB9}, {0x00000EBB, 0x00000EBD}, {0x00000EC0, 0x00000EC4}, {0x00000ED0, 0x00000ED9}, {0x00000EDC, 0x00000EDF}, {0x00000F20, 0x00000F29}, {0x00000F40, 0x00000F47}, {0x00000F49, 0x00000F6C}, {0x00000F71, 0x00000F81}, {0x00000F88, 0x00000F97}, {0x00000F99, 0x00000FBC}, {0x00001000, 0x00001036}, {0x0000103B, 0x00001049}, {0x00001050, 0x00001062}, {0x00001065, 0x00001068}, {0x0000106E, 0x00001086}, {0x00001090, 0x00001099}, {0x0000109C, 0x0000109D}, {0x000010A0, 0x000010C5}, {0x000010D0, 0x000010FA}, {0x000010FC, 0x00001248}, {0x0000124A, 0x0000124D}, {0x00001250, 0x00001256}, {0x0000125A, 0x0000125D}, {0x00001260, 0x00001288}, {0x0000128A, 0x0000128D}, {0x00001290, 0x000012B0}, {0x000012B2, 0x000012B5}, {0x000012B8, 0x000012BE}, {0x000012C2, 0x000012C5}, {0x000012C8, 0x000012D6}, {0x000012D8, 0x00001310}, {0x00001312, 0x00001315}, {0x00001318, 0x0000135A}, {0x00001380, 0x0000138F}, {0x000013A0, 0x000013F5}, {0x000013F8, 0x000013FD}, {0x00001401, 0x0000166C}, {0x0000166F, 0x0000167F}, {0x00001681, 0x0000169A}, {0x000016A0, 0x000016EA}, {0x000016EE, 0x000016F8}, {0x00001700, 0x0000170C}, {0x0000170E, 0x00001713}, {0x00001720, 0x00001733}, {0x00001740, 0x00001753}, {0x00001760, 0x0000176C}, {0x0000176E, 0x00001770}, {0x00001772, 0x00001773}, {0x00001780, 0x000017B3}, {0x000017B6, 0x000017C8}, {0x000017E0, 0x000017E9}, {0x00001810, 0x00001819}, {0x00001820, 0x00001877}, {0x00001880, 0x000018AA}, {0x000018B0, 0x000018F5}, {0x00001900, 0x0000191E}, {0x00001920, 0x0000192B}, {0x00001930, 0x00001938}, {0x00001946, 0x0000196D}, {0x00001970, 0x00001974}, {0x00001980, 0x000019AB}, {0x000019B0, 0x000019C9}, {0x000019D0, 0x000019D9}, {0x00001A00, 0x00001A1B}, {0x00001A20, 0x00001A5E}, {0x00001A61, 0x00001A74}, {0x00001A80, 0x00001A89}, {0x00001A90, 0x00001A99}, {0x00001B00, 0x00001B33}, {0x00001B35, 0x00001B43}, {0x00001B45, 0x00001B4B}, {0x00001B50, 0x00001B59}, {0x00001B80, 0x00001BA9}, {0x00001BAC, 0x00001BE5}, {0x00001BE7, 0x00001BF1}, {0x00001C00, 0x00001C35}, {0x00001C40, 0x00001C49}, {0x00001C4D, 0x00001C7D}, {0x00001C80, 0x00001C88}, {0x00001CE9, 0x00001CEC}, {0x00001CEE, 0x00001CF3}, {0x00001CF5, 0x00001CF6}, {0x00001D00, 0x00001DBF}, {0x00001DE7, 0x00001DF4}, {0x00001E00, 0x00001F15}, {0x00001F18, 0x00001F1D}, {0x00001F20, 0x00001F45}, {0x00001F48, 0x00001F4D}, {0x00001F50, 0x00001F57}, {0x00001F5F, 0x00001F7D}, {0x00001F80, 0x00001FB4}, {0x00001FB6, 0x00001FBC}, {0x00001FC2, 0x00001FC4}, {0x00001FC6, 0x00001FCC}, {0x00001FD0, 0x00001FD3}, {0x00001FD6, 0x00001FDB}, {0x00001FE0, 0x00001FEC}, {0x00001FF2, 0x00001FF4}, {0x00001FF6, 0x00001FFC}, {0x00002090, 0x0000209C}, {0x0000210A, 0x00002113}, {0x00002119, 0x0000211D}, {0x0000212A, 0x0000212D}, {0x0000212F, 0x00002139}, {0x0000213C, 0x0000213F}, {0x00002145, 0x00002149}, {0x00002160, 0x00002188}, {0x000024B6, 0x000024E9}, {0x00002C00, 0x00002C2E}, {0x00002C30, 0x00002C5E}, {0x00002C60, 0x00002CE4}, {0x00002CEB, 0x00002CEE}, {0x00002CF2, 0x00002CF3}, {0x00002D00, 0x00002D25}, {0x00002D30, 0x00002D67}, {0x00002D80, 0x00002D96}, {0x00002DA0, 0x00002DA6}, {0x00002DA8, 0x00002DAE}, {0x00002DB0, 0x00002DB6}, {0x00002DB8, 0x00002DBE}, {0x00002DC0, 0x00002DC6}, {0x00002DC8, 0x00002DCE}, {0x00002DD0, 0x00002DD6}, {0x00002DD8, 0x00002DDE}, {0x00002DE0, 0x00002DFF}, {0x00003005, 0x00003007}, {0x00003021, 0x00003029}, {0x00003031, 0x00003035}, {0x00003038, 0x0000303C}, {0x00003041, 0x00003096}, {0x0000309D, 0x0000309F}, {0x000030A1, 0x000030FA}, {0x000030FC, 0x000030FF}, {0x00003105, 0x0000312E}, {0x00003131, 0x0000318E}, {0x000031A0, 0x000031BA}, {0x000031F0, 0x000031FF}, {0x00003400, 0x00004DB5}, {0x00004E00, 0x00009FEA}, {0x0000A000, 0x0000A48C}, {0x0000A4D0, 0x0000A4FD}, {0x0000A500, 0x0000A60C}, {0x0000A610, 0x0000A62B}, {0x0000A640, 0x0000A66E}, {0x0000A674, 0x0000A67B}, {0x0000A67F, 0x0000A6EF}, {0x0000A717, 0x0000A71F}, {0x0000A722, 0x0000A788}, {0x0000A78B, 0x0000A7AE}, {0x0000A7B0, 0x0000A7B7}, {0x0000A7F7, 0x0000A801}, {0x0000A803, 0x0000A805}, {0x0000A807, 0x0000A80A}, {0x0000A80C, 0x0000A827}, {0x0000A840, 0x0000A873}, {0x0000A880, 0x0000A8C3}, {0x0000A8D0, 0x0000A8D9}, {0x0000A8F2, 0x0000A8F7}, {0x0000A900, 0x0000A92A}, {0x0000A930, 0x0000A952}, {0x0000A960, 0x0000A97C}, {0x0000A980, 0x0000A9B2}, {0x0000A9B4, 0x0000A9BF}, {0x0000A9CF, 0x0000A9D9}, {0x0000A9E0, 0x0000A9E4}, {0x0000A9E6, 0x0000A9FE}, {0x0000AA00, 0x0000AA36}, {0x0000AA40, 0x0000AA4D}, {0x0000AA50, 0x0000AA59}, {0x0000AA60, 0x0000AA76}, {0x0000AA7E, 0x0000AABE}, {0x0000AADB, 0x0000AADD}, {0x0000AAE0, 0x0000AAEF}, {0x0000AAF2, 0x0000AAF5}, {0x0000AB01, 0x0000AB06}, {0x0000AB09, 0x0000AB0E}, {0x0000AB11, 0x0000AB16}, {0x0000AB20, 0x0000AB26}, {0x0000AB28, 0x0000AB2E}, {0x0000AB30, 0x0000AB5A}, {0x0000AB5C, 0x0000AB65}, {0x0000AB70, 0x0000ABEA}, {0x0000ABF0, 0x0000ABF9}, {0x0000AC00, 0x0000D7A3}, {0x0000D7B0, 0x0000D7C6}, {0x0000D7CB, 0x0000D7FB}, {0x0000F900, 0x0000FA6D}, {0x0000FA70, 0x0000FAD9}, {0x0000FB00, 0x0000FB06}, {0x0000FB13, 0x0000FB17}, {0x0000FB1D, 0x0000FB28}, {0x0000FB2A, 0x0000FB36}, {0x0000FB38, 0x0000FB3C}, {0x0000FB40, 0x0000FB41}, {0x0000FB43, 0x0000FB44}, {0x0000FB46, 0x0000FBB1}, {0x0000FBD3, 0x0000FD3D}, {0x0000FD50, 0x0000FD8F}, {0x0000FD92, 0x0000FDC7}, {0x0000FDF0, 0x0000FDFB}, {0x0000FE70, 0x0000FE74}, {0x0000FE76, 0x0000FEFC}, {0x0000FF10, 0x0000FF19}, {0x0000FF21, 0x0000FF3A}, {0x0000FF41, 0x0000FF5A}, {0x0000FF66, 0x0000FFBE}, {0x0000FFC2, 0x0000FFC7}, {0x0000FFCA, 0x0000FFCF}, {0x0000FFD2, 0x0000FFD7}, {0x0000FFDA, 0x0000FFDC}, {0x00010000, 0x0001000B}, {0x0001000D, 0x00010026}, {0x00010028, 0x0001003A}, {0x0001003C, 0x0001003D}, {0x0001003F, 0x0001004D}, {0x00010050, 0x0001005D}, {0x00010080, 0x000100FA}, {0x00010140, 0x00010174}, {0x00010280, 0x0001029C}, {0x000102A0, 0x000102D0}, {0x00010300, 0x0001031F}, {0x0001032D, 0x0001034A}, {0x00010350, 0x0001037A}, {0x00010380, 0x0001039D}, {0x000103A0, 0x000103C3}, {0x000103C8, 0x000103CF}, {0x000103D1, 0x000103D5}, {0x00010400, 0x0001049D}, {0x000104A0, 0x000104A9}, {0x000104B0, 0x000104D3}, {0x000104D8, 0x000104FB}, {0x00010500, 0x00010527}, {0x00010530, 0x00010563}, {0x00010600, 0x00010736}, {0x00010740, 0x00010755}, {0x00010760, 0x00010767}, {0x00010800, 0x00010805}, {0x0001080A, 0x00010835}, {0x00010837, 0x00010838}, {0x0001083F, 0x00010855}, {0x00010860, 0x00010876}, {0x00010880, 0x0001089E}, {0x000108E0, 0x000108F2}, {0x000108F4, 0x000108F5}, {0x00010900, 0x00010915}, {0x00010920, 0x00010939}, {0x00010980, 0x000109B7}, {0x000109BE, 0x000109BF}, {0x00010A00, 0x00010A03}, {0x00010A05, 0x00010A06}, {0x00010A0C, 0x00010A13}, {0x00010A15, 0x00010A17}, {0x00010A19, 0x00010A33}, {0x00010A60, 0x00010A7C}, {0x00010A80, 0x00010A9C}, {0x00010AC0, 0x00010AC7}, {0x00010AC9, 0x00010AE4}, {0x00010B00, 0x00010B35}, {0x00010B40, 0x00010B55}, {0x00010B60, 0x00010B72}, {0x00010B80, 0x00010B91}, {0x00010C00, 0x00010C48}, {0x00010C80, 0x00010CB2}, {0x00010CC0, 0x00010CF2}, {0x00011000, 0x00011045}, {0x00011066, 0x0001106F}, {0x00011082, 0x000110B8}, {0x000110D0, 0x000110E8}, {0x000110F0, 0x000110F9}, {0x00011100, 0x00011132}, {0x00011136, 0x0001113F}, {0x00011150, 0x00011172}, {0x00011180, 0x000111BF}, {0x000111C1, 0x000111C4}, {0x000111D0, 0x000111DA}, {0x00011200, 0x00011211}, {0x00011213, 0x00011234}, {0x00011280, 0x00011286}, {0x0001128A, 0x0001128D}, {0x0001128F, 0x0001129D}, {0x0001129F, 0x000112A8}, {0x000112B0, 0x000112E8}, {0x000112F0, 0x000112F9}, {0x00011300, 0x00011303}, {0x00011305, 0x0001130C}, {0x0001130F, 0x00011310}, {0x00011313, 0x00011328}, {0x0001132A, 0x00011330}, {0x00011332, 0x00011333}, {0x00011335, 0x00011339}, {0x0001133D, 0x00011344}, {0x00011347, 0x00011348}, {0x0001134B, 0x0001134C}, {0x0001135D, 0x00011363}, {0x00011400, 0x00011441}, {0x00011443, 0x00011445}, {0x00011447, 0x0001144A}, {0x00011450, 0x00011459}, {0x00011480, 0x000114C1}, {0x000114C4, 0x000114C5}, {0x000114D0, 0x000114D9}, {0x00011580, 0x000115B5}, {0x000115B8, 0x000115BE}, {0x000115D8, 0x000115DD}, {0x00011600, 0x0001163E}, {0x00011650, 0x00011659}, {0x00011680, 0x000116B5}, {0x000116C0, 0x000116C9}, {0x00011700, 0x00011719}, {0x0001171D, 0x0001172A}, {0x00011730, 0x00011739}, {0x000118A0, 0x000118E9}, {0x00011A00, 0x00011A32}, {0x00011A35, 0x00011A3E}, {0x00011A50, 0x00011A83}, {0x00011A86, 0x00011A97}, {0x00011AC0, 0x00011AF8}, {0x00011C00, 0x00011C08}, {0x00011C0A, 0x00011C36}, {0x00011C38, 0x00011C3E}, {0x00011C50, 0x00011C59}, {0x00011C72, 0x00011C8F}, {0x00011C92, 0x00011CA7}, {0x00011CA9, 0x00011CB6}, {0x00011D00, 0x00011D06}, {0x00011D08, 0x00011D09}, {0x00011D0B, 0x00011D36}, {0x00011D3C, 0x00011D3D}, {0x00011D3F, 0x00011D41}, {0x00011D46, 0x00011D47}, {0x00011D50, 0x00011D59}, {0x00012000, 0x00012399}, {0x00012400, 0x0001246E}, {0x00012480, 0x00012543}, {0x00013000, 0x0001342E}, {0x00014400, 0x00014646}, {0x00016800, 0x00016A38}, {0x00016A40, 0x00016A5E}, {0x00016A60, 0x00016A69}, {0x00016AD0, 0x00016AED}, {0x00016B00, 0x00016B36}, {0x00016B40, 0x00016B43}, {0x00016B50, 0x00016B59}, {0x00016B63, 0x00016B77}, {0x00016B7D, 0x00016B8F}, {0x00016F00, 0x00016F44}, {0x00016F50, 0x00016F7E}, {0x00016F93, 0x00016F9F}, {0x00016FE0, 0x00016FE1}, {0x00017000, 0x000187EC}, {0x00018800, 0x00018AF2}, {0x0001B000, 0x0001B11E}, {0x0001B170, 0x0001B2FB}, {0x0001BC00, 0x0001BC6A}, {0x0001BC70, 0x0001BC7C}, {0x0001BC80, 0x0001BC88}, {0x0001BC90, 0x0001BC99}, {0x0001D400, 0x0001D454}, {0x0001D456, 0x0001D49C}, {0x0001D49E, 0x0001D49F}, {0x0001D4A5, 0x0001D4A6}, {0x0001D4A9, 0x0001D4AC}, {0x0001D4AE, 0x0001D4B9}, {0x0001D4BD, 0x0001D4C3}, {0x0001D4C5, 0x0001D505}, {0x0001D507, 0x0001D50A}, {0x0001D50D, 0x0001D514}, {0x0001D516, 0x0001D51C}, {0x0001D51E, 0x0001D539}, {0x0001D53B, 0x0001D53E}, {0x0001D540, 0x0001D544}, {0x0001D54A, 0x0001D550}, {0x0001D552, 0x0001D6A5}, {0x0001D6A8, 0x0001D6C0}, {0x0001D6C2, 0x0001D6DA}, {0x0001D6DC, 0x0001D6FA}, {0x0001D6FC, 0x0001D714}, {0x0001D716, 0x0001D734}, {0x0001D736, 0x0001D74E}, {0x0001D750, 0x0001D76E}, {0x0001D770, 0x0001D788}, {0x0001D78A, 0x0001D7A8}, {0x0001D7AA, 0x0001D7C2}, {0x0001D7C4, 0x0001D7CB}, {0x0001D7CE, 0x0001D7FF}, {0x0001E000, 0x0001E006}, {0x0001E008, 0x0001E018}, {0x0001E01B, 0x0001E021}, {0x0001E023, 0x0001E024}, {0x0001E026, 0x0001E02A}, {0x0001E800, 0x0001E8C4}, {0x0001E900, 0x0001E943}, {0x0001E950, 0x0001E959}, {0x0001EE00, 0x0001EE03}, {0x0001EE05, 0x0001EE1F}, {0x0001EE21, 0x0001EE22}, {0x0001EE29, 0x0001EE32}, {0x0001EE34, 0x0001EE37}, {0x0001EE4D, 0x0001EE4F}, {0x0001EE51, 0x0001EE52}, {0x0001EE61, 0x0001EE62}, {0x0001EE67, 0x0001EE6A}, {0x0001EE6C, 0x0001EE72}, {0x0001EE74, 0x0001EE77}, {0x0001EE79, 0x0001EE7C}, {0x0001EE80, 0x0001EE89}, {0x0001EE8B, 0x0001EE9B}, {0x0001EEA1, 0x0001EEA3}, {0x0001EEA5, 0x0001EEA9}, {0x0001EEAB, 0x0001EEBB}, {0x0001F130, 0x0001F149}, {0x0001F150, 0x0001F169}, {0x0001F170, 0x0001F189}, {0x00020000, 0x0002A6D6}, {0x0002A700, 0x0002B734}, {0x0002B740, 0x0002B81D}, {0x0002B820, 0x0002CEA1}, {0x0002CEB0, 0x0002EBE0}, {0x0002F800, 0x0002FA1D} }; static const unsigned utf8_chars[] = { 0x000000AA, 0x000000B5, 0x000000BA, 0x000002EC, 0x000002EE, 0x00000345, 0x0000037F, 0x00000386, 0x0000038C, 0x00000559, 0x000005BF, 0x000005C7, 0x000006FF, 0x000007FA, 0x000009B2, 0x000009CE, 0x000009D7, 0x000009FC, 0x00000A51, 0x00000A5E, 0x00000AD0, 0x00000B71, 0x00000B9C, 0x00000BD0, 0x00000BD7, 0x00000CDE, 0x00000D4E, 0x00000DBD, 0x00000DD6, 0x00000E4D, 0x00000E84, 0x00000E8A, 0x00000E8D, 0x00000EA5, 0x00000EA7, 0x00000EC6, 0x00000ECD, 0x00000F00, 0x00001038, 0x0000108E, 0x000010C7, 0x000010CD, 0x00001258, 0x000012C0, 0x0000135F, 0x000017D7, 0x000017DC, 0x00001AA7, 0x00001F59, 0x00001F5B, 0x00001F5D, 0x00001FBE, 0x00002071, 0x0000207F, 0x00002102, 0x00002107, 0x00002115, 0x00002124, 0x00002126, 0x00002128, 0x0000214E, 0x00002D27, 0x00002D2D, 0x00002D6F, 0x00002E2F, 0x0000A8C5, 0x0000A8FB, 0x0000A8FD, 0x0000AA7A, 0x0000AAC0, 0x0000AAC2, 0x0000FB3E, 0x00010808, 0x0001083C, 0x00011176, 0x000111DC, 0x00011237, 0x0001123E, 0x00011288, 0x00011350, 0x00011357, 0x000114C7, 0x00011640, 0x00011644, 0x000118FF, 0x00011C40, 0x00011D3A, 0x00011D43, 0x0001BC9E, 0x0001D4A2, 0x0001D4BB, 0x0001D546, 0x0001E947, 0x0001EE24, 0x0001EE27, 0x0001EE39, 0x0001EE3B, 0x0001EE42, 0x0001EE47, 0x0001EE49, 0x0001EE4B, 0x0001EE54, 0x0001EE57, 0x0001EE59, 0x0001EE5B, 0x0001EE5D, 0x0001EE5F, 0x0001EE64, 0x0001EE7E }; /* END::UTF8TABLE */ static inline size_t utf8towc(unsigned *wc, const unsigned char *uc, size_t len) { unsigned char ub = utf8_mblen[*uc]; if (!ub || ub > len || ub > 4) { return 0; } *wc = *uc & utf8_mask[ub]; switch (ub) { case 4: if ((uc[1] & 0xc0) != 0x80) { return 0; } *wc <<= 6; *wc += *++uc & 0x3f; /* no break */ case 3: if ((uc[1] & 0xc0) != 0x80) { return 0; } *wc <<= 6; *wc += *++uc & 0x3f; /* no break */ case 2: if ((uc[1] & 0xc0) != 0x80) { return 0; } *wc <<= 6; *wc += *++uc & 0x3f; /* no break */ case 1: break; default: return 0; } return ub; } static inline zend_bool isualpha(unsigned ch) { unsigned hi = sizeof(utf8_ranges)/sizeof(utf8_ranges[0])-1, cur = hi/2, lo = 0, prev; #undef u #define u (utf8_ranges[cur]) do { #if 0 fprintf(stderr, "=> cur=%u lo=%u hi=%u (%u in %u-%u)\n", cur, lo, hi, ch, u.start, u.end); #endif if (u.start <= ch && u.end >= ch) { return 1; } prev = cur; if (u.start > ch) { hi = cur; cur -= (cur - lo) / 2; } else if ((u.end && u.end < ch) || (!u.end && u.start < ch)) { lo = cur; cur += (hi - cur) / 2; } else { break; } } while (cur != prev); #undef u #define u (utf8_chars[cur]) hi = sizeof(utf8_chars)/sizeof(utf8_chars[0]); cur = hi/2; lo = 0; do { #if 0 fprintf(stderr, "=> cur=%u lo=%u hi=%u (%u is %u)\n", cur, lo, hi, ch, u); #endif if (u == ch) { return 1; } prev = cur; if (u > ch) { hi = cur; cur -= (cur - lo) / 2; } else { lo = cur; cur += (hi - cur) / 2; } } while (cur != prev); #undef u return 0; } static inline zend_bool isualnum(unsigned ch) { /* digits */ if (ch >= 0x30 && ch <= 0x39) { return 1; } return isualpha(ch); } static inline size_t wctoutf16(unsigned short u16[2], unsigned wc) { if (wc > 0x10ffff || (wc >= 0xd800 && wc <= 0xdfff)) { return 0; } if (wc <= 0xffff) { u16[0] = (unsigned short) wc; return 1; } wc -= 0x10000; u16[0] = (unsigned short) ((wc >> 10) + 0xd800); u16[1] = (unsigned short) ((wc & 0x3ff) + 0xdc00); return 2; } static inline size_t utf16towc(unsigned *wc, unsigned short *u16_str, size_t u16_len) { if (u16_len < 1) { return 0; } if (u16_str[0] - 0xd800 >= 0x800) { *wc = u16_str[0]; return 1; } if (u16_len < 2 || (u16_str[0] & 0xfffffc00) != 0xd800 || (u16_str[1] & 0xfffffc00) != 0xdc00) { return 0; } *wc = (u16_str[0] << 10) + u16_str[1] - 0x35fdc00; return 2; } #endif /* PHP_HTTP_UTF8_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \# php_http_message.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_MESSAGE_H #define PHP_HTTP_MESSAGE_H #include "php_http_message_body.h" #include "php_http_header.h" /* required minimum length of an HTTP message "HTTP/1.1" */ #define PHP_HTTP_MESSAGE_MIN_SIZE 8 #define PHP_HTTP_MESSAGE_TYPE(TYPE, msg) ((msg) && ((msg)->type == PHP_HTTP_ ##TYPE)) typedef php_http_info_type_t php_http_message_type_t; typedef struct php_http_message php_http_message_t; struct php_http_message { PHP_HTTP_INFO_IMPL(http, type) HashTable hdrs; php_http_message_body_t *body; php_http_message_t *parent; void *opaque; }; PHP_HTTP_API zend_bool php_http_message_info_callback(php_http_message_t **message, HashTable **headers, php_http_info_t *info); PHP_HTTP_API php_http_message_t *php_http_message_init(php_http_message_t *m, php_http_message_type_t t, php_http_message_body_t *body); PHP_HTTP_API php_http_message_t *php_http_message_init_env(php_http_message_t *m, php_http_message_type_t t); PHP_HTTP_API php_http_message_t *php_http_message_copy_ex(php_http_message_t *from, php_http_message_t *to, zend_bool parents); static inline php_http_message_t *php_http_message_copy(php_http_message_t *from, php_http_message_t *to) { return php_http_message_copy_ex(from, to, 1); } PHP_HTTP_API void php_http_message_dtor(php_http_message_t *message); PHP_HTTP_API void php_http_message_free(php_http_message_t **message); PHP_HTTP_API void php_http_message_set_type(php_http_message_t *m, php_http_message_type_t t); PHP_HTTP_API void php_http_message_set_info(php_http_message_t *message, php_http_info_t *info); PHP_HTTP_API void php_http_message_update_headers(php_http_message_t *msg); PHP_HTTP_API zval *php_http_message_header(php_http_message_t *msg, const char *key_str, size_t key_len); static inline zend_string *php_http_message_header_string(php_http_message_t *msg, const char *key_str, size_t key_len) { zval *header; if ((header = php_http_message_header(msg, key_str, key_len))) { return php_http_header_value_to_string(header); } return NULL; } PHP_HTTP_API zend_bool php_http_message_is_multipart(php_http_message_t *msg, char **boundary); PHP_HTTP_API void php_http_message_to_string(php_http_message_t *msg, char **string, size_t *length); PHP_HTTP_API void php_http_message_to_struct(php_http_message_t *msg, zval *strct); PHP_HTTP_API void php_http_message_to_callback(php_http_message_t *msg, php_http_pass_callback_t cb, void *cb_arg); PHP_HTTP_API void php_http_message_serialize(php_http_message_t *message, char **string, size_t *length); PHP_HTTP_API php_http_message_t *php_http_message_reverse(php_http_message_t *msg); PHP_HTTP_API php_http_message_t *php_http_message_zip(php_http_message_t *one, php_http_message_t *two); static inline size_t php_http_message_count(php_http_message_t *m) { size_t c = 1; while ((m = m->parent)) { ++c; } return c; } PHP_HTTP_API php_http_message_t *php_http_message_parse(php_http_message_t *msg, const char *str, size_t len, zend_bool greedy); typedef struct php_http_message_object { php_http_message_t *message; struct php_http_message_object *parent; php_http_message_body_object_t *body; zval iterator, *gc; zend_object zo; } php_http_message_object_t; PHP_HTTP_API zend_class_entry *php_http_message_get_class_entry(void); PHP_MINIT_FUNCTION(http_message); PHP_MSHUTDOWN_FUNCTION(http_message); void php_http_message_object_prepend(zval *this_ptr, zval *prepend, zend_bool top /* = 1 */); void php_http_message_object_reverse(zval *this_ptr, zval *return_value); ZEND_RESULT_CODE php_http_message_object_set_body(php_http_message_object_t *obj, zval *zbody); ZEND_RESULT_CODE php_http_message_object_init_body_object(php_http_message_object_t *obj); zend_object *php_http_message_object_new(zend_class_entry *ce); php_http_message_object_t *php_http_message_object_new_ex(zend_class_entry *ce, php_http_message_t *msg); zend_object *php_http_message_object_clone(zend_object *object); void php_http_message_object_free(zend_object *object); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \xR php_http_client_curl_user.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CLIENT_CURL_USER_H #define PHP_HTTP_CLIENT_CURL_USER_H #if PHP_HTTP_HAVE_LIBCURL typedef struct php_http_client_curl_user_context { php_http_client_t *client; zval user; zend_function closure; php_http_object_method_t timer; php_http_object_method_t socket; php_http_object_method_t once; php_http_object_method_t wait; php_http_object_method_t send; } php_http_client_curl_user_context_t; PHP_HTTP_API zend_class_entry *php_http_client_curl_user_get_class_entry(); PHP_HTTP_API php_http_client_curl_ops_t *php_http_client_curl_user_ops_get(); PHP_MINIT_FUNCTION(http_client_curl_user); #endif #if 0 | +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_HEADER_PARSER_H #define PHP_HTTP_HEADER_PARSER_H #include "php_http_info.h" typedef enum php_http_header_parser_state { PHP_HTTP_HEADER_PARSER_STATE_FAILURE = FAILURE, PHP_HTTP_HEADER_PARSER_STATE_START = 0, PHP_HTTP_HEADER_PARSER_STATE_KEY, PHP_HTTP_HEADER_PARSER_STATE_VALUE, PHP_HTTP_HEADER_PARSER_STATE_VALUE_EX, PHP_HTTP_HEADER_PARSER_STATE_HEADER_DONE, PHP_HTTP_HEADER_PARSER_STATE_DONE } php_http_header_parser_state_t; #define PHP_HTTP_HEADER_PARSER_CLEANUP 0x1 typedef struct php_http_header_parser { zend_ptr_stack stack; php_http_info_t info; struct { char *str; size_t len; } _key; struct { char *str; size_t len; } _val; } php_http_header_parser_t; PHP_HTTP_API php_http_header_parser_t *php_http_header_parser_init(php_http_header_parser_t *parser); PHP_HTTP_API php_http_header_parser_state_t php_http_header_parser_state_is(php_http_header_parser_t *parser); PHP_HTTP_API void php_http_header_parser_dtor(php_http_header_parser_t *parser); PHP_HTTP_API void php_http_header_parser_free(php_http_header_parser_t **parser); PHP_HTTP_API php_http_header_parser_state_t php_http_header_parser_parse(php_http_header_parser_t *parser, php_http_buffer_t *buffer, unsigned flags, HashTable *headers, php_http_info_callback_t callback_func, void *callback_arg); PHP_HTTP_API php_http_header_parser_state_t php_http_headerparser_parse_stream(php_http_header_parser_t *parser, php_http_buffer_t *buffer, php_stream *s, unsigned flags, HashTable *headers, php_http_info_callback_t callback_func, void *callback_arg); typedef struct php_http_header_parser_object { php_http_buffer_t *buffer; php_http_header_parser_t *parser; zend_object zo; } php_http_header_parser_object_t; PHP_HTTP_API zend_class_entry *php_http_get_header_parser_class_entry(void); PHP_MINIT_FUNCTION(http_header_parser); zend_object *php_http_header_parser_object_new(zend_class_entry *ce); php_http_header_parser_object_t *php_http_header_parser_object_new_ex(zend_class_entry *ce, php_http_header_parser_t *parser); void php_http_header_parser_object_free(zend_object *object); #endif /* PHP_HTTP_HEADER_PARSER_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \6 6 php_http_etag.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ETAG_H #define PHP_HTTP_ETAG_H #include "ext/hash/php_hash.h" typedef struct php_http_etag { const php_hash_ops *ops; char ctx[1]; } php_http_etag_t; PHP_HTTP_API php_http_etag_t *php_http_etag_init(const char *mode); PHP_HTTP_API size_t php_http_etag_update(php_http_etag_t *e, const char *data_ptr, size_t data_len); PHP_HTTP_API char *php_http_etag_finish(php_http_etag_t *e); static inline char *php_http_etag_digest(const unsigned char *digest, int len) { static const char hexdigits[17] = "0123456789abcdef"; int i; char *hex = emalloc(len * 2 + 1); char *ptr = hex; for (i = 0; i < len; ++i) { *ptr++ = hexdigits[digest[i] >> 4]; *ptr++ = hexdigits[digest[i] & 0xF]; } *ptr = '\0'; return hex; } #endif /* PHP_HTTP_ETAG_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \B IS php_http_env_response.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ENV_RESPONSE_H #define PHP_HTTP_ENV_RESPONSE_H typedef struct php_http_env_response php_http_env_response_t; typedef struct php_http_env_response_ops { ZEND_RESULT_CODE (*init)(php_http_env_response_t *r, void *arg); void (*dtor)(php_http_env_response_t *r); long (*get_status)(php_http_env_response_t *r); ZEND_RESULT_CODE (*set_status)(php_http_env_response_t *r, long http_code); ZEND_RESULT_CODE (*set_protocol_version)(php_http_env_response_t *r, php_http_version_t *v); ZEND_RESULT_CODE (*set_header)(php_http_env_response_t *r, const char *fmt, ...); ZEND_RESULT_CODE (*add_header)(php_http_env_response_t *r, const char *fmt, ...); ZEND_RESULT_CODE (*del_header)(php_http_env_response_t *r, const char *header_str, size_t header_len); ZEND_RESULT_CODE (*write)(php_http_env_response_t *r, const char *data_str, size_t data_len); ZEND_RESULT_CODE (*flush)(php_http_env_response_t *r); ZEND_RESULT_CODE (*finish)(php_http_env_response_t *r); } php_http_env_response_ops_t; PHP_HTTP_API php_http_env_response_ops_t *php_http_env_response_get_sapi_ops(void); PHP_HTTP_API php_http_env_response_ops_t *php_http_env_response_get_stream_ops(void); struct php_http_env_response { void *ctx; php_http_env_response_ops_t *ops; php_http_cookie_list_t *cookies; php_http_buffer_t *buffer; zval options; struct { size_t chunk; double delay; } throttle; struct { php_http_range_status_t status; HashTable values; char boundary[32]; } range; struct { size_t length; char *type; char *encoding; php_http_encoding_stream_t *encoder; } content; zend_bool done; }; PHP_HTTP_API php_http_env_response_t *php_http_env_response_init(php_http_env_response_t *r, zval *options, php_http_env_response_ops_t *ops, void *ops_ctx); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_response_send(php_http_env_response_t *r); PHP_HTTP_API void php_http_env_response_dtor(php_http_env_response_t *r); PHP_HTTP_API void php_http_env_response_free(php_http_env_response_t **r); PHP_HTTP_API php_http_cache_status_t php_http_env_is_response_cached_by_etag(zval *options, const char *header_str, size_t header_len, php_http_message_t *request); PHP_HTTP_API php_http_cache_status_t php_http_env_is_response_cached_by_last_modified(zval *options, const char *header_str, size_t header_len, php_http_message_t *request); PHP_HTTP_API zend_class_entry *php_http_get_env_response_class_entry(); PHP_MINIT_FUNCTION(http_env_response); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \~> > php_http_encoding_brotli.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ENCODING_BROTLI_H #define PHP_HTTP_ENCODING_BROTLI_H #if PHP_HTTP_HAVE_LIBBROTLI #include
#include
extern PHP_MINIT_FUNCTION(http_encoding_brotli); PHP_HTTP_API zend_class_entry *php_http_get_enbrotli_stream_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_debrotli_stream_class_entry(void); PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_enbrotli_ops(void); PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_debrotli_ops(void); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_enbrotli(int flags, const char *data, size_t data_len, char **encoded, size_t *encoded_len); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_debrotli(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len); #define PHP_HTTP_ENBROTLI_LEVEL_MIN 0x00000001 #define PHP_HTTP_ENBROTLI_LEVEL_DEF 0x00000004 #define PHP_HTTP_ENBROTLI_LEVEL_MAX 0x0000000b #define PHP_HTTP_ENBROTLI_WBITS_MIN 0x000000a0 #define PHP_HTTP_ENBROTLI_WBITS_DEF 0x00000160 #define PHP_HTTP_ENBROTLI_WBITS_MAX 0x00000180 #define PHP_HTTP_ENBROTLI_MODE_GENERIC 0x00000000 #define PHP_HTTP_ENBROTLI_MODE_TEXT 0x00001000 #define PHP_HTTP_ENBROTLI_MODE_FONT 0x00002000 #endif #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \H" php_http_version.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_VERSION_H #define PHP_HTTP_VERSION_H typedef struct php_http_version { unsigned major; unsigned minor; } php_http_version_t; PHP_HTTP_API php_http_version_t *php_http_version_init(php_http_version_t *v, unsigned major, unsigned minor); PHP_HTTP_API php_http_version_t *php_http_version_parse(php_http_version_t *v, const char *str); PHP_HTTP_API void php_http_version_to_string(php_http_version_t *v, char **str, size_t *len, const char *pre, const char *post); PHP_HTTP_API void php_http_version_dtor(php_http_version_t *v); PHP_HTTP_API void php_http_version_free(php_http_version_t **v); #endif /* PHP_HTTP_VERSION_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \V [ [ php_http_message_body.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_MESSAGE_BODY_H #define PHP_HTTP_MESSAGE_BODY_H typedef struct php_http_message_body { php_stream_statbuf ssb; zend_resource *res; char *boundary; unsigned refcount; } php_http_message_body_t; struct php_http_message; PHP_HTTP_API php_http_message_body_t *php_http_message_body_init(php_http_message_body_t **body, php_stream *stream); PHP_HTTP_API unsigned php_http_message_body_addref(php_http_message_body_t *body); PHP_HTTP_API php_http_message_body_t *php_http_message_body_copy(php_http_message_body_t *from, php_http_message_body_t *to); PHP_HTTP_API ZEND_RESULT_CODE php_http_message_body_add_form(php_http_message_body_t *body, HashTable *fields, HashTable *files); PHP_HTTP_API ZEND_RESULT_CODE php_http_message_body_add_form_field(php_http_message_body_t *body, const char *name, const char *value_str, size_t value_len); PHP_HTTP_API ZEND_RESULT_CODE php_http_message_body_add_form_file(php_http_message_body_t *body, const char *name, const char *ctype, const char *file, php_stream *stream); PHP_HTTP_API void php_http_message_body_add_part(php_http_message_body_t *body, struct php_http_message *part); PHP_HTTP_API size_t php_http_message_body_append(php_http_message_body_t *body, const char *buf, size_t len); PHP_HTTP_API size_t php_http_message_body_appendf(php_http_message_body_t *body, const char *fmt, ...); PHP_HTTP_API zend_string *php_http_message_body_to_string(php_http_message_body_t *body, off_t offset, size_t forlen); PHP_HTTP_API ZEND_RESULT_CODE php_http_message_body_to_stream(php_http_message_body_t *body, php_stream *s, off_t offset, size_t forlen); PHP_HTTP_API ZEND_RESULT_CODE php_http_message_body_to_callback(php_http_message_body_t *body, php_http_pass_callback_t cb, void *cb_arg, off_t offset, size_t forlen); PHP_HTTP_API void php_http_message_body_free(php_http_message_body_t **body); PHP_HTTP_API const php_stream_statbuf *php_http_message_body_stat(php_http_message_body_t *body); PHP_HTTP_API char *php_http_message_body_etag(php_http_message_body_t *body); PHP_HTTP_API const char *php_http_message_body_boundary(php_http_message_body_t *body); PHP_HTTP_API struct php_http_message *php_http_message_body_split(php_http_message_body_t *body, const char *boundary); static inline size_t php_http_message_body_size(php_http_message_body_t *b) { return php_http_message_body_stat(b)->sb.st_size; } static inline time_t php_http_message_body_mtime(php_http_message_body_t *b) { return php_http_message_body_stat(b)->sb.st_mtime; } static inline php_stream *php_http_message_body_stream(php_http_message_body_t *body) { return body && body->res ? body->res->ptr : NULL; } static inline zend_resource *php_http_message_body_resource(php_http_message_body_t *body) { return body ? body->res : NULL; } typedef struct php_http_message_body_object { php_http_message_body_t *body; zval *gc; zend_object zo; } php_http_message_body_object_t; PHP_HTTP_API zend_class_entry *php_http_get_message_body_class_entry(void); PHP_MINIT_FUNCTION(http_message_body); zend_object *php_http_message_body_object_new(zend_class_entry *ce); php_http_message_body_object_t *php_http_message_body_object_new_ex(zend_class_entry *ce, php_http_message_body_t *body); zend_object *php_http_message_body_object_clone(zend_object *object); void php_http_message_body_object_free(zend_object *object); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \Si php_http_header.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_HEADERS_H #define PHP_HTTP_HEADERS_H #include "php_http_info.h" PHP_HTTP_API ZEND_RESULT_CODE php_http_header_parse(const char *header, size_t length, HashTable *headers, php_http_info_callback_t callback_func, void **callback_data); PHP_HTTP_API void php_http_header_to_callback(HashTable *headers, zend_bool crlf, php_http_pass_format_callback_t cb, void *cb_arg); PHP_HTTP_API void php_http_header_to_callback_ex(const char *key, zval *val, zend_bool crlf, php_http_pass_format_callback_t cb, void *cb_arg); PHP_HTTP_API void php_http_header_to_string(php_http_buffer_t *str, HashTable *headers); PHP_HTTP_API void php_http_header_to_string_ex(php_http_buffer_t *str, const char *key, zval *val); PHP_HTTP_API zend_string *php_http_header_value_to_string(zval *header); PHP_HTTP_API zend_string *php_http_header_value_array_to_string(zval *header); PHP_HTTP_API zend_class_entry *php_http_header_get_class_entry(void); PHP_MINIT_FUNCTION(http_header); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ php_http_cookie.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_COOKIE_H #define PHP_HTTP_COOKIE_H #define PHP_HTTP_COOKIE_SECURE 0x10L #define PHP_HTTP_COOKIE_HTTPONLY 0x20L #define PHP_HTTP_COOKIE_PARSE_RAW 0x01L /* generally a netscape cookie compliant struct, recognizing httpOnly attribute, too; cookie params like those from rfc2109 and rfc2965 are just put into extras, if one specifies them in allowed extras, else they're treated like cookies themself */ typedef struct php_http_cookie_list { HashTable cookies; HashTable extras; long flags; char *path; char *domain; time_t expires; time_t max_age; } php_http_cookie_list_t; PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_init(php_http_cookie_list_t *list); PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_parse(php_http_cookie_list_t *list, const char *str, size_t len, long flags, char **allowed_extras); PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_copy(php_http_cookie_list_t *from, php_http_cookie_list_t *to); PHP_HTTP_API void php_http_cookie_list_dtor(php_http_cookie_list_t *list); PHP_HTTP_API void php_http_cookie_list_free(php_http_cookie_list_t **list); #define php_http_cookie_list_has_cookie(list, name, name_len) zend_symtable_str_exists(&(list)->cookies, (name), (name_len)) #define php_http_cookie_list_del_cookie(list, name, name_len) zend_symtable_str_del(&(list)->cookies, (name), (name_len)) PHP_HTTP_API void php_http_cookie_list_add_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len, const char *value, size_t value_len); PHP_HTTP_API const char *php_http_cookie_list_get_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len, zval *cookie); #define php_http_cookie_list_has_extra(list, name, name_len) zend_symtable_str_exists(&(list)->extras, (name), (name_len)) #define php_http_cookie_list_del_extra(list, name, name_len) zend_symtable_str_del(&(list)->extras, (name), (name_len)) PHP_HTTP_API void php_http_cookie_list_add_extra(php_http_cookie_list_t *list, const char *name, size_t name_len, const char *value, size_t value_len); PHP_HTTP_API const char *php_http_cookie_list_get_extra(php_http_cookie_list_t *list, const char *name, size_t name_len, zval *extra); PHP_HTTP_API void php_http_cookie_list_to_string(php_http_cookie_list_t *list, char **str, size_t *len); PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_from_struct(php_http_cookie_list_t *list, zval *strct); PHP_HTTP_API void php_http_cookie_list_to_struct(php_http_cookie_list_t *list, zval *strct); PHP_HTTP_API zend_class_entry *php_http_cookie_get_class_entry(void); typedef struct php_http_cookie_object { php_http_cookie_list_t *list; zend_object zo; } php_http_cookie_object_t; zend_object *php_http_cookie_object_new(zend_class_entry *ce); php_http_cookie_object_t *php_http_cookie_object_new_ex(zend_class_entry *ce, php_http_cookie_list_t *list); zend_object *php_http_cookie_object_clone(zend_object *this_ptr); void php_http_cookie_object_free(zend_object *object); PHP_MINIT_FUNCTION(http_cookie); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ php_http_exception.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_EXCEPTION_H #define PHP_HTTP_EXCEPTION_H /* short hand for zend_throw_exception_ex */ #define php_http_throw(e, ...) \ zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, __VA_ARGS__) /* wrap a call with replaced zend_error_handling */ #define php_http_expect(test, e, fail) \ do { \ zend_error_handling __zeh; \ zend_replace_error_handling(EH_THROW, php_http_get_exception_ ##e## _class_entry(), &__zeh); \ if (UNEXPECTED(!(test))) { \ zend_restore_error_handling(&__zeh); \ fail; \ } \ zend_restore_error_handling(&__zeh); \ } while(0) PHP_HTTP_API zend_class_entry *php_http_get_exception_interface_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_runtime_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_unexpected_val_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_method_call_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_invalid_arg_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_header_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_url_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_message_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_conversion_class_entry(void); PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_querystring_class_entry(void); PHP_MINIT_FUNCTION(http_exception); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ci? ? php_http_object.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_OBJECT_H #define PHP_HTTP_OBJECT_H typedef struct php_http_object { void *intern; zend_object zo; } php_http_object_t; zend_object *php_http_object_new(zend_class_entry *ce); php_http_object_t *php_http_object_new_ex(zend_class_entry *ce, void *nothing); typedef void *(*php_http_new_t)(zend_class_entry *ce, void *); ZEND_RESULT_CODE php_http_new(void **obj_ptr, zend_class_entry *ce, php_http_new_t create, zend_class_entry *parent_ce, void *intern_ptr); PHP_MINIT_FUNCTION(http_object); typedef struct php_http_method { zend_fcall_info fci; zend_fcall_info_cache fcc; } php_http_object_method_t; php_http_object_method_t *php_http_object_method_init(php_http_object_method_t *cb, zval *zobject, const char *method_str, size_t method_len); ZEND_RESULT_CODE php_http_object_method_call(php_http_object_method_t *cb, zval *zobject, zval *retval, int argc, zval *args); void php_http_object_method_dtor(php_http_object_method_t *cb); void php_http_object_method_free(php_http_object_method_t **cb); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \~2 php_http_params.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_PARAMS_H #define PHP_HTTP_PARAMS_H typedef struct php_http_params_token { char *str; size_t len; } php_http_params_token_t; #define PHP_HTTP_PARAMS_RAW 0x00 #define PHP_HTTP_PARAMS_ESCAPED 0x01 #define PHP_HTTP_PARAMS_URLENCODED 0x04 #define PHP_HTTP_PARAMS_DIMENSION 0x08 #define PHP_HTTP_PARAMS_RFC5987 0x10 #define PHP_HTTP_PARAMS_RFC5988 0x20 #define PHP_HTTP_PARAMS_QUERY (PHP_HTTP_PARAMS_URLENCODED|PHP_HTTP_PARAMS_DIMENSION) #define PHP_HTTP_PARAMS_DEFAULT (PHP_HTTP_PARAMS_ESCAPED|PHP_HTTP_PARAMS_RFC5987) typedef struct php_http_params_opts { php_http_params_token_t input; php_http_params_token_t **param; php_http_params_token_t **arg; php_http_params_token_t **val; zval defval; unsigned flags; } php_http_params_opts_t; PHP_HTTP_API php_http_params_opts_t *php_http_params_opts_default_get(php_http_params_opts_t *opts); PHP_HTTP_API HashTable *php_http_params_parse(HashTable *params, const php_http_params_opts_t *opts); 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); PHP_HTTP_API php_http_params_token_t **php_http_params_separator_init(zval *zv); PHP_HTTP_API void php_http_params_separator_free(php_http_params_token_t **separator); typedef php_http_object_t php_http_params_object_t; PHP_HTTP_API zend_class_entry *php_http_params_get_class_entry(void); PHP_MINIT_FUNCTION(http_params); #define php_http_params_object_new php_http_object_new #define php_http_params_object_new_ex php_http_object_new_ex #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ g| | php_http_misc.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_MISC_H #define PHP_HTTP_MISC_H /* DEFAULTS */ /* DATE FORMAT RFC1123 */ #define PHP_HTTP_DATE_FORMAT "D, d M Y H:i:s \\G\\M\\T" /* CR LF */ #define PHP_HTTP_CRLF "\r\n" /* def URL arg separator */ #define PHP_HTTP_URL_ARGSEP "&" /* send buffer size */ #define PHP_HTTP_SENDBUF_SIZE 40960 /* allowed characters of header field names */ #define PHP_HTTP_HEADER_NAME_CHARS "!#$%&'*+-.^_`|~1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" /* SLEEP */ #define PHP_HTTP_DIFFSEC (0.001) #define PHP_HTTP_MLLISEC (1000) #define PHP_HTTP_MCROSEC (1000 * 1000) #define PHP_HTTP_NANOSEC (1000 * 1000 * 1000) #define PHP_HTTP_MSEC(s) ((long)(s * PHP_HTTP_MLLISEC)) #define PHP_HTTP_USEC(s) ((long)(s * PHP_HTTP_MCROSEC)) #define PHP_HTTP_NSEC(s) ((long)(s * PHP_HTTP_NANOSEC)) PHP_HTTP_API void php_http_sleep(double s); /* STRING UTILITIES */ #ifndef PTR_SET # define PTR_SET(STR, SET) \ { \ PTR_FREE(STR); \ STR = SET; \ } #endif #define STR_PTR(s) (s?s:"") #define lenof(S) (sizeof(S) - 1) #define PHP_HTTP_MATCH_LOOSE 0 #define PHP_HTTP_MATCH_CASE 0x01 #define PHP_HTTP_MATCH_WORD 0x10 #define PHP_HTTP_MATCH_FULL 0x20 #define PHP_HTTP_MATCH_STRICT (PHP_HTTP_MATCH_CASE|PHP_HTTP_MATCH_FULL) int php_http_match(const char *haystack, const char *needle, int flags); char *php_http_pretty_key(register char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen); size_t php_http_boundary(char *buf, size_t len); int php_http_select_str(const char *cmp, int argc, ...); #define php_http_locate_str(h, h_len, n, n_len) zend_memnstr((h), (n), (n_len), (h)+(h_len)) static inline const char *php_http_locate_eol(const char *line, int *eol_len) { const char *eol = strpbrk(line, "\r\n"); if (eol_len) { *eol_len = eol ? ((eol[0] == '\r' && eol[1] == '\n') ? 2 : 1) : 0; } return eol; } static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, int *eol_len) { register const char *eol = bin; while (len--) { if (UNEXPECTED(*eol == '\r' || *eol == '\n')) { if (EXPECTED(eol_len)) { *eol_len = (EXPECTED(eol[0] == '\r' && eol[1] == '\n') ? 2 : 1); } return eol; } ++eol; } return NULL; } /* ZEND */ #if PHP_DEBUG # undef HASH_OF # define HASH_OF(p) ((HashTable*)(Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties(Z_OBJ_P(p)) : NULL)))) #endif #if PHP_VERSION_ID >= 80100 # define php_http_mem_stream_open(type, zstr) php_stream_memory_open((type), (zstr)) #else # define php_http_mem_stream_open(type, zstr) php_stream_memory_open((type), (zstr)->val, (zstr)->len) # define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) # define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) #endif #define HT_IS_RECURSIVE(ht) GC_IS_RECURSIVE(ht) #define HT_PROTECT_RECURSION(ht) GC_PROTECT_RECURSION(ht) #define HT_UNPROTECT_RECURSION(ht) GC_UNPROTECT_RECURSION(ht) #ifndef convert_to_explicit_type # define convert_to_explicit_type(pzv, type) \ do { \ switch (type) { \ case IS_NULL: \ convert_to_null(pzv); \ break; \ case IS_LONG: \ convert_to_long(pzv); \ break; \ case IS_DOUBLE: \ convert_to_double(pzv); \ break; \ case _IS_BOOL: \ convert_to_boolean(pzv); \ break; \ case IS_ARRAY: \ convert_to_array(pzv); \ break; \ case IS_OBJECT: \ convert_to_object(pzv); \ break; \ case IS_STRING: \ convert_to_string(pzv); \ break; \ default: \ assert(0); \ break; \ } \ } while (0); #endif static inline void *PHP_HTTP_OBJ(zend_object *zo, zval *zv) { if (!zo) { zo = Z_OBJ_P(zv); } return (char *) zo - zo->handlers->offset; } static inline zend_string *php_http_cs2zs(char *s, size_t l) { zend_string *str = zend_string_init(s, l, 0); efree(s); return str; } static inline ZEND_RESULT_CODE php_http_ini_entry(const char *name_str, size_t name_len, const char **val_str, size_t *val_len, zend_bool orig) { zend_ini_entry *ini_entry; if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name_str, name_len))) { if (orig && ini_entry->modified) { *val_str = ini_entry->orig_value->val; *val_len = ini_entry->orig_value->len; } else { *val_str = ini_entry->value->val; *val_len = ini_entry->value->len; } return SUCCESS; } return FAILURE; } /* return object(values) */ #define ZVAL_OBJECT(z, o, addref) \ ZVAL_OBJ(z, o); \ if (addref) { \ Z_ADDREF_P(z); \ } #define RETVAL_OBJECT(o, addref) \ ZVAL_OBJECT(return_value, o, addref) #define RETURN_OBJECT(o, addref) \ RETVAL_OBJECT(o, addref); \ return #define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0, 0} #define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU) #define PHP_RINIT_CALL(func) PHP_RINIT(func)(INIT_FUNC_ARGS_PASSTHRU) #define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) #define PHP_RSHUTDOWN_CALL(func) PHP_RSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) /* ARRAYS */ PHP_HTTP_API unsigned php_http_array_list(HashTable *ht, unsigned argc, ...); typedef struct php_http_arrkey { zend_ulong h; zend_string *key; unsigned allocated:1; unsigned stringified:1; } php_http_arrkey_t; static inline void *php_http_arrkey_stringify(php_http_arrkey_t *arrkey, zend_hash_key *key) { if (arrkey) { arrkey->allocated = 0; } else { arrkey = emalloc(sizeof(*arrkey)); arrkey->allocated = 1; } if (key) { memcpy(arrkey, key, sizeof(*key)); } if ((arrkey->stringified = !arrkey->key)) { arrkey->key = zend_long_to_str(arrkey->h); } return arrkey; } static inline void php_http_arrkey_dtor(php_http_arrkey_t *arrkey) { if (arrkey->stringified) { zend_string_release(arrkey->key); } if (arrkey->allocated) { efree(arrkey); } } #define array_copy(src, dst) zend_hash_copy(dst, src, (copy_ctor_func_t) zval_add_ref) #define array_copy_strings(src, dst) zend_hash_copy(dst, src, php_http_array_copy_strings) #define ARRAY_JOIN_STRONLY 0x01 #define ARRAY_JOIN_PRETTIFY 0x02 #define ARRAY_JOIN_STRINGIFY 0x04 #define array_join(src, dst, append, flags) zend_hash_apply_with_arguments(src, (append)?php_http_array_apply_append_func:php_http_array_apply_merge_func, 2, dst, (int)flags) void php_http_array_copy_strings(zval *zp); int php_http_array_apply_append_func(zval *pDest, int num_args, va_list args, zend_hash_key *hash_key); int php_http_array_apply_merge_func(zval *pDest, int num_args, va_list args, zend_hash_key *hash_key); /* PASS CALLBACK */ typedef size_t (*php_http_pass_callback_t)(void *cb_arg, const char *str, size_t len); typedef size_t (*php_http_pass_php_http_buffer_callback_t)(void *cb_arg, php_http_buffer_t *str); typedef size_t (*php_http_pass_format_callback_t)(void *cb_arg, const char *fmt, ...); typedef struct php_http_pass_fcall_arg { zval fcz; zend_fcall_info fci; zend_fcall_info_cache fcc; } php_http_pass_fcall_arg_t; PHP_HTTP_API size_t php_http_pass_fcall_callback(void *cb_arg, const char *str, size_t len); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ހ php_http_filter.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_FILTER_H #define PHP_HTTP_FILTER_H PHP_HTTP_API php_stream_filter_factory php_http_filter_factory; PHP_MINIT_FUNCTION(http_filter); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \n~4 4 php_http_info.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_INFO_H #define PHP_HTTP_INFO_H #include "php_http_version.h" #include "php_http_url.h" typedef struct php_http_info_data { union { /* GET /foo/bar */ struct { char *method; php_http_url_t *url; } request; /* 200 Ok */ struct { unsigned code; char *status; } response; } info; php_http_version_t version; } php_http_info_data_t; #undef PHP_HTTP_REQUEST #undef PHP_HTTP_RESPONSE typedef enum php_http_info_type { PHP_HTTP_NONE = 0, PHP_HTTP_REQUEST, PHP_HTTP_RESPONSE } php_http_info_type_t; #define PHP_HTTP_INFO(ptr) (ptr)->http.info #define PHP_HTTP_INFO_IMPL(_http, _type) \ php_http_info_data_t _http; \ php_http_info_type_t _type; typedef struct php_http_info { PHP_HTTP_INFO_IMPL(http, type) } php_http_info_t; typedef zend_bool (*php_http_info_callback_t)(void **callback_data, HashTable **headers, php_http_info_t *info); PHP_HTTP_API php_http_info_t *php_http_info_init(php_http_info_t *info); PHP_HTTP_API php_http_info_t *php_http_info_parse(php_http_info_t *info, const char *pre_header); PHP_HTTP_API void php_http_info_to_string(php_http_info_t *info, char **str, size_t *len, const char *eol); PHP_HTTP_API void php_http_info_dtor(php_http_info_t *info); PHP_HTTP_API void php_http_info_free(php_http_info_t **info); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \_R php_http_env.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ENV_H #define PHP_HTTP_ENV_H #include "php_http_message_body.h" #include "php_http_version.h" struct php_http_env_globals { zval *server_var; char *etag_mode; struct { HashTable *headers; php_http_message_body_t *body; } request; }; typedef enum php_http_content_encoding { PHP_HTTP_CONTENT_ENCODING_NONE, PHP_HTTP_CONTENT_ENCODING_GZIP } php_http_content_encoding_t; typedef enum php_http_range_status { PHP_HTTP_RANGE_NO, PHP_HTTP_RANGE_OK, PHP_HTTP_RANGE_ERR } php_http_range_status_t; PHP_HTTP_API php_http_range_status_t php_http_env_get_request_ranges(HashTable *ranges, size_t entity_length, php_http_message_t *request); PHP_HTTP_API void php_http_env_get_request_headers(HashTable *headers); PHP_HTTP_API char *php_http_env_get_request_header(const char *name_str, size_t name_len, size_t *len, php_http_message_t *request); PHP_HTTP_API zend_bool php_http_env_got_request_header(const char *name_str, size_t name_len, php_http_message_t *request); PHP_HTTP_API php_http_message_body_t *php_http_env_get_request_body(void); PHP_HTTP_API const char *php_http_env_get_request_method(php_http_message_t *request); typedef enum php_http_content_disposition { PHP_HTTP_CONTENT_DISPOSITION_NONE, PHP_HTTP_CONTENT_DISPOSITION_INLINE, PHP_HTTP_CONTENT_DISPOSITION_ATTACHMENT } php_http_content_disposition_t; typedef enum php_http_cache_status { PHP_HTTP_CACHE_NO, PHP_HTTP_CACHE_HIT, PHP_HTTP_CACHE_MISS } php_http_cache_status_t; PHP_HTTP_API long php_http_env_get_response_code(void); PHP_HTTP_API const char *php_http_env_get_response_status_for_code(unsigned code); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_get_response_headers(HashTable *headers_ht); PHP_HTTP_API char *php_http_env_get_response_header(const char *name_str, size_t name_len); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_set_response_code(long http_code); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_set_response_protocol_version(php_http_version_t *v); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_set_response_header(long http_code, const char *header_str, size_t header_len, zend_bool replace); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_set_response_header_value(long http_code, const char *name_str, size_t name_len, zval *value, zend_bool replace); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_set_response_header_format(long http_code, zend_bool replace, const char *fmt, ...); PHP_HTTP_API ZEND_RESULT_CODE php_http_env_set_response_header_va(long http_code, zend_bool replace, const char *fmt, va_list argv); PHP_HTTP_API zval *php_http_env_get_server_var(const char *key_str, size_t key_len, zend_bool check); PHP_HTTP_API zval *php_http_env_get_superglobal(const char *key, size_t key_len); static inline zend_bool php_http_env_got_server_var(const char *v) { return NULL != php_http_env_get_server_var(v, strlen(v), 1); } PHP_HTTP_API void php_http_env_reset(); PHP_HTTP_API zend_class_entry *php_http_env_get_class_entry(void); PHP_MINIT_FUNCTION(http_env); PHP_RSHUTDOWN_FUNCTION(http_env); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ php_http_api.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_API_H #define PHP_HTTP_API_H #ifdef __COVERITY_GCC_VERSION_AT_LEAST # define _Float128 float # define _Float64 float # define _Float32 float # define _Float64x float # define _Float32x float #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef PHP_WIN32 #include "php_config.h" #endif #include "php.h" #include "SAPI.h" #include "ext/raphf/php_raphf_api.h" #include "ext/standard/php_string.h" #include "ext/spl/spl_iterators.h" #include "ext/date/php_date.h" #include "zend_interfaces.h" #include "zend_exceptions.h" #if PHP_WIN32 # define PHP_HTTP_API __declspec(dllexport) #elif __GNUC__ >= 4 # define PHP_HTTP_API extern __attribute__ ((visibility("default"))) #else # define PHP_HTTP_API extern #endif #if (HAVE_ICONV || PHP_HTTP_HAVE_EXT_ICONV) && (PHP_HTTP_SHARED_DEPS || !COMPILE_DL_ICONV) # define PHP_HTTP_HAVE_ICONV 1 #endif #if (HAVE_HASH_EXT || PHP_HTTP_HAVE_EXT_HASH) && (PHP_HTTP_SHARED_DEPS || !COMPILE_DL_HASH) # define PHP_HTTP_HAVE_HASH 1 #endif #include
#if PHP_WIN32 # define CURL_STATICLIB # include
#else # if HAVE_NETDB_H # include
# endif # if HAVE_UNISTD_H # include
# endif #endif #if HAVE_WCHAR_H && HAVE_WCTYPE_H && HAVE_ISWALNUM && (HAVE_MBRTOWC || HAVE_MBTOWC) # define PHP_HTTP_HAVE_WCHAR 1 #endif #include
#define PHP_HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c)) #define PHP_HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c)) #include "php_http.h" #include "php_http_buffer.h" #include "php_http_misc.h" #include "php_http_options.h" #include "php_http.h" #include "php_http_cookie.h" #include "php_http_encoding.h" #include "php_http_encoding_zlib.h" #include "php_http_encoding_brotli.h" #include "php_http_info.h" #include "php_http_message.h" #include "php_http_env.h" #include "php_http_env_request.h" #include "php_http_env_response.h" #include "php_http_etag.h" #include "php_http_exception.h" #include "php_http_filter.h" #include "php_http_header_parser.h" #include "php_http_header.h" #include "php_http_message_body.h" #include "php_http_message_parser.h" #include "php_http_negotiate.h" #include "php_http_object.h" #include "php_http_params.h" #include "php_http_querystring.h" #include "php_http_client.h" #include "php_http_curl.h" #include "php_http_client_request.h" #include "php_http_client_response.h" #include "php_http_client_curl.h" #include "php_http_client_curl_event.h" #include "php_http_client_curl_user.h" #include "php_http_url.h" #include "php_http_version.h" ZEND_BEGIN_MODULE_GLOBALS(php_http) struct php_http_env_globals env; #if PHP_HTTP_HAVE_CLIENT struct { # if PHP_HTTP_HAVE_LIBCURL struct php_http_client_curl_globals curl; # endif } client; #endif ZEND_END_MODULE_GLOBALS(php_http) ZEND_EXTERN_MODULE_GLOBALS(php_http); #if ZTS # include "TSRM/TSRM.h" # define PHP_HTTP_G ((zend_php_http_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(php_http_globals_id)]) # undef TSRMLS_FETCH_FROM_CTX # define TSRMLS_FETCH_FROM_CTX(ctx) ERROR #else # define PHP_HTTP_G (&php_http_globals) #endif #if PHP_DEBUG # define _DPF_STR 0 # define _DPF_IN 1 # define _DPF_OUT 2 extern void _dpf(int type, const char *data, size_t length); #else # define _dpf(t,s,l); #endif #endif /* PHP_HTTP_API_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \2V php_http_client_request.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CLIENT_REQUEST_H #define PHP_HTTP_CLIENT_REQUEST_H PHP_HTTP_API zend_class_entry *php_http_get_client_request_class_entry(void); PHP_MINIT_FUNCTION(http_client_request); #endif /* PHP_HTTP_CLIENT_REQUEST_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ Wx php_http_env_request.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ENV_REQUEST_H #define PHP_HTTP_ENV_REQUEST_H PHP_HTTP_API zend_class_entry *php_http_get_env_request_class_entry(void); PHP_MINIT_FUNCTION(http_env_request); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \g php_http_encoding.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ENCODING_H #define PHP_HTTP_ENCODING_H extern PHP_MINIT_FUNCTION(http_encoding); #define PHP_HTTP_ENCODING_STREAM_PERSISTENT 0x01000000 #define PHP_HTTP_ENCODING_STREAM_DIRTY 0x02000000 #define PHP_HTTP_ENCODING_STREAM_FLUSH_NONE 0x00000000 #define PHP_HTTP_ENCODING_STREAM_FLUSH_SYNC 0x00100000 #define PHP_HTTP_ENCODING_STREAM_FLUSH_FULL 0x00200000 #define PHP_HTTP_ENCODING_STREAM_FLUSH_FLAG(flags, full, sync, none) \ (((flags) & PHP_HTTP_ENCODING_STREAM_FLUSH_FULL) ? (full) : \ (((flags) & PHP_HTTP_ENCODING_STREAM_FLUSH_SYNC) ? (sync) : (none))) typedef struct php_http_encoding_stream php_http_encoding_stream_t; typedef php_http_encoding_stream_t *(*php_http_encoding_stream_init_func_t)(php_http_encoding_stream_t *s); typedef php_http_encoding_stream_t *(*php_http_encoding_stream_copy_func_t)(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to); typedef ZEND_RESULT_CODE (*php_http_encoding_stream_update_func_t)(php_http_encoding_stream_t *s, const char *in_str, size_t in_len, char **out_str, size_t *out_len); typedef ZEND_RESULT_CODE (*php_http_encoding_stream_flush_func_t)(php_http_encoding_stream_t *s, char **out_str, size_t *out_len); typedef zend_bool (*php_http_encoding_stream_done_func_t)(php_http_encoding_stream_t *s); typedef ZEND_RESULT_CODE (*php_http_encoding_stream_finish_func_t)(php_http_encoding_stream_t *s, char **out_str, size_t *out_len); typedef void (*php_http_encoding_stream_dtor_func_t)(php_http_encoding_stream_t *s); typedef struct php_http_encoding_stream_ops { php_http_encoding_stream_init_func_t init; php_http_encoding_stream_copy_func_t copy; php_http_encoding_stream_update_func_t update; php_http_encoding_stream_flush_func_t flush; php_http_encoding_stream_done_func_t done; php_http_encoding_stream_finish_func_t finish; php_http_encoding_stream_dtor_func_t dtor; } php_http_encoding_stream_ops_t; struct php_http_encoding_stream { unsigned flags; void *ctx; php_http_encoding_stream_ops_t *ops; }; PHP_HTTP_API php_http_encoding_stream_t *php_http_encoding_stream_init(php_http_encoding_stream_t *s, php_http_encoding_stream_ops_t *ops, unsigned flags); PHP_HTTP_API php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_stream_reset(php_http_encoding_stream_t **s); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_stream_update(php_http_encoding_stream_t *s, const char *in_str, size_t in_len, char **out_str, size_t *out_len); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_stream_flush(php_http_encoding_stream_t *s, char **out_str, size_t *len); PHP_HTTP_API zend_bool php_http_encoding_stream_done(php_http_encoding_stream_t *s); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_stream_finish(php_http_encoding_stream_t *s, char **out_str, size_t *len); PHP_HTTP_API void php_http_encoding_stream_dtor(php_http_encoding_stream_t *s); PHP_HTTP_API void php_http_encoding_stream_free(php_http_encoding_stream_t **s); PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_dechunk_ops(void); PHP_HTTP_API const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len); PHP_HTTP_API zend_class_entry *php_http_get_dechunk_stream_class_entry(void); typedef struct php_http_encoding_stream_object { php_http_encoding_stream_t *stream; zend_object zo; } php_http_encoding_stream_object_t; PHP_HTTP_API zend_class_entry *php_http_get_encoding_stream_class_entry(void); zend_object *php_http_encoding_stream_object_new(zend_class_entry *ce); php_http_encoding_stream_object_t *php_http_encoding_stream_object_new_ex(zend_class_entry *ce, php_http_encoding_stream_t *s); zend_object *php_http_encoding_stream_object_clone(zend_object *object); void php_http_encoding_stream_object_free(zend_object *object); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \I] php_http_client_curl.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CLIENT_CURL_H #define PHP_HTTP_CLIENT_CURL_H #if PHP_HTTP_HAVE_LIBCURL struct php_http_client_curl_globals { php_http_client_driver_t driver; }; typedef struct php_http_client_curl_handle { CURLM *multi; CURLSH *share; } php_http_client_curl_handle_t; typedef struct php_http_client_curl_ops { void *(*init)(); void (*dtor)(void **ctx_ptr); ZEND_RESULT_CODE (*once)(void *ctx); ZEND_RESULT_CODE (*wait)(void *ctx, struct timeval *custom_timeout); ZEND_RESULT_CODE (*exec)(void *ctx); } php_http_client_curl_ops_t; typedef struct php_http_client_curl { php_http_client_curl_handle_t *handle; int unfinished; /* int because of curl_multi_perform() */ void *ev_ctx; php_http_client_curl_ops_t *ev_ops; } php_http_client_curl_t; static inline void php_http_client_curl_get_timeout(php_http_client_curl_t *curl, long max_tout, struct timeval *timeout) { timeout->tv_sec = 0; timeout->tv_usec = 0; /* always returns CURLM_OK, check max_tout instead */ curl_multi_timeout(curl->handle->multi, &max_tout); if (!max_tout) { /* immediately */ return; } if (max_tout < 0) { /* 5ms */ max_tout = 5; } else if (max_tout > 1000) { /* 1s */ max_tout = 1000; } timeout->tv_sec = max_tout / 1000; timeout->tv_usec = (max_tout % 1000) * 1000; } PHP_HTTP_API void php_http_client_curl_responsehandler(php_http_client_t *client); PHP_HTTP_API void php_http_client_curl_loop(php_http_client_t *client, curl_socket_t s, int curl_action); PHP_HTTP_API php_http_client_ops_t *php_http_client_curl_get_ops(void); PHP_MINIT_FUNCTION(http_client_curl); PHP_MSHUTDOWN_FUNCTION(http_client_curl); #endif /* PHP_HTTP_HAVE_LIBCURL */ #endif /* PHP_HTTP_CLIENT_CURL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \u php_http_client_curl_event.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_CLIENT_CURL_EVENT_H #define PHP_HTTP_CLIENT_CURL_EVENT_H #if PHP_HTTP_HAVE_LIBCURL #if PHP_HTTP_HAVE_LIBEVENT php_http_client_curl_ops_t *php_http_client_curl_event_ops_get(); #endif #endif #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \1 1 php_http_encoding_zlib.hnu [ /* +--------------------------------------------------------------------+ | PECL :: http | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2004-2014, Michael Wallner
| +--------------------------------------------------------------------+ */ #ifndef PHP_HTTP_ENCODING_ZLIB_H #define PHP_HTTP_ENCODING_ZLIB_H #include "php_http_encoding.h" #include
#ifndef Z_FIXED /* Z_FIXED does not exist prior 1.2.2.2 */ # define Z_FIXED 0 #endif extern PHP_MINIT_FUNCTION(http_encoding_zlib); zend_class_entry *php_http_get_deflate_stream_class_entry(void); zend_class_entry *php_http_get_inflate_stream_class_entry(void); PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_deflate_ops(void); PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_inflate_ops(void); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_deflate(int flags, const char *data, size_t data_len, char **encoded, size_t *encoded_len); PHP_HTTP_API ZEND_RESULT_CODE php_http_encoding_inflate(const char *data, size_t data_len, char **decoded, size_t *decoded_len); #define PHP_HTTP_DEFLATE_LEVEL_DEF 0x00000000 #define PHP_HTTP_DEFLATE_LEVEL_MIN 0x00000001 #define PHP_HTTP_DEFLATE_LEVEL_MAX 0x00000009 #define PHP_HTTP_DEFLATE_TYPE_ZLIB 0x00000000 #define PHP_HTTP_DEFLATE_TYPE_GZIP 0x00000010 #define PHP_HTTP_DEFLATE_TYPE_RAW 0x00000020 #define PHP_HTTP_DEFLATE_STRATEGY_DEF 0x00000000 #define PHP_HTTP_DEFLATE_STRATEGY_FILT 0x00000100 #define PHP_HTTP_DEFLATE_STRATEGY_HUFF 0x00000200 #define PHP_HTTP_DEFLATE_STRATEGY_RLE 0x00000300 #define PHP_HTTP_DEFLATE_STRATEGY_FIXED 0x00000400 #define PHP_HTTP_INFLATE_TYPE_ZLIB 0x00000000 #define PHP_HTTP_INFLATE_TYPE_GZIP 0x00000000 #define PHP_HTTP_INFLATE_TYPE_RAW 0x00000001 #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK \ ) ) php_http_buffer.hnu [ PK \4* * R) php_http_curl.hnu [ PK \x"8 8 . php_http_url.hnu [ PK \Y 1A php_http_options.hnu [ PK \y>7M 7J php_http_client_response.hnu [ PK \ N php_http_client.hnu [ PK \ ZU U k php_http_querystring.hnu [ PK \k! ! 0s php_http_response_codes.hnu [ PK \M&( php_http.hnu [ PK \ = php_http_negotiate.hnu [ PK \/ php_http_message_parser.hnu [ PK \ /R /R php_http_utf8.hnu [ PK \# php_http_message.hnu [ PK \xR php_http_client_curl_user.hnu [ PK \= php_http_header_parser.hnu [ PK \6 6 php_http_etag.hnu [ PK \B IS )& php_http_env_response.hnu [ PK \~> > P3 php_http_encoding_brotli.hnu [ PK \H" ; php_http_version.hnu [ PK \V [ [ A php_http_message_body.hnu [ PK \Si vR php_http_header.hnu [ PK \ Y php_http_cookie.hnu [ PK \ i php_http_exception.hnu [ PK \ci? ? cr php_http_object.hnu [ PK \~2 y php_http_params.hnu [ PK \ g| | php_http_misc.hnu [ PK \ހ p php_http_filter.hnu [ PK \n~4 4 php_http_info.hnu [ PK \_R php_http_env.hnu [ PK \ @ php_http_api.hnu [ PK \2V php_http_client_request.hnu [ PK \ Wx php_http_env_request.hnu [ PK \g / php_http_encoding.hnu [ PK \I] php_http_client_curl.hnu [ PK \u php_http_client_curl_event.hnu [ PK \1 1 r php_http_encoding_zlib.hnu [ PK $ $