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