import 2.0 devl branch, suitable for PHP-trunk
[m6w6/ext-http] / php_http_strlist.h
1 #ifndef PHP_HTTP_STRLIST_H
2 #define PHP_HTTP_STRLIST_H
3
4 #ifdef NUL
5 # undef NUL
6 #endif
7 #define NUL "\0"
8
9 #define PHP_HTTP_STRLIST(name) const char name[]
10 #define PHP_HTTP_STRLIST_ITEM(item) item NUL
11 #define PHP_HTTP_STRLIST_NEXT NUL
12 #define PHP_HTTP_STRLIST_STOP NUL NUL
13
14 PHP_HTTP_API const char *php_http_strlist_find(const char list[], unsigned factor, unsigned item);
15
16 typedef struct php_http_strlist_iterator {
17 const char *p;
18 unsigned factor, major, minor;
19 } php_http_strlist_iterator_t;
20
21 PHP_HTTP_API php_http_strlist_iterator_t *php_http_strlist_iterator_init(php_http_strlist_iterator_t *iter, const char list[], unsigned factor);
22 PHP_HTTP_API const char *php_http_strlist_iterator_this(php_http_strlist_iterator_t *iter, unsigned *id);
23 PHP_HTTP_API const char *php_http_strlist_iterator_next(php_http_strlist_iterator_t *iter);
24 PHP_HTTP_API void php_http_strlist_iterator_dtor(php_http_strlist_iterator_t *iter);
25 PHP_HTTP_API void php_http_strlist_iterator_free(php_http_strlist_iterator_t **iter);
26
27 #endif /* PHP_HTTP_STRLIST_H */