build and file maintenance
[m6w6/ext-http] / php_http_headers.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.h"
14
15 PHP_HTTP_API STATUS php_http_headers_parse(const char *header, size_t length, HashTable *headers, php_http_info_callback_t callback_func, void **callback_data TSRMLS_DC)
16 {
17 php_http_header_parser_t ctx;
18 php_http_buffer_t buf;
19
20 php_http_buffer_from_string_ex(&buf, header, length);
21 php_http_header_parser_init(&ctx TSRMLS_CC);
22 php_http_header_parser_parse(&ctx, &buf, PHP_HTTP_HEADER_PARSER_CLEANUP, headers, callback_func, callback_data);
23 php_http_header_parser_dtor(&ctx);
24 php_http_buffer_dtor(&buf);
25 /* FIXME */
26 return SUCCESS;
27 }
28
29 /*
30 * Local variables:
31 * tab-width: 4
32 * c-basic-offset: 4
33 * End:
34 * vim600: noet sw=4 ts=4 fdm=marker
35 * vim<600: noet sw=4 ts=4
36 */
37