X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_api.h;h=2c54e2b3acfd939036e189843e52225f99c82a6a;hb=13dc652c45a4a0b4dc219e46065bb3310229cedc;hp=9f8eda9537900929c8313eb28fc7b8e45a97a966;hpb=36c32f8383f50e0c30585f9ae09e46b64b1597de;p=m6w6%2Fext-http diff --git a/php_http_api.h b/php_http_api.h index 9f8eda9..2c54e2b 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2005, Michael Wallner | + | Copyright (c) 2004-2006, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -124,6 +124,8 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen #define http_get_request_body_ex(b, l, d) _http_get_request_body_ex((b), (l), (d) TSRMLS_CC) PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC); +#define http_get_request_body_stream() _http_get_request_body_stream(TSRMLS_C) +PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D); #define http_locate_body _http_locate_body static inline const char *_http_locate_body(const char *message) @@ -192,6 +194,29 @@ static inline zval *_convert_to_type_ex(int type, zval *z, zval **p) return z; } +#define zval_copy(t, z) _zval_copy((t), (z) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +static inline zval *_zval_copy(int type, zval *z ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) +{ + zval *copy; + + copy = emalloc_rel(sizeof(zval)); + *copy = *z; + zval_copy_ctor(copy); + convert_to_type(type, copy); + copy->refcount = 0; + copy->is_ref = 0; + + return copy; +} + +#define zval_free(z) _zval_free(z) +static inline void _zval_free(zval **z) +{ + zval_dtor(*z); + FREE_ZVAL(*z); + *z = NULL; +} + #endif /*