1 #ifndef PARSERS_H_INCLUDED
2 #define PARSERS_H_INCLUDED
3 /*********************************************************************
5 * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $
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'.
18 * Copyright : Written by and Copyright (C) 2001 members of the
19 * Privoxy team. http://www.privoxy.org/
21 * Based on the Internet Junkbuster originally written
22 * by and Copyright (C) 1997 Anonymous Coders and
23 * Junkbusters Corporation. http://www.junkbusters.com
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.
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.
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.
43 *********************************************************************/
48 /* Used for sed()'s second argument. */
49 #define FILTER_CLIENT_HEADERS 0
50 #define FILTER_SERVER_HEADERS 1
52 extern long flush_socket(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 extern jb_err update_server_headers(struct client_state *csp);
60 extern void get_http_time(int time_offset, char *buf, size_t buffer_size);
61 extern jb_err get_destination_from_headers(const struct list *headers, struct http_request *http);
62 extern unsigned long long get_expected_content_length(struct list *headers);
63 extern jb_err client_transfer_encoding(struct client_state *csp, char **header);
65 #ifdef FEATURE_FORCE_LOAD
66 extern int strclean(char *string, const char *substring);
67 #endif /* def FEATURE_FORCE_LOAD */
69 #endif /* ndef PARSERS_H_INCLUDED */