- fix inclusion of zlib.h
[m6w6/ext-http] / php_http_std_defs.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-2005, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_STD_DEFS_H
16 #define PHP_HTTP_STD_DEFS_H
17
18 #if defined(PHP_WIN32)
19 # if defined(HTTP_EXPORTS)
20 # define PHP_HTTP_API __declspec(dllexport)
21 # elif defined(COMPILE_DL_HTTP)
22 # define PHP_HTTP_API __declspec(dllimport)
23 # else
24 # define PHP_HTTP_API
25 # endif
26 #else
27 # define PHP_HTTP_API
28 #endif
29
30 /* make functions that return SUCCESS|FAILURE more obvious */
31 typedef int STATUS;
32
33 /* lenof() */
34 #define lenof(S) (sizeof(S) - 1)
35
36 #ifndef MIN
37 # define MIN(a,b) (a<b?a:b)
38 #endif
39 #ifndef MAX
40 # define MAX(a,b) (a>b?a:b)
41 #endif
42
43 /* STR_SET() */
44 #ifndef STR_SET
45 # define STR_SET(STR, SET) \
46 { \
47 STR_FREE(STR); \
48 STR = SET; \
49 }
50 #endif
51
52 #define INIT_ZARR(zv, ht) \
53 { \
54 INIT_PZVAL(&(zv)); \
55 Z_TYPE(zv) = IS_ARRAY; \
56 Z_ARRVAL(zv) = (ht); \
57 }
58
59 /* return bool (v == SUCCESS) */
60 #define RETVAL_SUCCESS(v) RETVAL_BOOL(SUCCESS == (v))
61 #define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v))
62 /* return object(values) */
63 #define RETVAL_OBJECT(o) \
64 RETVAL_OBJVAL((o)->value.obj)
65 #define RETURN_OBJECT(o) \
66 RETVAL_OBJECT(o); \
67 return
68 #define RETVAL_OBJVAL(ov) \
69 ZVAL_OBJVAL(return_value, ov) \
70 if (Z_OBJ_HT_P(return_value)->add_ref) { \
71 Z_OBJ_HT_P(return_value)->add_ref(return_value TSRMLS_CC); \
72 }
73 #define RETURN_OBJVAL(ov) \
74 RETVAL_OBJVAL(ov); \
75 return
76 #define ZVAL_OBJVAL(zv, ov) \
77 (zv)->type = IS_OBJECT; \
78 (zv)->value.obj = (ov);
79
80 /* function accepts no args */
81 #define NO_ARGS \
82 if (ZEND_NUM_ARGS()) { \
83 zend_error(E_NOTICE, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C)); \
84 }
85
86 /* check if return value is used */
87 #define IF_RETVAL_USED \
88 if (!return_value_used) { \
89 return; \
90 } else
91
92 /* CR LF */
93 #define HTTP_CRLF "\r\n"
94
95 /* default cache control */
96 #define HTTP_DEFAULT_CACHECONTROL "private, must-revalidate, max-age=0"
97
98 /* max URL length */
99 #define HTTP_URL_MAXLEN 4096
100 #define HTTP_URI_MAXLEN HTTP_URL_MAXLEN
101
102 /* def URL arg separator */
103 #define HTTP_URL_ARGSEP "&"
104 #define HTTP_URI_ARGSEP HTTP_URL_ARGSEP
105
106 /* send buffer size */
107 #define HTTP_SENDBUF_SIZE 40960
108
109 /* CURL buffer size */
110 #define HTTP_CURLBUF_SIZE 16384
111
112 /* known methods */
113 #define HTTP_KNOWN_METHODS \
114 /* HTTP 1.1 */ \
115 "GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE, CONNECT, " \
116 /* WebDAV - RFC 2518 */ \
117 "PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, " \
118 /* WebDAV Versioning - RFC 3253 */ \
119 "VERSION-CONTROL, REPORT, CHECKOUT, CHECKIN, UNCHECKOUT, " \
120 "MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY, " \
121 /* WebDAV Access Control - RFC 3744 */ \
122 "ACL, " \
123 /* END */
124
125
126 #define HTTP_PHP_INI_ENTRY(entry, default, scope, updater, global) \
127 STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_http_globals, http_globals)
128 #define HTTP_PHP_INI_ENTRY_EX(entry, default, scope, updater, displayer, global) \
129 STD_PHP_INI_ENTRY_EX(entry, default, scope, updater, global, zend_http_globals, http_globals, displayer)
130
131 /* {{{ arrays */
132 #define FOREACH_VAL(pos, array, val) FOREACH_HASH_VAL(pos, Z_ARRVAL_P(array), val)
133 #define FOREACH_HASH_VAL(pos, hash, val) \
134 for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
135 zend_hash_get_current_data_ex(hash, (void **) &val, &pos) == SUCCESS; \
136 zend_hash_move_forward_ex(hash, &pos))
137
138 #define FOREACH_KEY(pos, array, strkey, numkey) FOREACH_HASH_KEY(pos, Z_ARRVAL_P(array), strkey, numkey)
139 #define FOREACH_HASH_KEY(pos, hash, strkey, numkey) \
140 for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
141 zend_hash_get_current_key_ex(hash, &strkey, NULL, &numkey, 0, &pos) != HASH_KEY_NON_EXISTANT; \
142 zend_hash_move_forward_ex(hash, &pos)) \
143
144 #define FOREACH_KEYLEN(pos, array, strkey, keylen, numkey) FOREACH_HASH_KEYLEN(pos, Z_ARRVAL_P(array), strkey, keylen, numkey)
145 #define FOREACH_HASH_KEYLEN(pos, hash, strkey, keylen, numkey) \
146 for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
147 zend_hash_get_current_key_ex(hash, &strkey, &keylen, &numkey, 0, &pos) != HASH_KEY_NON_EXISTANT; \
148 zend_hash_move_forward_ex(hash, &pos)) \
149
150 #define FOREACH_KEYVAL(pos, array, strkey, numkey, val) FOREACH_HASH_KEYVAL(pos, Z_ARRVAL_P(array), strkey, numkey, val)
151 #define FOREACH_HASH_KEYVAL(pos, hash, strkey, numkey, val) \
152 for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
153 zend_hash_get_current_key_ex(hash, &strkey, NULL, &numkey, 0, &pos) != HASH_KEY_NON_EXISTANT && \
154 zend_hash_get_current_data_ex(hash, (void **) &val, &pos) == SUCCESS; \
155 zend_hash_move_forward_ex(hash, &pos))
156
157 #define FOREACH_KEYLENVAL(pos, array, strkey, keylen, numkey, val) FOREACH_HASH_KEYVAL(pos, Z_ARRVAL_P(array), strkey, keylen, numkey, val)
158 #define FOREACH_HASH_KEYLENVAL(pos, hash, strkey, keylen, numkey, val) \
159 for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \
160 zend_hash_get_current_key_ex(hash, &strkey, &keylen, &numkey, 0, &pos) != HASH_KEY_NON_EXISTANT && \
161 zend_hash_get_current_data_ex(hash, (void **) &val, &pos) == SUCCESS; \
162 zend_hash_move_forward_ex(hash, &pos))
163
164 #define array_copy(src, dst) zend_hash_copy(Z_ARRVAL_P(dst), Z_ARRVAL_P(src), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *))
165 #define array_merge(src, dst) zend_hash_merge(Z_ARRVAL_P(dst), Z_ARRVAL_P(src), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *), 1)
166 #define array_append(src, dst) \
167 { \
168 ulong idx; \
169 uint klen; \
170 char *key = NULL; \
171 zval **data; \
172 HashPosition pos; \
173 \
174 for ( zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(src), &pos); \
175 zend_hash_get_current_key_ex(Z_ARRVAL_P(src), &key, &klen, &idx, 0, &pos) != HASH_KEY_NON_EXISTANT && \
176 zend_hash_get_current_data_ex(Z_ARRVAL_P(src), (void **) &data, &pos) == SUCCESS; \
177 zend_hash_move_forward_ex(Z_ARRVAL_P(src), &pos)) \
178 { \
179 if (key) { \
180 zval **tmp; \
181 \
182 if (SUCCESS == zend_hash_find(Z_ARRVAL_P(dst), key, klen, (void **) &tmp)) { \
183 if (Z_TYPE_PP(tmp) != IS_ARRAY) { \
184 convert_to_array_ex(tmp); \
185 } \
186 add_next_index_zval(*tmp, *data); \
187 } else { \
188 add_assoc_zval(dst, key, *data); \
189 } \
190 ZVAL_ADDREF(*data); \
191 key = NULL; \
192 } \
193 } \
194 }
195 /* }}} */
196
197 #define HTTP_LONG_CONSTANT(name, const) REGISTER_LONG_CONSTANT(name, const, CONST_CS | CONST_PERSISTENT)
198
199 /* {{{ objects & properties */
200 #ifdef ZEND_ENGINE_2
201
202 # define HTTP_STATIC_ME_ALIAS(me, al, ai) ZEND_FENTRY(me, ZEND_FN(al), ai, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
203
204 # define HTTP_REGISTER_CLASS_EX(classname, name, parent, flags) \
205 { \
206 zend_class_entry ce; \
207 memset(&ce, 0, sizeof(zend_class_entry)); \
208 INIT_CLASS_ENTRY(ce, #classname, name## _fe); \
209 ce.create_object = _ ##name## _new; \
210 name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \
211 name## _ce->ce_flags |= flags; \
212 memcpy(& name## _handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \
213 name## _declare_default_properties(); \
214 }
215
216 # define HTTP_REGISTER_CLASS(classname, name, parent, flags) \
217 { \
218 zend_class_entry ce; \
219 memset(&ce, 0, sizeof(zend_class_entry)); \
220 INIT_CLASS_ENTRY(ce, #classname, name## _fe); \
221 ce.create_object = NULL; \
222 name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \
223 name## _ce->ce_flags |= flags; \
224 }
225
226 # define HTTP_REGISTER_EXCEPTION(classname, cename, parent) \
227 { \
228 zend_class_entry ce; \
229 memset(&ce, 0, sizeof(zend_class_entry)); \
230 INIT_CLASS_ENTRY(ce, #classname, NULL); \
231 ce.create_object = NULL; \
232 cename = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \
233 }
234
235 # define getObject(t, o) getObjectEx(t, o, getThis())
236 # define getObjectEx(t, o, v) t * o = ((t *) zend_object_store_get_object(v TSRMLS_CC))
237 # define putObject(t, o) zend_objects_store_put(o, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) _ ##t## _free, NULL TSRMLS_CC);
238 # define OBJ_PROP(o) (o)->zo.properties
239
240 # define DCL_STATIC_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
241 # define DCL_STATIC_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
242 # define DCL_STATIC_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
243 # define GET_STATIC_PROP_EX(ce, n) zend_std_get_static_property(ce, (#n), sizeof(#n)-1, 0 TSRMLS_CC)
244 # define UPD_STATIC_PROP_EX(ce, t, n, v) zend_update_static_property_ ##t(ce, #n, sizeof(#n)-1, (v) TSRMLS_CC)
245 # define UPD_STATIC_STRL_EX(ce, n, v, l) zend_update_static_property_stringl(ce, #n, sizeof(#n)-1, (v), (l) TSRMLS_CC)
246 # define SET_STATIC_PROP_EX(ce, n, v) zend_update_static_property(ce, #n, sizeof(#n)-1, v TSRMLS_CC)
247
248 # define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC)
249 # define DCL_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC)
250 # define DCL_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a) TSRMLS_CC)
251 # define UPD_PROP(o, t, n, v) UPD_PROP_EX(o, getThis(), t, n, v)
252 # define UPD_PROP_EX(o, this, t, n, v) zend_update_property_ ##t(o->zo.ce, this, (#n), sizeof(#n)-1, (v) TSRMLS_CC)
253 # define UPD_STRL(o, n, v, l) zend_update_property_stringl(o->zo.ce, getThis(), (#n), sizeof(#n)-1, (v), (l) TSRMLS_CC)
254 # define SET_PROP(o, n, z) SET_PROP_EX(o, getThis(), n, z)
255 # define SET_PROP_EX(o, this, n, z) zend_update_property(o->zo.ce, this, (#n), sizeof(#n)-1, (z) TSRMLS_CC)
256 # define GET_PROP(o, n) GET_PROP_EX(o, getThis(), n)
257 # define GET_PROP_EX(o, this, n) zend_read_property(o->zo.ce, this, (#n), sizeof(#n)-1, 0 TSRMLS_CC)
258
259 # define DCL_CONST(t, n, v) zend_declare_class_constant_ ##t(ce, (n), sizeof(n)-1, (v) TSRMLS_CC)
260
261 # define ACC_PROP_PRIVATE(ce, flags) ((flags & ZEND_ACC_PRIVATE) && (EG(scope) && ce == EG(scope))
262 # define ACC_PROP_PROTECTED(ce, flags) ((flags & ZEND_ACC_PROTECTED) && (zend_check_protected(ce, EG(scope))))
263 # define ACC_PROP_PUBLIC(flags) (flags & ZEND_ACC_PUBLIC)
264 # define ACC_PROP(ce, flags) (ACC_PROP_PUBLIC(flags) || ACC_PROP_PRIVATE(ce, flags) || ACC_PROP_PROTECTED(ce, flags))
265
266 # define INIT_PARR(o, n) \
267 { \
268 zval *__tmp; \
269 MAKE_STD_ZVAL(__tmp); \
270 array_init(__tmp); \
271 SET_PROP(o, n, __tmp); \
272 }
273
274 # define FREE_PARR(o, p) \
275 { \
276 zval *__tmp = GET_PROP(o, p); \
277 if (__tmp) { \
278 zval_ptr_dtor(&__tmp); \
279 } \
280 }
281
282 /*
283 * the property *MUST* be updated after SEP_PROP()
284 */
285 # define SEP_PROP(zpp) \
286 { \
287 zval **op = zpp; \
288 SEPARATE_ZVAL_IF_NOT_REF(zpp); \
289 if (op != zpp) { \
290 zval_ptr_dtor(op); \
291 } \
292 }
293
294 # define SET_EH_THROW() SET_EH_THROW_EX(zend_exception_get_default())
295 # define SET_EH_THROW_HTTP() SET_EH_THROW_EX(http_exception_get_default())
296 # define SET_EH_THROW_EX(ex) php_set_error_handling(EH_THROW, ex TSRMLS_CC)
297 # define SET_EH_NORMAL() php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC)
298
299 #endif /* ZEND_ENGINE_2 */
300 /* }}} */
301
302 #ifndef E_THROW
303 # define E_THROW 0
304 #endif
305 #ifdef ZEND_ENGINE_2
306 # define HE_THROW E_THROW TSRMLS_CC
307 # define HE_NOTICE (HTTP_G(only_exceptions) ? E_THROW : E_NOTICE) TSRMLS_CC
308 # define HE_WARNING (HTTP_G(only_exceptions) ? E_THROW : E_WARNING) TSRMLS_CC
309 # define HE_ERROR (HTTP_G(only_exceptions) ? E_THROW : E_ERROR) TSRMLS_CC
310 #else
311 # define HE_THROW E_WARNING TSRMLS_CC
312 # define HE_NOTICE E_NOTICE TSRMLS_CC
313 # define HE_WARNING E_WARNING TSRMLS_CC
314 # define HE_ERROR E_ERROR TSRMLS_CC
315 #endif
316
317 #define HTTP_E_RUNTIME 1L
318 #define HTTP_E_INVALID_PARAM 2L
319 #define HTTP_E_HEADER 3L
320 #define HTTP_E_MALFORMED_HEADERS 4L
321 #define HTTP_E_REQUEST_METHOD 5L
322 #define HTTP_E_MESSAGE_TYPE 6L
323 #define HTTP_E_ENCODING 7L
324 #define HTTP_E_REQUEST 8L
325 #define HTTP_E_REQUEST_POOL 9L
326 #define HTTP_E_SOCKET 10L
327 #define HTTP_E_RESPONSE 11L
328 #define HTTP_E_URL 12L
329
330 #ifdef ZEND_ENGINE_2
331 # define HTTP_BEGIN_ARGS_EX(class, method, ret_ref, req_args) static ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 0, ret_ref, req_args)
332 # define HTTP_BEGIN_ARGS_AR(class, method, ret_ref, req_args) static ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 1, ret_ref, req_args)
333 # define HTTP_END_ARGS }
334 # define HTTP_EMPTY_ARGS_EX(class, method, ret_ref) HTTP_BEGIN_ARGS_EX(class, method, ret_ref, 0) HTTP_END_ARGS
335 # define HTTP_ARGS(class, method) args_for_ ##class## _ ##method
336 # define HTTP_ARG_VAL(name, pass_ref) ZEND_ARG_INFO(pass_ref, name)
337 # define HTTP_ARG_OBJ(class, name, allow_null) ZEND_ARG_OBJ_INFO(0, name, class, allow_null)
338 #endif
339
340 #ifdef ZEND_ENGINE_2
341 # define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0, 0}
342 #else
343 # define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL}
344 #endif
345
346 #ifdef HTTP_HAVE_CURL
347 # ifdef ZEND_ENGINE_2
348 # define HTTP_DECLARE_ARG_PASS_INFO() \
349 static \
350 ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \
351 ZEND_ARG_PASS_INFO(0) \
352 ZEND_ARG_PASS_INFO(1) \
353 ZEND_END_ARG_INFO(); \
354 \
355 static \
356 ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_3, 0) \
357 ZEND_ARG_PASS_INFO(0) \
358 ZEND_ARG_PASS_INFO(0) \
359 ZEND_ARG_PASS_INFO(1) \
360 ZEND_END_ARG_INFO(); \
361 \
362 static \
363 ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_4, 0) \
364 ZEND_ARG_PASS_INFO(0) \
365 ZEND_ARG_PASS_INFO(0) \
366 ZEND_ARG_PASS_INFO(0) \
367 ZEND_ARG_PASS_INFO(1) \
368 ZEND_END_ARG_INFO(); \
369 \
370 static \
371 ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_5, 0) \
372 ZEND_ARG_PASS_INFO(0) \
373 ZEND_ARG_PASS_INFO(0) \
374 ZEND_ARG_PASS_INFO(0) \
375 ZEND_ARG_PASS_INFO(0) \
376 ZEND_ARG_PASS_INFO(1) \
377 ZEND_END_ARG_INFO();
378
379 # else
380 # define HTTP_DECLARE_ARG_PASS_INFO() \
381 static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE}; \
382 static unsigned char http_arg_pass_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \
383 static unsigned char http_arg_pass_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \
384 static unsigned char http_arg_pass_ref_5[] = {5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
385 # endif /* ZEND_ENGINE_2 */
386 #else
387 # ifdef ZEND_ENGINE_2
388 # define HTTP_DECLARE_ARG_PASS_INFO() \
389 static \
390 ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \
391 ZEND_ARG_PASS_INFO(0) \
392 ZEND_ARG_PASS_INFO(1) \
393 ZEND_END_ARG_INFO();
394 # else
395 # define HTTP_DECLARE_ARG_PASS_INFO() \
396 static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE};
397 # endif /* ZEND_ENGINE_2 */
398 #endif /* HTTP_HAVE_CURL */
399
400
401 #ifndef TSRMLS_FETCH_FROM_CTX
402 # ifdef ZTS
403 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
404 # else
405 # define TSRMLS_FETCH_FROM_CTX(ctx)
406 # endif
407 #endif
408
409 #ifndef TSRMLS_SET_CTX
410 # ifdef ZTS
411 # define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
412 # else
413 # define TSRMLS_SET_CTX(ctx)
414 # endif
415 #endif
416
417 #ifndef ZVAL_ZVAL
418 #define ZVAL_ZVAL(z, zv, copy, dtor) { \
419 int is_ref, refcount; \
420 is_ref = (z)->is_ref; \
421 refcount = (z)->refcount; \
422 *(z) = *(zv); \
423 if (copy) { \
424 zval_copy_ctor(z); \
425 } \
426 if (dtor) { \
427 if (!copy) { \
428 ZVAL_NULL(zv); \
429 } \
430 zval_ptr_dtor(&zv); \
431 } \
432 (z)->is_ref = is_ref; \
433 (z)->refcount = refcount; \
434 }
435 #endif
436 #ifndef RETVAL_ZVAL
437 #define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
438 #endif
439 #ifndef RETURN_ZVAL
440 #define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; }
441 #endif
442
443 #define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU)
444 #define PHP_RINIT_CALL(func) PHP_RINIT(func)(INIT_FUNC_ARGS_PASSTHRU)
445 #define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU)
446 #define PHP_RSHUTDOWN_CALL(func) PHP_RSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU)
447
448 #define Z_OBJ_DELREF(z) \
449 if (Z_OBJ_HT(z)->del_ref) { \
450 Z_OBJ_HT(z)->del_ref(&(z) TSRMLS_CC); \
451 }
452 #define Z_OBJ_ADDREF(z) \
453 if (Z_OBJ_HT(z)->add_ref) { \
454 Z_OBJ_HT(z)->add_ref(&(z) TSRMLS_CC); \
455 }
456 #define Z_OBJ_DELREF_P(z) \
457 if (Z_OBJ_HT_P(z)->del_ref) { \
458 Z_OBJ_HT_P(z)->del_ref((z) TSRMLS_CC); \
459 }
460 #define Z_OBJ_ADDREF_P(z) \
461 if (Z_OBJ_HT_P(z)->add_ref) { \
462 Z_OBJ_HT_P(z)->add_ref((z) TSRMLS_CC); \
463 }
464 #define Z_OBJ_DELREF_PP(z) \
465 if (Z_OBJ_HT_PP(z)->del_ref) { \
466 Z_OBJ_HT_PP(z)->del_ref(*(z) TSRMLS_CC); \
467 }
468 #define Z_OBJ_ADDREF_PP(z) \
469 if (Z_OBJ_HT_PP(z)->add_ref) { \
470 Z_OBJ_HT_PP(z)->add_ref(*(z) TSRMLS_CC); \
471 }
472
473 #endif /* PHP_HTTP_STD_DEFS_H */
474
475 /*
476 * Local variables:
477 * tab-width: 4
478 * c-basic-offset: 4
479 * End:
480 * vim600: noet sw=4 ts=4 fdm=marker
481 * vim<600: noet sw=4 ts=4
482 */
483