• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 SOUP_AVAILABLE_IN_2_26
17 gboolean    soup_headers_parse              (const char          *str,
18 					     int                  len,
19 					     SoupMessageHeaders  *dest);
20 
21 SOUP_AVAILABLE_IN_2_4
22 guint       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 
29 SOUP_AVAILABLE_IN_2_4
30 gboolean    soup_headers_parse_status_line  (const char          *status_line,
31 					     SoupHTTPVersion     *ver,
32 					     guint               *status_code,
33 					     char               **reason_phrase);
34 
35 SOUP_AVAILABLE_IN_2_4
36 gboolean    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 */
44 SOUP_AVAILABLE_IN_2_4
45 GSList     *soup_header_parse_list          (const char       *header);
46 SOUP_AVAILABLE_IN_2_4
47 GSList     *soup_header_parse_quality_list  (const char       *header,
48 					     GSList          **unacceptable);
49 SOUP_AVAILABLE_IN_2_4
50 void        soup_header_free_list           (GSList           *list);
51 
52 SOUP_AVAILABLE_IN_2_4
53 gboolean    soup_header_contains            (const char       *header,
54 					     const char       *token);
55 
56 SOUP_AVAILABLE_IN_2_4
57 GHashTable *soup_header_parse_param_list      (const char       *header);
58 SOUP_AVAILABLE_IN_2_24
59 GHashTable *soup_header_parse_semi_param_list (const char       *header);
60 SOUP_AVAILABLE_IN_2_66
61 GHashTable *soup_header_parse_param_list_strict      (const char       *header);
62 SOUP_AVAILABLE_IN_2_66
63 GHashTable *soup_header_parse_semi_param_list_strict (const char       *header);
64 SOUP_AVAILABLE_IN_2_4
65 void        soup_header_free_param_list       (GHashTable       *param_list);
66 
67 SOUP_AVAILABLE_IN_2_26
68 void        soup_header_g_string_append_param (GString          *string,
69 					       const char       *name,
70 					       const char       *value);
71 SOUP_AVAILABLE_IN_2_30
72 void        soup_header_g_string_append_param_quoted (GString    *string,
73 						      const char *name,
74 						      const char *value);
75 
76 G_END_DECLS
77 
78 #endif /* __SOUP_HEADERS_H__ */
79