1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2005 Novell, Inc.
6 #ifndef __SOUP_MESSAGE_HEADERS_H__
7 #define __SOUP_MESSAGE_HEADERS_H__ 1
9 #include <libsoup/soup-types.h>
13 typedef struct SoupMessageHeaders SoupMessageHeaders;
15 GType soup_message_headers_get_type (void);
16 #define SOUP_TYPE_MESSAGE_HEADERS (soup_message_headers_get_type ())
19 SOUP_MESSAGE_HEADERS_REQUEST,
20 SOUP_MESSAGE_HEADERS_RESPONSE,
21 SOUP_MESSAGE_HEADERS_MULTIPART
22 } SoupMessageHeadersType;
25 SoupMessageHeaders *soup_message_headers_new (SoupMessageHeadersType type);
28 void soup_message_headers_free (SoupMessageHeaders *hdrs);
31 void soup_message_headers_append (SoupMessageHeaders *hdrs,
35 void soup_message_headers_replace (SoupMessageHeaders *hdrs,
40 void soup_message_headers_remove (SoupMessageHeaders *hdrs,
43 void soup_message_headers_clear (SoupMessageHeaders *hdrs);
45 SOUP_AVAILABLE_IN_2_36
46 void soup_message_headers_clean_connection_headers (SoupMessageHeaders *hdrs);
48 #ifndef SOUP_DISABLE_DEPRECATED
50 SOUP_DEPRECATED_IN_2_28_FOR ("soup_message_headers_get_one or soup_message_headers_get_list")
51 const char *soup_message_headers_get (SoupMessageHeaders *hdrs,
54 SOUP_AVAILABLE_IN_2_28
55 const char *soup_message_headers_get_one (SoupMessageHeaders *hdrs,
57 SOUP_AVAILABLE_IN_2_28
58 const char *soup_message_headers_get_list (SoupMessageHeaders *hdrs,
60 SOUP_AVAILABLE_IN_2_50
61 gboolean soup_message_headers_header_contains (SoupMessageHeaders *hdrs,
64 SOUP_AVAILABLE_IN_2_50
65 gboolean soup_message_headers_header_equals (SoupMessageHeaders *hdrs,
69 typedef void (*SoupMessageHeadersForeachFunc)(const char *name,
74 void soup_message_headers_foreach (SoupMessageHeaders *hdrs,
75 SoupMessageHeadersForeachFunc func,
78 SOUP_AVAILABLE_IN_2_50
79 SoupMessageHeadersType soup_message_headers_get_headers_type (SoupMessageHeaders *hdrs);
84 } SoupMessageHeadersIter;
87 void soup_message_headers_iter_init (SoupMessageHeadersIter *iter,
88 SoupMessageHeaders *hdrs);
90 gboolean soup_message_headers_iter_next (SoupMessageHeadersIter *iter,
94 /* Specific headers */
97 SOUP_ENCODING_UNRECOGNIZED,
99 SOUP_ENCODING_CONTENT_LENGTH,
101 SOUP_ENCODING_CHUNKED,
102 SOUP_ENCODING_BYTERANGES
105 SOUP_AVAILABLE_IN_2_4
106 SoupEncoding soup_message_headers_get_encoding (SoupMessageHeaders *hdrs);
107 SOUP_AVAILABLE_IN_2_4
108 void soup_message_headers_set_encoding (SoupMessageHeaders *hdrs,
109 SoupEncoding encoding);
111 SOUP_AVAILABLE_IN_2_4
112 goffset soup_message_headers_get_content_length (SoupMessageHeaders *hdrs);
113 SOUP_AVAILABLE_IN_2_4
114 void soup_message_headers_set_content_length (SoupMessageHeaders *hdrs,
115 goffset content_length);
118 SOUP_EXPECTATION_UNRECOGNIZED = (1 << 0),
119 SOUP_EXPECTATION_CONTINUE = (1 << 1)
122 SOUP_AVAILABLE_IN_2_4
123 SoupExpectation soup_message_headers_get_expectations (SoupMessageHeaders *hdrs);
124 SOUP_AVAILABLE_IN_2_4
125 void soup_message_headers_set_expectations (SoupMessageHeaders *hdrs,
126 SoupExpectation expectations);
133 SOUP_AVAILABLE_IN_2_26
134 gboolean soup_message_headers_get_ranges (SoupMessageHeaders *hdrs,
135 goffset total_length,
138 SOUP_AVAILABLE_IN_2_26
139 void soup_message_headers_free_ranges (SoupMessageHeaders *hdrs,
141 SOUP_AVAILABLE_IN_2_26
142 void soup_message_headers_set_ranges (SoupMessageHeaders *hdrs,
145 SOUP_AVAILABLE_IN_2_26
146 void soup_message_headers_set_range (SoupMessageHeaders *hdrs,
150 SOUP_AVAILABLE_IN_2_26
151 gboolean soup_message_headers_get_content_range (SoupMessageHeaders *hdrs,
154 goffset *total_length);
155 SOUP_AVAILABLE_IN_2_26
156 void soup_message_headers_set_content_range (SoupMessageHeaders *hdrs,
159 goffset total_length);
162 SOUP_AVAILABLE_IN_2_26
163 const char *soup_message_headers_get_content_type (SoupMessageHeaders *hdrs,
164 GHashTable **params);
165 SOUP_AVAILABLE_IN_2_26
166 void soup_message_headers_set_content_type (SoupMessageHeaders *hdrs,
167 const char *content_type,
170 SOUP_AVAILABLE_IN_2_26
171 gboolean soup_message_headers_get_content_disposition (SoupMessageHeaders *hdrs,
173 GHashTable **params);
174 SOUP_AVAILABLE_IN_2_26
175 void soup_message_headers_set_content_disposition (SoupMessageHeaders *hdrs,
176 const char *disposition,
181 #endif /* __SOUP_MESSAGE_HEADERS_H__ */