diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2005-01-21 17:23:06 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2005-01-21 17:23:06 +0000 |
commit | ac179c61a5984eed8140b4d2d74fb81ceb31069b (patch) | |
tree | 66dd6403583281ccc83c6b55bee200d7694f333a /src/ne_request.h | |
parent | 4b68054087e60519e95f65d34ec5b8774c49867f (diff) | |
download | neon-ac179c61a5984eed8140b4d2d74fb81ceb31069b.tar.gz |
Add a response-header iterator interface, needed by OpenOffice:
* src/ne_request.c (struct ne_request_s): Add current_index field.
(ne_response_header_iterate): New function.
* test/request.c (iterate_many, iterate_none): New tests.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@439 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src/ne_request.h')
-rw-r--r-- | src/ne_request.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ne_request.h b/src/ne_request.h index 20284d2..6161545 100644 --- a/src/ne_request.h +++ b/src/ne_request.h @@ -140,10 +140,20 @@ typedef int (*ne_block_reader)(void *userdata, const char *buf, size_t len); void ne_add_response_body_reader(ne_request *req, ne_accept_response accpt, ne_block_reader reader, void *userdata); -/* Retrieve a response header of given name; returns NULL if response - * header with given name was not found. */ +/* Retrieve the value of the a response header field with given name; + * returns NULL if response header with given name was not found. */ const char *ne_get_response_header(ne_request *req, const char *name); +/* Iterator interface for response headers: if passed a NULL cursor, + * returns the first header; if passed a non-NULL cursor pointer, + * returns the next header. Return value is a cursor pointer. If + * return value is non-NULL, *name and *value are set to the name and + * value of the header field. If return value is NULL, no more + * headers are found, *name and *value are undefined. The order in + * which response headers is returned is undefined. */ +void *ne_response_header_iterate(ne_request *req, void *cursor, + const char **name, const char **value); + /* Adds a header to the request with given name and value. */ void ne_add_request_header(ne_request *req, const char *name, const char *value); |