2813e9aa539380ed646c9d36666c6b700bf76f1d
[bluesky.git] / libs3-1.4 / inc / response_headers_handler.h
1 /** **************************************************************************
2  * response_headers_handler.h
3  * 
4  * Copyright 2008 Bryan Ischo <bryan@ischo.com>
5  * 
6  * This file is part of libs3.
7  * 
8  * libs3 is free software: you can redistribute it and/or modify it under the
9  * terms of the GNU General Public License as published by the Free Software
10  * Foundation, version 3 of the License.
11  *
12  * In addition, as a special exception, the copyright holders give
13  * permission to link the code of this library and its programs with the
14  * OpenSSL library, and distribute linked combinations including the two.
15  *
16  * libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
17  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
19  * details.
20  *
21  * You should have received a copy of the GNU General Public License version 3
22  * along with libs3, in a file named COPYING.  If not, see
23  * <http://www.gnu.org/licenses/>.
24  *
25  ************************************************************************** **/
26
27 #ifndef RESPONSE_HEADERS_HANDLER_H
28 #define RESPONSE_HEADERS_HANDLER_H
29
30 #include "libs3.h"
31 #include "string_buffer.h"
32 #include "util.h"
33
34
35 typedef struct ResponseHeadersHandler
36 {
37     // The structure to pass to the headers callback.  This is filled in by
38     // the ResponseHeadersHandler from the headers added to it.
39     S3ResponseProperties responseProperties;
40
41     // Set to 1 after the done call has been made
42     int done;
43
44     // copied into here.  We allow 128 bytes for each header, plus \0 term.
45     string_multibuffer(responsePropertyStrings, 5 * 129);
46
47     // responseproperties.metaHeaders strings get copied into here
48     string_multibuffer(responseMetaDataStrings, 
49                        COMPACTED_METADATA_BUFFER_SIZE);
50
51     // Response meta data
52     S3NameValue responseMetaData[S3_MAX_METADATA_COUNT];
53 } ResponseHeadersHandler;
54
55
56 void response_headers_handler_initialize(ResponseHeadersHandler *handler);
57
58 void response_headers_handler_add(ResponseHeadersHandler *handler,
59                                   char *data, int dataLen);
60
61 void response_headers_handler_done(ResponseHeadersHandler *handler, 
62                                    CURL *curl);
63
64 #endif /* RESPONSE_HEADERS_HANDLER_H */