X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_request_pool_api.h;h=2c066e312fb79b78d17808bd92c4160e7ee4fd33;hp=19d9eb858378f20b0caf35bacabe4b578104025a;hb=bdcc6697f7dd2a636efe363d7208e3832692b1ec;hpb=9676c81efbb8f180fa189d71a7ecb50dde4f5646 diff --git a/php_http_request_pool_api.h b/php_http_request_pool_api.h index 19d9eb8..2c066e3 100644 --- a/php_http_request_pool_api.h +++ b/php_http_request_pool_api.h @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2006, Michael Wallner | + | Copyright (c) 2004-2007, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -15,6 +15,7 @@ #ifndef PHP_HTTP_REQUEST_POOL_API_H #define PHP_HTTP_REQUEST_POOL_API_H #ifdef HTTP_HAVE_CURL +#ifdef ZEND_ENGINE_2 typedef struct _http_request_pool_t { CURLM *ch; @@ -23,12 +24,13 @@ typedef struct _http_request_pool_t { int unfinished; } http_request_pool; -#define http_request_pool_responsehandler _http_request_pool_responsehandler -extern void _http_request_pool_responsehandler(zval **req, CURL *ch TSRMLS_DC); +typedef int (*http_request_pool_apply_func)(http_request_pool *pool, zval *request TSRMLS_DC); +typedef int (*http_request_pool_apply_with_arg_func)(http_request_pool *pool, zval *request, void *arg TSRMLS_DC); -#define http_request_pool_try http_try -#define http_request_pool_catch() http_catch(HTTP_EX_CE(request_pool)) -#define http_request_pool_final() http_final(HTTP_EX_CE(request_pool)) +PHP_MINIT_FUNCTION(http_request_pool); + +#define http_request_pool_responsehandler(p, r, c) _http_request_pool_responsehandler((p), (r), (c) TSRMLS_CC) +extern int _http_request_pool_responsehandler(http_request_pool *pool, zval *req, void *ch TSRMLS_DC); #define http_request_pool_init(p) _http_request_pool_init((p) TSRMLS_CC) PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC); @@ -39,6 +41,12 @@ PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *req #define http_request_pool_detach(p, r) _http_request_pool_detach((p), (r) TSRMLS_CC) PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request TSRMLS_DC); +#define http_request_pool_apply(p, f) _http_request_pool_apply((p), (f) TSRMLS_CC) +PHP_HTTP_API void _http_request_pool_apply(http_request_pool *pool, http_request_pool_apply_func cb TSRMLS_DC); + +#define http_request_pool_apply_with_arg(p, f, a) _http_request_pool_apply_with_arg((p), (f), (a) TSRMLS_CC) +PHP_HTTP_API void _http_request_pool_apply_with_arg(http_request_pool *pool, http_request_pool_apply_with_arg_func cb, void *arg TSRMLS_DC); + #define http_request_pool_detach_all(p) _http_request_pool_detach_all((p) TSRMLS_CC) PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool TSRMLS_DC); @@ -54,6 +62,7 @@ PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool TSRMLS_DC); #define http_request_pool_dtor(p) _http_request_pool_dtor((p) TSRMLS_CC) PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool TSRMLS_DC); +#endif #endif #endif