diff options
Diffstat (limited to 'inc/response_headers_handler.h')
-rw-r--r-- | inc/response_headers_handler.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/inc/response_headers_handler.h b/inc/response_headers_handler.h new file mode 100644 index 0000000..817a1fc --- /dev/null +++ b/inc/response_headers_handler.h @@ -0,0 +1,62 @@ +/** ************************************************************************** + * response_haeders_handler.h + * + * Copyright 2008 Bryan Ischo <bryan@ischo.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the + * + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + ************************************************************************** **/ + +#ifndef RESPONSE_HEADERS_HANDLER_H +#define RESPONSE_HEADERS_HANDLER_H + +#include "libs3.h" +#include "string_buffer.h" +#include "util.h" + + +typedef struct ResponseHeadersHandler +{ + // The structure to pass to the headers callback. This is filled in by + // the ResponseHeadersHandler from the headers added to it. + S3ResponseHeaders responseHeaders; + + // Set to 1 after the done call has been made + int done; + + // copied into here. We allow 128 bytes for each header, plus \0 term. + string_multibuffer(responseHeaderStrings, 5 * 129); + + // responseHeaders.metaHeaders strings get copied into here + string_multibuffer(responseMetaHeaderStrings, + COMPACTED_META_HEADER_BUFFER_SIZE); + + // Response meta headers + S3NameValue responseMetaHeaders[MAX_META_HEADER_COUNT]; +} ResponseHeadersHandler; + + +void response_headers_handler_initialize(ResponseHeadersHandler *handler); + +void response_headers_handler_add(ResponseHeadersHandler *handler, + char *data, int dataLen); + +void response_headers_handler_done(ResponseHeadersHandler *handler, + CURL *curl); + +#endif /* RESPONSE_HEADERS_HANDLER_H */ |