X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_misc.h;h=358c75bd2164d06fd104c7dd483e8a06bd46a0c0;hp=69076e71fbc2201b114ec3ecf8309231e100e7de;hb=9da9c90ae841a731913fe3aec7463dced6378470;hpb=6f61c56b9d16c4fd68e388e629cc5a9248fe8281 diff --git a/php_http_misc.h b/php_http_misc.h index 69076e7..358c75b 100644 --- a/php_http_misc.h +++ b/php_http_misc.h @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2011, Michael Wallner | + | Copyright (c) 2004-2013, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -21,9 +21,6 @@ /* CR LF */ #define PHP_HTTP_CRLF "\r\n" -/* max URL length */ -#define PHP_HTTP_URL_MAXLEN 4096 - /* def URL arg separator */ #define PHP_HTTP_URL_ARGSEP "&" @@ -200,9 +197,8 @@ static inline STATUS php_http_ini_entry(const char *name_str, size_t name_len, c return FAILURE; } -/* return bool (v == SUCCESS) */ -#define RETVAL_SUCCESS(v) RETVAL_BOOL(SUCCESS == (v)) -#define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v)) +STATUS php_http_method_call(zval *object, const char *method_str, size_t method_len, int argc, zval **argv[], zval **retval_ptr TSRMLS_DC); + /* return object(values) */ #define RETVAL_OBJECT(o, addref) \ RETVAL_OBJVAL((o)->value.obj, addref) @@ -220,29 +216,6 @@ static inline STATUS php_http_ini_entry(const char *name_str, size_t name_len, c if (addref && Z_OBJ_HT_P(zv)->add_ref) { \ Z_OBJ_HT_P(zv)->add_ref((zv) TSRMLS_CC); \ } -/* return property */ -#define RETVAL_PROP(CE, n) RETVAL_PROP_EX(CE, getThis(), n) -#define RETURN_PROP(CE, n) RETURN_PROP_EX(CE, getThis(), n) -#define RETVAL_PROP_EX(CE, this, n) \ - { \ - zval *__prop = zend_read_property(CE, this, ZEND_STRL(n), 0 TSRMLS_CC); \ - RETVAL_ZVAL(__prop, 1, 0); \ - } -#define RETURN_PROP_EX(CE, this, n) \ - { \ - zval *__prop = zend_read_property(CE, this, ZEND_STRL(n), 0 TSRMLS_CC); \ - RETURN_ZVAL(__prop, 1, 0); \ - } -#define RETVAL_SPROP(CE, n) \ - { \ - zval *__prop = zend_read_static_property(CE, ZEND_STRL(n), 0 TSRMLS_CC); \ - RETVAL_ZVAL(__prop, 1, 0); \ - } -#define RETURN_SPROP(CE, n) \ - { \ - zval *__prop = zend_read_static_property(CE, ZEND_STRL(n), 0 TSRMLS_CC); \ - RETURN_ZVAL(__prop, 1, 0); \ - } #define Z_OBJ_DELREF(z) \ if (Z_OBJ_HT(z)->del_ref) { \ @@ -269,15 +242,6 @@ static inline STATUS php_http_ini_entry(const char *name_str, size_t name_len, c Z_OBJ_HT_PP(z)->add_ref(*(z) TSRMLS_CC); \ } -#define PHP_HTTP_BEGIN_ARGS_EX(class, method, ret_ref, req_args) ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 0, ret_ref, req_args) -#define PHP_HTTP_BEGIN_ARGS_AR(class, method, ret_ref, req_args) ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 1, ret_ref, req_args) -#define PHP_HTTP_END_ARGS } -#define PHP_HTTP_EMPTY_ARGS_EX(class, method, ret_ref) PHP_HTTP_BEGIN_ARGS_EX(class, method, ret_ref, 0) PHP_HTTP_END_ARGS -#define PHP_HTTP_ARGS(class, method) args_for_ ##class## _ ##method -#define PHP_HTTP_ARG_VAL(name, pass_ref) ZEND_ARG_INFO(pass_ref, name) -#define PHP_HTTP_ARG_OBJ(class, name, allow_null) ZEND_ARG_OBJ_INFO(0, name, class, allow_null) -#define PHP_HTTP_ARG_ARR(name, allow_null, pass_ref) ZEND_ARG_ARRAY_INFO(pass_ref, name, allow_null) - #define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0, 0} #define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU) @@ -285,41 +249,6 @@ static inline STATUS php_http_ini_entry(const char *name_str, size_t name_len, c #define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) #define PHP_RSHUTDOWN_CALL(func) PHP_RSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) - -#define PHP_HTTP_INI_ENTRY(entry, default, scope, updater, global) \ - STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_php_http_globals, php_http_globals) -#define PHP_HTTP_INI_ENTRY_EX(entry, default, scope, updater, displayer, global) \ - STD_PHP_INI_ENTRY_EX(entry, default, scope, updater, global, zend_php_http_globals, php_http_globals, displayer) - -#define PHP_HTTP_REGISTER_CLASS(ns, classname, name, parent, flags) \ - { \ - zend_class_entry ce; \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, #ns, #classname, php_ ##name## _method_entry); \ - php_ ##name## _class_entry = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ - php_ ##name## _class_entry->ce_flags |= flags; \ - php_http_register_class(php_ ##name## _get_class_entry); \ - } - -#define PHP_HTTP_REGISTER_INTERFACE(ns, ifacename, name, flags) \ - { \ - zend_class_entry ce; \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, #ns, #ifacename, php_ ##name## _method_entry); \ - php_ ##name## _class_entry = zend_register_internal_interface(&ce TSRMLS_CC); \ - php_ ##name## _class_entry->ce_flags |= flags; \ - php_http_register_class(php_ ##name## _get_class_entry); \ - } - -#define PHP_HTTP_REGISTER_EXCEPTION(classname, cename, parent) \ - { \ - zend_class_entry ce; \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, "http", #classname, NULL); \ - ce.create_object = NULL; \ - cename = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ - } - /* ARRAYS */ PHP_HTTP_API unsigned php_http_array_list(HashTable *ht TSRMLS_DC, unsigned argc, ...); @@ -434,6 +363,7 @@ typedef enum php_http_error { } php_http_error_t; #endif + /* * Local variables: * tab-width: 4