reinitilaize http message prior throwing error
[m6w6/ext-http] / missing.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_MISSING
16 #define PHP_HTTP_MISSING
17
18 #include "php_version.h"
19
20 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3)
21 # define HTTP_ZAPI_CONST_CAST(t) (const t)
22 # define GLOBAL_ERROR_HANDLING EG(error_handling)
23 # define GLOBAL_EXCEPTION_CLASS EG(exception_class)
24 # define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC)
25 #else
26 # define HTTP_ZAPI_CONST_CAST(t) (t)
27 # define GLOBAL_ERROR_HANDLING PG(error_handling)
28 # define GLOBAL_EXCEPTION_CLASS PG(exception_class)
29 # define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
30 #endif
31
32 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0)
33 # define WONKY
34 #endif
35
36 #ifndef pemalloc_rel
37 # define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size))
38 #endif
39
40 #ifndef ZEND_ACC_DEPRECATED
41 # define ZEND_ACC_DEPRECATED 0
42 #endif
43
44 #if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10
45 # define php_url_parse_ex(u, l) php_url_parse(u)
46 #endif
47
48 #ifndef TSRMLS_FETCH_FROM_CTX
49 # ifdef ZTS
50 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
51 # else
52 # define TSRMLS_FETCH_FROM_CTX(ctx)
53 # endif
54 #endif
55
56 #ifndef TSRMLS_SET_CTX
57 # ifdef ZTS
58 # define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
59 # else
60 # define TSRMLS_SET_CTX(ctx)
61 # endif
62 #endif
63
64 #ifndef ZVAL_ADDREF
65 # define ZVAL_ADDREF Z_ADDREF_P
66 #endif
67
68 #ifndef ZVAL_ZVAL
69 #define ZVAL_ZVAL(z, zv, copy, dtor) { \
70 int is_ref, refcount; \
71 is_ref = (z)->is_ref; \
72 refcount = (z)->refcount; \
73 *(z) = *(zv); \
74 if (copy) { \
75 zval_copy_ctor(z); \
76 } \
77 if (dtor) { \
78 if (!copy) { \
79 ZVAL_NULL(zv); \
80 } \
81 zval_ptr_dtor(&zv); \
82 } \
83 (z)->is_ref = is_ref; \
84 (z)->refcount = refcount; \
85 }
86 #endif
87 #ifndef RETVAL_ZVAL
88 # define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
89 #endif
90 #ifndef RETURN_ZVAL
91 # define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; }
92 #endif
93
94 #ifndef ZEND_MN
95 # define ZEND_MN(name) ZEND_FN(name)
96 #endif
97
98 #ifdef WONKY
99 extern int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC);
100 extern void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
101
102 extern int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
103 extern void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
104
105 extern void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC);
106 #endif
107
108 #endif
109
110 /*
111 * Local variables:
112 * tab-width: 4
113 * c-basic-offset: 4
114 * End:
115 * vim600: noet sw=4 ts=4 fdm=marker
116 * vim<600: noet sw=4 ts=4
117 */
118