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-2011, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
13 #ifndef PHP_HTTP_CURL_CLIENT_H
14 #define PHP_HTTP_CURL_CLIENT_H
16 #if PHP_HTTP_HAVE_CURL
18 PHP_HTTP_API php_http_client_ops_t
*php_http_curl_client_get_ops(void);
20 typedef struct php_http_curl_client
{
26 struct curl_slist
*headers
;
27 struct curl_slist
*resolve
;
28 php_http_buffer_t cookies
;
31 unsigned range_request
:1;
40 php_http_client_progress_t progress
;
42 } php_http_curl_client_t
;
44 typedef struct php_http_curl_client_storage
{
47 char errorbuffer
[0x100];
48 } php_http_curl_client_storage_t
;
50 static inline php_http_curl_client_storage_t
*get_storage(CURL
*ch
) {
51 php_http_curl_client_storage_t
*st
= NULL
;
53 curl_easy_getinfo(ch
, CURLINFO_PRIVATE
, &st
);
56 st
= pecalloc(1, sizeof(*st
), 1);
57 curl_easy_setopt(ch
, CURLOPT_PRIVATE
, st
);
58 curl_easy_setopt(ch
, CURLOPT_ERRORBUFFER
, st
->errorbuffer
);
64 extern STATUS
php_http_curl_client_prepare(php_http_client_t
*h
, php_http_message_t
*msg
);
66 extern zend_class_entry
*php_http_curl_client_class_entry
;
67 extern zend_function_entry php_http_curl_client_method_entry
[];
69 extern zend_object_value
php_http_curl_client_object_new(zend_class_entry
*ce TSRMLS_DC
);
70 extern zend_object_value
php_http_curl_client_object_new_ex(zend_class_entry
*ce
, php_http_client_t
*r
, php_http_client_object_t
**ptr TSRMLS_DC
);
72 PHP_MINIT_FUNCTION(http_curl_client
);
74 #endif /* PHP_HTTP_HAVE_CURL */
75 #endif /* PHP_HTTP_CURL_CLIENT_H */
83 * vim600: noet sw=4 ts=4 fdm=marker
84 * vim<600: noet sw=4 ts=4