- fix regressin
[m6w6/ext-http] / php_http_request_method_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-2007, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_REQUEST_METHOD_API_H
16 #define PHP_HTTP_REQUEST_METHOD_API_H
17
18 typedef enum _http_request_method_t {
19 /* force the enum to be signed */
20 HTTP_NEG_REQUEST_METHOD =-1,
21 HTTP_NO_REQUEST_METHOD = 0,
22 /* HTTP/1.1 */
23 HTTP_GET = 1,
24 HTTP_HEAD = 2,
25 HTTP_POST = 3,
26 HTTP_PUT = 4,
27 HTTP_DELETE = 5,
28 HTTP_OPTIONS = 6,
29 HTTP_TRACE = 7,
30 HTTP_CONNECT = 8,
31 /* WebDAV - RFC 2518 */
32 HTTP_PROPFIND = 9,
33 HTTP_PROPPATCH = 10,
34 HTTP_MKCOL = 11,
35 HTTP_COPY = 12,
36 HTTP_MOVE = 13,
37 HTTP_LOCK = 14,
38 HTTP_UNLOCK = 15,
39 /* WebDAV Versioning - RFC 3253 */
40 HTTP_VERSION_CONTROL = 16,
41 HTTP_REPORT = 17,
42 HTTP_CHECKOUT = 18,
43 HTTP_CHECKIN = 19,
44 HTTP_UNCHECKOUT = 20,
45 HTTP_MKWORKSPACE = 21,
46 HTTP_UPDATE = 22,
47 HTTP_LABEL = 23,
48 HTTP_MERGE = 24,
49 HTTP_BASELINE_CONTROL = 25,
50 HTTP_MKACTIVITY = 26,
51 /* WebDAV Access Control - RFC 3744 */
52 HTTP_ACL = 27,
53 HTTP_MAX_REQUEST_METHOD = 28
54 } http_request_method;
55
56 #define HTTP_MIN_REQUEST_METHOD (HTTP_NO_REQUEST_METHOD + 1)
57 #define HTTP_CUSTOM_REQUEST_METHOD_START HTTP_MAX_REQUEST_METHOD
58
59 typedef struct _http_request_method_entry_t {
60 char *name;
61 char *cnst;
62 } http_request_method_entry;
63
64 #define HTTP_STD_REQUEST_METHOD(m) ((m > HTTP_NO_REQUEST_METHOD) && (m < HTTP_MAX_REQUEST_METHOD))
65 #define HTTP_CUSTOM_REQUEST_METHOD(m) (m - HTTP_MAX_REQUEST_METHOD)
66
67 extern PHP_MINIT_FUNCTION(http_request_method);
68 extern PHP_RINIT_FUNCTION(http_request_method);
69 extern PHP_RSHUTDOWN_FUNCTION(http_request_method);
70
71 #define http_request_method_name(m) _http_request_method_name((m) TSRMLS_CC)
72 PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC);
73
74 #define http_request_method_exists(u, l, c) _http_request_method_exists((u), (l), (c) TSRMLS_CC)
75 PHP_HTTP_API int _http_request_method_exists(zend_bool by_name, http_request_method id, const char *name TSRMLS_DC);
76
77 #define http_request_method_register(m, l) _http_request_method_register((m), (l) TSRMLS_CC)
78 PHP_HTTP_API int _http_request_method_register(const char *method, int method_name_len TSRMLS_DC);
79
80 #define http_request_method_unregister(mn) _http_request_method_unregister((mn) TSRMLS_CC)
81 PHP_HTTP_API STATUS _http_request_method_unregister(int method TSRMLS_DC);
82
83 #endif
84
85 /*
86 * Local variables:
87 * tab-width: 4
88 * c-basic-offset: 4
89 * End:
90 * vim600: noet sw=4 ts=4 fdm=marker
91 * vim<600: noet sw=4 ts=4
92 */
93