-#define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v))
-#define HASH_ORNULL(z) ((z) ? Z_ARRVAL_P(z) : NULL)
-#define NO_ARGS if (ZEND_NUM_ARGS()) WRONG_PARAM_COUNT
-
-#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 *))
-#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)
-
-#ifdef ZEND_ENGINE_2
-
-# define HTTP_REGISTER_CLASS_EX(classname, name, parent, flags) \
- { \
- zend_class_entry ce; \
- INIT_CLASS_ENTRY(ce, #classname, name## _class_methods); \
- ce.create_object = name## _new_object; \
- name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \
- name## _ce->ce_flags |= flags; \
- memcpy(& name## _object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \
- name## _object_handlers.clone_obj = NULL; \
- name## _declare_default_properties(name## _ce); \
- }
-
-# define HTTP_REGISTER_CLASS(classname, name, parent, flags) \
- { \
- zend_class_entry ce; \
- INIT_CLASS_ENTRY(ce, #classname, name## _class_methods); \
- ce.create_object = NULL; \
- name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \
- name## _ce->ce_flags |= flags; \
- }
-
-# define getObject(t, o) t * o = ((t *) zend_object_store_get_object(getThis() TSRMLS_CC))
-# define OBJ_PROP(o) o->zo.properties
-# define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n), (v), (ZEND_ACC_ ##a) TSRMLS_CC)
-# define DCL_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n), (v), (ZEND_ACC_ ##a) TSRMLS_CC)
-# define DCL_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n), (ZEND_ACC_ ##a) TSRMLS_CC)
-# define UPD_PROP(o, t, n, v) zend_update_property_ ##t(o->zo.ce, getThis(), (#n), sizeof(#n), (v) TSRMLS_CC)
-# define SET_PROP(o, n, z) zend_update_property(o->zo.ce, getThis(), (#n), sizeof(#n), (z) TSRMLS_CC)
-# define GET_PROP(o, n) zend_read_property(o->zo.ce, getThis(), (#n), sizeof(#n), 0 TSRMLS_CC)
-
-# define INIT_PARR(o, n) \
- { \
- zval *__tmp; \
- MAKE_STD_ZVAL(__tmp); \
- array_init(__tmp); \
- SET_PROP(o, n, __tmp); \
- }
-
-# define FREE_PARR(o, p) \
- { \
- zval *__tmp = NULL; \
- if (__tmp = GET_PROP(o, p)) { \
- zval_dtor(__tmp); \
- FREE_ZVAL(__tmp); \
- __tmp = NULL; \
- } \
- }
-
-#endif /* ZEND_ENGINE_2 */
-
-/* make functions that return SUCCESS|FAILURE more obvious */
-typedef int STATUS;
-
-/* {{{ enum http_range_status */
-typedef enum {
- RANGE_OK,
- RANGE_NO,
- RANGE_ERR
-} http_range_status;
-/* }}} */
-
-/* {{{ enum http_send_mode */
-typedef enum {
- SEND_DATA,
- SEND_RSRC
-} http_send_mode;
-/* }}} */
-
-/* CR LF */
-#define HTTP_CRLF "\r\n"
-
-/* default cache control */
-#define HTTP_DEFAULT_CACHECONTROL "private, must-revalidate, max-age=0"
-
-/* max URI length */
-#define HTTP_URI_MAXLEN 2048
-
-/* buffer size */
-#define HTTP_BUF_SIZE 2097152
-
-/* server vars shorthand */
-#define HTTP_SERVER_VARS Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])
-
-
-/* {{{ HTTP_GSC(var, name, ret) */
-#define HTTP_GSC(var, name, ret) HTTP_GSP(var, name, return ret)
-/* }}} */
-
-/* {{{ HTTP_GSP(var, name, ret) */
-#define HTTP_GSP(var, name, ret) \
- if (!(var = http_get_server_var(name))) { \
- ret; \
- } \
- if (!Z_STRLEN_P(var)) { \
- ret; \
- }
-/* }}} */
-
-char *pretty_key(char *key, int key_len, int uctitle, int xhyphen);
-
-/* {{{ public API */
-#define http_date(t) _http_date((t) TSRMLS_CC)
-PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC);
-
-#define http_parse_date(d) _http_parse_date((d))
-PHP_HTTP_API time_t _http_parse_date(const char *date);
-
-#define http_send_status(s) _http_send_status((s) TSRMLS_CC)
-PHP_HTTP_API inline STATUS _http_send_status(const int status TSRMLS_DC);
-
-#define http_send_header(h) _http_send_header((h) TSRMLS_CC)
-PHP_HTTP_API inline STATUS _http_send_header(const char *header TSRMLS_DC);
-
-#define http_send_status_header(s, h) _http_send_status_header((s), (h) TSRMLS_CC)
-PHP_HTTP_API inline STATUS _http_send_status_header(const int status, const char *header TSRMLS_DC);
-
-#define http_get_server_var(v) _http_get_server_var((v) TSRMLS_CC)
-PHP_HTTP_API inline zval *_http_get_server_var(const char *key TSRMLS_DC);
-
-#define http_etag(p, l, m) _http_etag((p), (l), (m) TSRMLS_CC)
-PHP_HTTP_API inline char *_http_etag(const void *data_ptr, const size_t data_len, const http_send_mode data_mode TSRMLS_DC);
-
-#define http_lmod(p, m) _http_lmod((p), (m) TSRMLS_CC)
-PHP_HTTP_API inline time_t _http_lmod(const void *data_ptr, const http_send_mode data_mode TSRMLS_DC);