summaryrefslogtreecommitdiff
path: root/libsoup/soup-message-headers.h
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2008-01-15 17:40:47 +0000
committerDan Winship <danw@src.gnome.org>2008-01-15 17:40:47 +0000
commit96d28e7f42ead1ddde6bccca9fba6831710a531f (patch)
tree8b3fd4ae679d19656aef6264cfcf260e515a8eec /libsoup/soup-message-headers.h
parent3f957a48574e9ac8eba06cf91fb2f101ffcf982d (diff)
downloadlibsoup-96d28e7f42ead1ddde6bccca9fba6831710a531f.tar.gz
Merge libsoup-2.4 branch to trunk
* Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
Diffstat (limited to 'libsoup/soup-message-headers.h')
-rw-r--r--libsoup/soup-message-headers.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/libsoup/soup-message-headers.h b/libsoup/soup-message-headers.h
new file mode 100644
index 00000000..b6eb94e4
--- /dev/null
+++ b/libsoup/soup-message-headers.h
@@ -0,0 +1,71 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2005 Novell, Inc.
+ */
+
+#ifndef SOUP_MESSAGE_HEADERS_H
+#define SOUP_MESSAGE_HEADERS_H 1
+
+#include <libsoup/soup-types.h>
+
+typedef struct SoupMessageHeaders SoupMessageHeaders;
+typedef enum {
+ SOUP_MESSAGE_HEADERS_REQUEST,
+ SOUP_MESSAGE_HEADERS_RESPONSE
+} SoupMessageHeadersType;
+
+SoupMessageHeaders *soup_message_headers_new (SoupMessageHeadersType type);
+
+void soup_message_headers_free (SoupMessageHeaders *hdrs);
+
+void soup_message_headers_append (SoupMessageHeaders *hdrs,
+ const char *name,
+ const char *value);
+void soup_message_headers_replace (SoupMessageHeaders *hdrs,
+ const char *name,
+ const char *value);
+
+void soup_message_headers_remove (SoupMessageHeaders *hdrs,
+ const char *name);
+void soup_message_headers_clear (SoupMessageHeaders *hdrs);
+
+const char *soup_message_headers_get (SoupMessageHeaders *hdrs,
+ const char *name);
+
+typedef void (*SoupMessageHeadersForeachFunc)(const char *name,
+ const char *value,
+ gpointer user_data);
+
+void soup_message_headers_foreach (SoupMessageHeaders *hdrs,
+ SoupMessageHeadersForeachFunc func,
+ gpointer user_data);
+
+/* Specific headers */
+
+typedef enum {
+ SOUP_ENCODING_UNRECOGNIZED,
+ SOUP_ENCODING_NONE,
+ SOUP_ENCODING_CONTENT_LENGTH,
+ SOUP_ENCODING_EOF,
+ SOUP_ENCODING_CHUNKED,
+ SOUP_ENCODING_BYTERANGES
+} SoupEncoding;
+
+SoupEncoding soup_message_headers_get_encoding (SoupMessageHeaders *hdrs);
+void soup_message_headers_set_encoding (SoupMessageHeaders *hdrs,
+ SoupEncoding encoding);
+
+goffset soup_message_headers_get_content_length (SoupMessageHeaders *hdrs);
+void soup_message_headers_set_content_length (SoupMessageHeaders *hdrs,
+ goffset content_length);
+
+typedef enum {
+ SOUP_EXPECTATION_UNRECOGNIZED = (1 << 0),
+ SOUP_EXPECTATION_CONTINUE = (1 << 1)
+} SoupExpectation;
+
+SoupExpectation soup_message_headers_get_expectations (SoupMessageHeaders *hdrs);
+void soup_message_headers_set_expectations (SoupMessageHeaders *hdrs,
+ SoupExpectation expectations);
+
+#endif /* SOUP_MESSAGE_HEADERS_H */