1 #ifndef PHP_HTTP_HEADER_PARSER_H
2 #define PHP_HTTP_HEADER_PARSER_H
4 #include "php_http_info.h"
6 typedef enum php_http_header_parser_state
{
7 PHP_HTTP_HEADER_PARSER_STATE_FAILURE
= FAILURE
,
8 PHP_HTTP_HEADER_PARSER_STATE_START
= 0,
9 PHP_HTTP_HEADER_PARSER_STATE_KEY
,
10 PHP_HTTP_HEADER_PARSER_STATE_VALUE
,
11 PHP_HTTP_HEADER_PARSER_STATE_HEADER_DONE
,
12 PHP_HTTP_HEADER_PARSER_STATE_DONE
13 } php_http_header_parser_state_t
;
15 #define PHP_HTTP_HEADER_PARSER_CLEANUP 0x1
17 typedef struct php_http_header_parser
{
31 } php_http_header_parser_t
;
33 PHP_HTTP_API php_http_header_parser_t
*php_http_header_parser_init(php_http_header_parser_t
*parser TSRMLS_DC
);
34 PHP_HTTP_API php_http_header_parser_state_t
php_http_header_parser_state_push(php_http_header_parser_t
*parser
, unsigned argc
, ...);
35 PHP_HTTP_API php_http_header_parser_state_t
php_http_header_parser_state_is(php_http_header_parser_t
*parser
);
36 PHP_HTTP_API php_http_header_parser_state_t
php_http_header_parser_state_pop(php_http_header_parser_t
*parser
);
37 PHP_HTTP_API
void php_http_header_parser_dtor(php_http_header_parser_t
*parser
);
38 PHP_HTTP_API
void php_http_header_parser_free(php_http_header_parser_t
**parser
);
39 PHP_HTTP_API STATUS
php_http_header_parser_parse(php_http_header_parser_t
*parser
, php_http_buffer_t
*buffer
, unsigned flags
, HashTable
*headers
, php_http_info_callback_t callback_func
, void *callback_arg
);
41 #endif /* PHP_HTTP_HEADER_PARSER_H */