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-2006, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
15 #ifndef PHP_HTTP_REQUEST_API_H
16 #define PHP_HTTP_REQUEST_API_H
20 #include "php_http_request_body_api.h"
21 #include "php_http_request_method_api.h"
23 extern PHP_MINIT_FUNCTION(http_request
);
24 extern PHP_MSHUTDOWN_FUNCTION(http_request
);
29 http_request_method meth
;
30 http_request_body
*body
;
33 curl_infotype last_type
;
41 struct curl_slist
*headers
;
44 char _error
[CURL_ERROR_SIZE
+1];
45 zval
*_progress_callback
;
53 #define http_curl_init(r) http_curl_init_ex(NULL, (r))
54 #define http_curl_init_ex(c, r) _http_curl_init_ex((c), (r))
55 PHP_HTTP_API CURL
*_http_curl_init_ex(CURL
*ch
, http_request
*request
);
57 #define http_curl_free(c) _http_curl_free(c)
58 PHP_HTTP_API
void _http_curl_free(CURL
**ch
);
60 #define http_request_new() _http_request_init_ex(NULL, NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC)
61 #define http_request_init(r) _http_request_init_ex((r), NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC)
62 #define http_request_init_ex(r, c, m, u) _http_request_init_ex((r), (c), (m), (u) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC)
63 PHP_HTTP_API http_request
*_http_request_init_ex(http_request
*request
, CURL
*ch
, http_request_method meth
, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC
);
65 #define http_request_dtor(r) _http_request_dtor((r))
66 PHP_HTTP_API
void _http_request_dtor(http_request
*request
);
68 #define http_request_free(r) _http_request_free((r))
69 PHP_HTTP_API
void _http_request_free(http_request
**request
);
71 #define http_request_reset(r) _http_request_reset(r)
72 PHP_HTTP_API
void _http_request_reset(http_request
*r
);
74 #define http_request_defaults(r) _http_request_defaults(r)
75 PHP_HTTP_API
void _http_request_defaults(http_request
*request
);
77 #define http_request_prepare(r, o) _http_request_prepare((r), (o))
78 PHP_HTTP_API STATUS
_http_request_prepare(http_request
*request
, HashTable
*options
);
80 #define http_request_exec(r) _http_request_exec((r))
81 PHP_HTTP_API
void _http_request_exec(http_request
*request
);
83 #define http_request_info(r, i) _http_request_info((r), (i))
84 PHP_HTTP_API
void _http_request_info(http_request
*request
, HashTable
*info
);
86 #define http_request_set_progress_callback(r, cb) _http_request_set_progress_callback((r), (cb))
87 PHP_HTTP_API
void _http_request_set_progress_callback(http_request
*request
, zval
*cb
);
97 * vim600: noet sw=4 ts=4 fdm=marker
98 * vim<600: noet sw=4 ts=4