1 | /* |
---|
2 | * http_hdrs.h -- This file contains declarations for http headers |
---|
3 | * Created: Christopher Blizzard <blizzard@appliedtheory.com>, 3-Aug-1998 |
---|
4 | * |
---|
5 | * Copyright (C) 1998 Free Software Foundation |
---|
6 | * |
---|
7 | * This library is free software; you can redistribute it and/or |
---|
8 | * modify it under the terms of the GNU Library General Public |
---|
9 | * License as published by the Free Software Foundation; either |
---|
10 | * version 2 of the License, or (at your option) any later version. |
---|
11 | * |
---|
12 | * This library is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
15 | * Library General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU Library General Public |
---|
18 | * License along with this library; if not, write to the Free |
---|
19 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef HTTP_HDRS_H |
---|
23 | #define HTTP_HDRS_H |
---|
24 | |
---|
25 | #include "ghttp_constants.h" |
---|
26 | |
---|
27 | /* the list of known headers */ |
---|
28 | extern const char *http_hdr_known_list[]; |
---|
29 | |
---|
30 | /* a header list */ |
---|
31 | #define HTTP_HDRS_MAX 256 |
---|
32 | typedef struct http_hdr_list_tag |
---|
33 | { |
---|
34 | char *header[HTTP_HDRS_MAX]; |
---|
35 | char *value[HTTP_HDRS_MAX]; |
---|
36 | } http_hdr_list; |
---|
37 | |
---|
38 | /* functions dealing with headers */ |
---|
39 | |
---|
40 | /* check to see if the library knows about the header */ |
---|
41 | const char * |
---|
42 | http_hdr_is_known(const char *a_hdr); |
---|
43 | |
---|
44 | /* create a new list */ |
---|
45 | http_hdr_list * |
---|
46 | http_hdr_list_new(void); |
---|
47 | |
---|
48 | /* destroy a list */ |
---|
49 | void |
---|
50 | http_hdr_list_destroy(http_hdr_list *a_list); |
---|
51 | |
---|
52 | /* set a value in a list */ |
---|
53 | int |
---|
54 | http_hdr_set_value(http_hdr_list *a_list, |
---|
55 | const char *a_name, |
---|
56 | const char *a_val); |
---|
57 | |
---|
58 | /* set the value in a list from a range, not a NTS */ |
---|
59 | int |
---|
60 | http_hdr_set_value_no_nts(http_hdr_list *a_list, |
---|
61 | const char *a_name_start, |
---|
62 | int a_name_len, |
---|
63 | const char *a_val_start, |
---|
64 | int a_val_len); |
---|
65 | |
---|
66 | /* get a copy of a value in a list */ |
---|
67 | char * |
---|
68 | http_hdr_get_value(http_hdr_list *a_list, |
---|
69 | const char *a_name); |
---|
70 | |
---|
71 | /* get a copy of the headers in a list */ |
---|
72 | int |
---|
73 | http_hdr_get_headers(http_hdr_list *a_list, |
---|
74 | char ***a_names, |
---|
75 | int *a_num_names); |
---|
76 | |
---|
77 | /* clear a header in a list */ |
---|
78 | int |
---|
79 | http_hdr_clear_value(http_hdr_list *a_list, |
---|
80 | const char *a_name); |
---|
81 | |
---|
82 | |
---|
83 | #endif /* HTTP_HDRS_H */ |
---|