1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright (C) 2001-2003, Ximian, Inc.
4 */
5
6#ifndef __SOUP_HEADERS_H__
7#define __SOUP_HEADERS_H__ 1
8
9#include <glib.h>
10#include <libsoup/soup-message.h>
11
12G_BEGIN_DECLS
13
14/* HTTP Header Parsing */
15
16SOUP_AVAILABLE_IN_2_26
17gboolean soup_headers_parse (const char *str,
18 int len,
19 SoupMessageHeaders *dest);
20
21SOUP_AVAILABLE_IN_2_4
22guint soup_headers_parse_request (const char *str,
23 int len,
24 SoupMessageHeaders *req_headers,
25 char **req_method,
26 char **req_path,
27 SoupHTTPVersion *ver);
28
29SOUP_AVAILABLE_IN_2_4
30gboolean soup_headers_parse_status_line (const char *status_line,
31 SoupHTTPVersion *ver,
32 guint *status_code,
33 char **reason_phrase);
34
35SOUP_AVAILABLE_IN_2_4
36gboolean soup_headers_parse_response (const char *str,
37 int len,
38 SoupMessageHeaders *headers,
39 SoupHTTPVersion *ver,
40 guint *status_code,
41 char **reason_phrase);
42
43/* Individual header parsing */
44SOUP_AVAILABLE_IN_2_4
45GSList *soup_header_parse_list (const char *header);
46SOUP_AVAILABLE_IN_2_4
47GSList *soup_header_parse_quality_list (const char *header,
48 GSList **unacceptable);
49SOUP_AVAILABLE_IN_2_4
50void soup_header_free_list (GSList *list);
51
52SOUP_AVAILABLE_IN_2_4
53gboolean soup_header_contains (const char *header,
54 const char *token);
55
56SOUP_AVAILABLE_IN_2_4
57GHashTable *soup_header_parse_param_list (const char *header);
58SOUP_AVAILABLE_IN_2_24
59GHashTable *soup_header_parse_semi_param_list (const char *header);
60SOUP_AVAILABLE_IN_2_66
61GHashTable *soup_header_parse_param_list_strict (const char *header);
62SOUP_AVAILABLE_IN_2_66
63GHashTable *soup_header_parse_semi_param_list_strict (const char *header);
64SOUP_AVAILABLE_IN_2_4
65void soup_header_free_param_list (GHashTable *param_list);
66
67SOUP_AVAILABLE_IN_2_26
68void soup_header_g_string_append_param (GString *string,
69 const char *name,
70 const char *value);
71SOUP_AVAILABLE_IN_2_30
72void soup_header_g_string_append_param_quoted (GString *string,
73 const char *name,
74 const char *value);
75
76G_END_DECLS
77
78#endif /* __SOUP_HEADERS_H__ */
79