Git init
[profile/ivi/libsoup2.4.git] / libsoup / soup-headers.h
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
12 G_BEGIN_DECLS
13
14 /* HTTP Header Parsing */
15
16 gboolean    soup_headers_parse              (const char          *str,
17                                              int                  len,
18                                              SoupMessageHeaders  *dest);
19
20 guint       soup_headers_parse_request      (const char          *str,
21                                              int                  len,
22                                              SoupMessageHeaders  *req_headers,
23                                              char               **req_method,
24                                              char               **req_path,
25                                              SoupHTTPVersion     *ver);
26
27 gboolean    soup_headers_parse_status_line  (const char          *status_line,
28                                              SoupHTTPVersion     *ver,
29                                              guint               *status_code,
30                                              char               **reason_phrase);
31
32 gboolean    soup_headers_parse_response     (const char          *str,
33                                              int                  len,
34                                              SoupMessageHeaders  *headers,
35                                              SoupHTTPVersion     *ver,
36                                              guint               *status_code,
37                                              char               **reason_phrase);
38
39 /* Individual header parsing */
40
41 GSList     *soup_header_parse_list          (const char       *header);
42 GSList     *soup_header_parse_quality_list  (const char       *header,
43                                              GSList          **unacceptable);
44 void        soup_header_free_list           (GSList           *list);
45
46 gboolean    soup_header_contains            (const char       *header,
47                                              const char       *token);
48
49 GHashTable *soup_header_parse_param_list      (const char       *header);
50 GHashTable *soup_header_parse_semi_param_list (const char       *header);
51 void        soup_header_free_param_list       (GHashTable       *param_list);
52
53 void        soup_header_g_string_append_param (GString          *string,
54                                                const char       *name,
55                                                const char       *value);
56 void        soup_header_g_string_append_param_quoted (GString    *string,
57                                                       const char *name,
58                                                       const char *value);
59
60 G_END_DECLS
61
62 #endif /*SOUP_HEADERS_H*/