- fix typo
[m6w6/ext-http] / php_http_request_datashare_api.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
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-2006, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_REQUEST_DATASHARE_API_H
16 #define PHP_HTTP_REQUEST_DATASHARE_API_H
17 #ifdef HTTP_HAVE_CURL
18
19 typedef struct _http_request_datashare_lock_t {
20 CURL *ch;
21 MUTEX_T mx;
22 } http_request_datashare_lock;
23
24 typedef struct _http_request_datashare_t {
25 CURLSH *ch;
26 zend_llist handles;
27 zend_bool persistent;
28 http_request_datashare_lock *locks;
29 } http_request_datashare;
30
31 #define http_request_datashare_global_get _http_request_datashare_global_get
32 extern http_request_datashare *_http_request_datashare_global_get(void);
33
34 extern PHP_MINIT_FUNCTION(http_request_datashare);
35 extern PHP_MSHUTDOWN_FUNCTION(http_request_datashare);
36
37 #define http_request_datashare_new() _http_request_datashare_init_ex(NULL, 0 TSRMLS_CC)
38 #define http_request_datashare_init(s) _http_request_datashare_init_ex((s), 0 TSRMLS_CC)
39 #define http_request_datashare_init_ex(s, p) _http_request_datashare_init_ex((s), (p) TSRMLS_CC)
40 PHP_HTTP_API http_request_datashare *_http_request_datashare_init_ex(http_request_datashare *share, zend_bool persistent TSRMLS_DC);
41
42 #define http_request_datashare_attach(s, r) _http_request_datashare_attach((s), (r) TSRMLS_CC)
43 PHP_HTTP_API STATUS _http_request_datashare_attach(http_request_datashare *share, zval *request TSRMLS_DC);
44
45 #define http_request_datashare_detach(s, r) _http_request_datashare_detach((s), (r) TSRMLS_CC)
46 PHP_HTTP_API STATUS _http_request_datashare_detach(http_request_datashare *share, zval *request TSRMLS_DC);
47
48 #define http_request_datashare_detach_all(s) _http_request_datashare_detach_all((s) TSRMLS_CC)
49 PHP_HTTP_API void _http_request_datashare_detach_all(http_request_datashare *share TSRMLS_DC);
50
51 #define http_request_datashare_dtor(s) _http_request_datashare_dtor((s) TSRMLS_CC)
52 PHP_HTTP_API void _http_request_datashare_dtor(http_request_datashare *share TSRMLS_DC);
53
54 #define http_request_datashare_free(s) _http_request_datashare_free((s) TSRMLS_CC)
55 PHP_HTTP_API void _http_request_datashaere_free(http_request_datashare **share TSRMLS_DC);
56
57 #define http_request_datashare_set(s, o, l, e) _http_request_datashare_set((s), (o), (l), (e) TSRMLS_CC)
58 PHP_HTTP_API STATUS _http_request_datashare_set(http_request_datashare *share, const char *option, size_t option_len, zend_bool enable TSRMLS_DC);
59
60
61 #endif
62 #endif
63
64 /*
65 * Local variables:
66 * tab-width: 4
67 * c-basic-offset: 4
68 * End:
69 * vim600: noet sw=4 ts=4 fdm=marker
70 * vim<600: noet sw=4 ts=4
71 */
72