2 +--------------------------------------------------------------------+
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-2010, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
15 #ifndef PHP_HTTP_REQUEST_POOL_API_H
16 #define PHP_HTTP_REQUEST_POOL_API_H
20 typedef struct _http_request_pool_t
{
28 #ifdef HTTP_HAVE_EVENT
29 struct event
*timeout
;
35 typedef int (*http_request_pool_apply_func
)(http_request_pool
*pool
, zval
*request
);
36 typedef int (*http_request_pool_apply_with_arg_func
)(http_request_pool
*pool
, zval
*request
, void *arg
);
38 PHP_MINIT_FUNCTION(http_request_pool
);
39 #ifdef HTTP_HAVE_EVENT
40 PHP_RINIT_FUNCTION(http_request_pool
);
43 #define http_request_pool_timeout _http_request_pool_timeout
44 extern struct timeval
*_http_request_pool_timeout(http_request_pool
*pool
, struct timeval
*timeout
);
46 #define http_request_pool_responsehandler _http_request_pool_responsehandler
47 extern void _http_request_pool_responsehandler(http_request_pool
*pool
);
49 #define http_request_pool_apply_responsehandler _http_request_pool_responsehandler
50 extern int _http_request_pool_apply_responsehandler(http_request_pool
*pool
, zval
*req
, void *ch
);
52 #define http_request_pool_init(p) _http_request_pool_init((p) TSRMLS_CC)
53 PHP_HTTP_API http_request_pool
*_http_request_pool_init(http_request_pool
*pool TSRMLS_DC
);
55 #define http_request_pool_attach(p, r) _http_request_pool_attach((p), (r))
56 PHP_HTTP_API STATUS
_http_request_pool_attach(http_request_pool
*pool
, zval
*request
);
58 #define http_request_pool_detach(p, r) _http_request_pool_detach((p), (r))
59 PHP_HTTP_API STATUS
_http_request_pool_detach(http_request_pool
*pool
, zval
*request
);
61 #define http_request_pool_apply(p, f) _http_request_pool_apply((p), (f))
62 PHP_HTTP_API
void _http_request_pool_apply(http_request_pool
*pool
, http_request_pool_apply_func cb
);
64 #define http_request_pool_apply_with_arg(p, f, a) _http_request_pool_apply_with_arg((p), (f), (a))
65 PHP_HTTP_API
void _http_request_pool_apply_with_arg(http_request_pool
*pool
, http_request_pool_apply_with_arg_func cb
, void *arg
);
67 #define http_request_pool_detach_all(p) _http_request_pool_detach_all((p))
68 PHP_HTTP_API
void _http_request_pool_detach_all(http_request_pool
*pool
);
70 #define http_request_pool_send(p) _http_request_pool_send((p))
71 PHP_HTTP_API STATUS
_http_request_pool_send(http_request_pool
*pool
);
73 #define http_request_pool_select _http_request_pool_select
74 PHP_HTTP_API STATUS
_http_request_pool_select(http_request_pool
*pool
);
76 #define http_request_pool_select_ex _http_request_pool_select_ex
77 PHP_HTTP_API STATUS
_http_request_pool_select_ex(http_request_pool
*pool
, struct timeval
*custom_timeout
);
79 #define http_request_pool_perform(p) _http_request_pool_perform((p))
80 PHP_HTTP_API
int _http_request_pool_perform(http_request_pool
*pool
);
82 #define http_request_pool_dtor(p) _http_request_pool_dtor((p))
83 PHP_HTTP_API
void _http_request_pool_dtor(http_request_pool
*pool
);
94 * vim600: noet sw=4 ts=4 fdm=marker
95 * vim<600: noet sw=4 ts=4