13561adba1dc89e26db795fd838d32a98100724d
[m6w6/ext-http] / php_http_request_method.c
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-2011, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 #include "php_http_api.h"
14
15 PHP_HTTP_API int php_http_request_method_is(const char *meth, int argc, ...)
16 {
17 va_list argv;
18 int match = -1;
19
20 if (argc > 0) {
21 int i;
22
23 va_start(argv, argc);
24 for (i = 0; i < argc; ++i) {
25 const char *test = va_arg(argv, const char *);
26
27 if (!strcasecmp(meth, test)) {
28 match = i;
29 break;
30 }
31 }
32 va_end(argv);
33 }
34
35 return match;
36 }
37
38 /*
39 * Local variables:
40 * tab-width: 4
41 * c-basic-offset: 4
42 * End:
43 * vim600: noet sw=4 ts=4 fdm=marker
44 * vim<600: noet sw=4 ts=4
45 */
46