- fix win32 build
[m6w6/ext-http] / php_http_info_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_INFO_API_H
16 #define PHP_HTTP_INFO_API_H
17
18 #define IS_HTTP_REQUEST 1
19 #define IS_HTTP_RESPONSE 2
20
21 #define HTTP_INFO(ptr) (ptr)->http.info
22
23 typedef struct _http_request_info_t {
24 char *method;
25 char *url;
26 } http_request_info;
27
28 typedef struct _http_response_info_t {
29 int code;
30 char *status;
31 } http_response_info;
32
33 typedef union _http_info_union_t {
34 http_request_info request;
35 http_response_info response;
36 } http_info_union;
37
38 struct http_info {
39 http_info_union info;
40 double version;
41 };
42
43 typedef struct _http_info_t {
44 struct http_info http;
45 int type;
46 } http_info;
47
48 typedef void (*http_info_callback)(void **callback_data, HashTable **headers, http_info *info TSRMLS_DC);
49
50 #define http_info_default_callback _http_info_default_callback
51 PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC);
52 #define http_info_dtor _http_info_dtor
53 PHP_HTTP_API void _http_info_dtor(http_info *info);
54 #define http_info_parse(p, i) _http_info_parse_ex((p), (i), 1 TSRMLS_CC)
55 #define http_info_parse_ex(p, i, s) _http_info_parse_ex((p), (i), (s) TSRMLS_CC)
56 PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info , zend_bool silent TSRMLS_DC);
57
58 #endif
59
60 /*
61 * Local variables:
62 * tab-width: 4
63 * c-basic-offset: 4
64 * End:
65 * vim600: noet sw=4 ts=4 fdm=marker
66 * vim<600: noet sw=4 ts=4
67 */
68