#ifndef PARSERS_H_INCLUDED
#define PARSERS_H_INCLUDED
/*********************************************************************
 *
 * File        :  $Source: /cvsroot/ijbswa/current/parsers.h,v $
 *
 * Purpose     :  Declares functions to parse/crunch headers and pages.
 *                Functions declared include:
 *                   `add_to_iob', `client_cookie_adder', `client_from',
 *                   `client_referrer', `client_send_cookie', `client_ua',
 *                   `client_uagent', `client_x_forwarded',
 *                   `client_x_forwarded_adder', `client_xtra_adder',
 *                   `content_type', `crumble', `destroy_list', `enlist',
 *                   `flush_socket', `free_http_request', `get_header',
 *                   `parse_http_request', `sed',
 *                   and `server_set_cookie'.
 *
 * Copyright   :  Written by and Copyright (C) 2001 members of the
 *                Privoxy team. https://www.privoxy.org/
 *
 *                Based on the Internet Junkbuster originally written
 *                by and Copyright (C) 1997 Anonymous Coders and
 *                Junkbusters Corporation.  http://www.junkbusters.com
 *
 *                This program is free software; you can redistribute it
 *                and/or modify it under the terms of the GNU General
 *                Public License as published by the Free Software
 *                Foundation; either version 2 of the License, or (at
 *                your option) any later version.
 *
 *                This program 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 General Public
 *                License for more details.
 *
 *                The GNU General Public License should be included with
 *                this file.  If not, you can view it at
 *                http://www.gnu.org/copyleft/gpl.html
 *                or write to the Free Software Foundation, Inc., 59
 *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 *********************************************************************/


#include "project.h"

/* Used for sed()'s second argument. */
#define FILTER_CLIENT_HEADERS 0
#define FILTER_SERVER_HEADERS 1

extern long flush_iob(jb_socket fd, struct iob *iob, unsigned int delay);
extern int can_add_to_iob(const struct iob *iob, const size_t buffer_limit, size_t n);
extern jb_err add_to_iob(struct iob *iob, const size_t buffer_limit, const char *src, long n);
extern void clear_iob(struct iob *iob);
extern jb_err decompress_iob(struct client_state *csp);
extern char *get_header(struct iob *iob);
extern char *get_header_value(const struct list *header_list, const char *header_name);
extern jb_err sed(struct client_state *csp, int filter_server_headers);
#ifdef FEATURE_HTTPS_INSPECTION
extern jb_err sed_https(struct client_state *csp);
#endif
extern jb_err header_adjust_content_length(char **header, size_t content_length);
extern jb_err update_server_headers(struct client_state *csp);
extern void get_http_time(int time_offset, char *buf, size_t buffer_size);
extern jb_err get_destination_from_headers(const struct list *headers, struct http_request *http);
#ifdef FEATURE_HTTPS_INSPECTION
extern jb_err get_destination_from_https_headers(const struct list *headers, struct http_request *http);
#endif
extern unsigned long long get_expected_content_length(struct list *headers);
extern jb_err client_transfer_encoding(struct client_state *csp, char **header);

#ifdef FEATURE_FORCE_LOAD
extern int strclean(char *string, const char *substring);
#endif /* def FEATURE_FORCE_LOAD */

#endif /* ndef PARSERS_H_INCLUDED */

/*
  Local Variables:
  tab-width: 3
  end:
*/
