- example fixup
[m6w6/ext-http] / php_http_request_pool_api.h
1 /*
2 +----------------------------------------------------------------------+
3 | PECL :: http |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.0 of the PHP license, that |
6 | is bundled with this package in the file LICENSE, and is available |
7 | through the world-wide-web at http://www.php.net/license/3_0.txt. |
8 | If you did not receive a copy of the PHP license and are unable to |
9 | obtain it through the world-wide-web, please send a note to |
10 | license@php.net so we can mail you a copy immediately. |
11 +----------------------------------------------------------------------+
12 | Copyright (c) 2004-2005 Michael Wallner <mike@php.net> |
13 +----------------------------------------------------------------------+
14 */
15
16 /* $Id$ */
17
18 #ifndef PHP_HTTP_REQUEST_POOL_API_H
19 #define PHP_HTTP_REQUEST_POOL_API_H
20 #ifdef HTTP_HAVE_CURL
21
22 #include "php_http_std_defs.h"
23 #include "php_http_request_api.h"
24 #include "phpstr/phpstr.h"
25
26 #ifdef PHP_WIN32
27 # include <winsock2.h>
28 #endif
29
30 #include <curl/curl.h>
31
32 typedef struct {
33 CURLM *ch;
34 zend_llist handles;
35 zend_llist bodies;
36 int unfinished;
37 } http_request_pool;
38
39 #define http_request_pool_responsehandler _http_request_pool_responsehandler
40 extern void _http_request_pool_responsehandler(zval **req TSRMLS_DC);
41 #define http_request_pool_requesthandler(r, b) _http_request_pool_requesthandler((r), (b) TSRMLS_CC)
42 extern STATUS _http_request_pool_requesthandler(zval *request, http_request_body *body TSRMLS_DC);
43
44 #define http_request_pool_init(p) _http_request_pool_init((p) TSRMLS_CC)
45 PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC);
46
47 #define http_request_pool_attach(p, r) _http_request_pool_attach((p), (r) TSRMLS_CC)
48 PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request TSRMLS_DC);
49
50 #define http_request_pool_detach(p, r) _http_request_pool_detach((p), (r) TSRMLS_CC)
51 PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request TSRMLS_DC);
52
53 #define http_request_pool_detach_all(p) _http_request_pool_detach_all((p) TSRMLS_CC)
54 PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool TSRMLS_DC);
55
56 #define http_request_pool_send(p) _http_request_pool_send((p) TSRMLS_CC)
57 PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool TSRMLS_DC);
58
59 #define http_request_pool_select _http_request_pool_select
60 PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool);
61
62 #define http_request_pool_perform _http_request_pool_perform
63 PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool);
64
65 #define http_request_pool_dtor(p) _http_request_pool_dtor((p) TSRMLS_CC)
66 PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool TSRMLS_DC);
67
68 #endif
69 #endif
70
71 /*
72 * Local variables:
73 * tab-width: 4
74 * c-basic-offset: 4
75 * End:
76 * vim600: noet sw=4 ts=4 fdm=marker
77 * vim<600: noet sw=4 ts=4
78 */
79