FOREACH_VAL(pos, val, rr) {
if (Z_TYPE_PP(rr) == IS_ARRAY) {
- if (2 == php_http_array_list(*rr TSRMLS_CC, 2, &rb, &re)) {
+ if (2 == php_http_array_list(Z_ARRVAL_PP(rr) TSRMLS_CC, 2, &rb, &re)) {
if ( ((Z_TYPE_PP(rb) == IS_LONG) || ((Z_TYPE_PP(rb) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(rb), Z_STRLEN_PP(rb), NULL, NULL, 1))) &&
((Z_TYPE_PP(re) == IS_LONG) || ((Z_TYPE_PP(re) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(re), Z_STRLEN_PP(re), NULL, NULL, 1)))) {
zval *rbl = php_http_ztyp(IS_LONG, *rb);
if (val && Z_TYPE_P(val) != IS_NULL) {
zval **z_port_start, *zps_copy = NULL, **z_port_end, *zpe_copy = NULL;
- switch (php_http_array_list(val TSRMLS_CC, 2, &z_port_start, &z_port_end)) {
+ switch (php_http_array_list(Z_ARRVAL_P(val) TSRMLS_CC, 2, &z_port_start, &z_port_end)) {
case 2:
zps_copy = php_http_ztyp(IS_LONG, *z_port_start);
zpe_copy = php_http_ztyp(IS_LONG, *z_port_end);
/* ARRAYS */
-PHP_HTTP_API unsigned php_http_array_list(zval *hash TSRMLS_DC, unsigned argc, ...)
+PHP_HTTP_API unsigned php_http_array_list(HashTable *ht TSRMLS_DC, unsigned argc, ...)
{
- HashTable *ht = HASH_OF(hash);
HashPosition pos;
unsigned argl = 0;
va_list argv;
va_start(argv, argc);
for ( zend_hash_internal_pointer_reset_ex(ht, &pos);
- zend_hash_has_more_elements_ex(ht, &pos) && (argl < argc);
+ SUCCESS == zend_hash_has_more_elements_ex(ht, &pos) && (argl < argc);
zend_hash_move_forward_ex(ht, &pos))
{
zval **data, ***argp = (zval ***) va_arg(argv, zval ***);
/* PASS CALLBACK */
-PHP_HTTP_API size_t php_http_pass_wrapper(php_http_pass_callback_arg_t *cb, const char *str, size_t len)
-{
- TSRMLS_FETCH();
- return cb->cb_zts(cb->cb_arg, str, len TSRMLS_CC);
-}
-
PHP_HTTP_API size_t php_http_pass_fcall_callback(void *cb_arg, const char *str, size_t len)
{
php_http_pass_fcall_arg_t *fcd = cb_arg;
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) \
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) \
#endif /* PHP_HTTP_HAVE_CURL */
/* ARRAYS */
-
-PHP_HTTP_API unsigned php_http_array_list(zval *hash TSRMLS_DC, unsigned argc, ...);
+PHP_HTTP_API unsigned php_http_array_list(HashTable *ht TSRMLS_DC, unsigned argc, ...);
typedef struct php_http_array_hashkey {
char *str;
}
}
+typedef void (*php_http_array_visitor_t)(void *visitor_arg, php_http_array_hashkey_t *key, zval **val TSRMLS_DC);
+PHP_HTTP_API void php_http_array_visit(HashTable *ht, php_http_array_visitor_t visitor_func, void *visitor_arg TSRMLS_DC);
+
#define FOREACH_VAL(pos, array, val) FOREACH_HASH_VAL(pos, HASH_OF(array), val)
#define FOREACH_HASH_VAL(pos, hash, val) \
for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \