Merge branch 'master' of ssh://git.privoxy.org:23/git/privoxy
[privoxy.git] / parsers.h
1 #ifndef PARSERS_H_INCLUDED
2 #define PARSERS_H_INCLUDED
3 /*********************************************************************
4  *
5  * File        :  $Source: /cvsroot/ijbswa/current/parsers.h,v $
6  *
7  * Purpose     :  Declares functions to parse/crunch headers and pages.
8  *                Functions declared include:
9  *                   `add_to_iob', `client_cookie_adder', `client_from',
10  *                   `client_referrer', `client_send_cookie', `client_ua',
11  *                   `client_uagent', `client_x_forwarded',
12  *                   `client_x_forwarded_adder', `client_xtra_adder',
13  *                   `content_type', `crumble', `destroy_list', `enlist',
14  *                   `flush_socket', `free_http_request', `get_header',
15  *                   `list_to_text', `parse_http_request', `sed',
16  *                   and `server_set_cookie'.
17  *
18  * Copyright   :  Written by and Copyright (C) 2001 members of the
19  *                Privoxy team. https://www.privoxy.org/
20  *
21  *                Based on the Internet Junkbuster originally written
22  *                by and Copyright (C) 1997 Anonymous Coders and
23  *                Junkbusters Corporation.  http://www.junkbusters.com
24  *
25  *                This program is free software; you can redistribute it
26  *                and/or modify it under the terms of the GNU General
27  *                Public License as published by the Free Software
28  *                Foundation; either version 2 of the License, or (at
29  *                your option) any later version.
30  *
31  *                This program is distributed in the hope that it will
32  *                be useful, but WITHOUT ANY WARRANTY; without even the
33  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
34  *                PARTICULAR PURPOSE.  See the GNU General Public
35  *                License for more details.
36  *
37  *                The GNU General Public License should be included with
38  *                this file.  If not, you can view it at
39  *                http://www.gnu.org/copyleft/gpl.html
40  *                or write to the Free Software Foundation, Inc., 59
41  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
42  *
43  *********************************************************************/
44
45
46 #include "project.h"
47
48 /* Used for sed()'s second argument. */
49 #define FILTER_CLIENT_HEADERS 0
50 #define FILTER_SERVER_HEADERS 1
51
52 extern long flush_iob(jb_socket fd, struct iob *iob, unsigned int delay);
53 extern jb_err add_to_iob(struct iob *iob, const size_t buffer_limit, char *src, long n);
54 extern void clear_iob(struct iob *iob);
55 extern jb_err decompress_iob(struct client_state *csp);
56 extern char *get_header(struct iob *iob);
57 extern char *get_header_value(const struct list *header_list, const char *header_name);
58 extern jb_err sed(struct client_state *csp, int filter_server_headers);
59 #ifdef FEATURE_HTTPS_INSPECTION
60 extern jb_err sed_https(struct client_state *csp);
61 #endif
62 extern jb_err update_server_headers(struct client_state *csp);
63 extern void get_http_time(int time_offset, char *buf, size_t buffer_size);
64 extern jb_err get_destination_from_headers(const struct list *headers, struct http_request *http);
65 #ifdef FEATURE_HTTPS_INSPECTION
66 extern jb_err get_destination_from_https_headers(const struct list *headers, struct http_request *http);
67 #endif
68 extern unsigned long long get_expected_content_length(struct list *headers);
69 extern jb_err client_transfer_encoding(struct client_state *csp, char **header);
70
71 #ifdef FEATURE_FORCE_LOAD
72 extern int strclean(char *string, const char *substring);
73 #endif /* def FEATURE_FORCE_LOAD */
74
75 #endif /* ndef PARSERS_H_INCLUDED */
76
77 /*
78   Local Variables:
79   tab-width: 3
80   end:
81 */