Search packages:
 Sourcecode: c-icap version 1:0.1.4-11:0.1.5-11:0.1.6-11:0.1.6-1ubuntu120080706rc320080706rc3-120080706rc3-2

/*
*  Copyright (C) 2004-2008 Christos Tsantilas
*
*  This program is free software; you can redistribute it and/or
*  modify it under the terms of the GNU Lesser General Public
*  version 2.1 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
*  Lesser General Public License for more details.
*
*  You should have received a copy of the GNU Lesser General Public
*  License along with this library; if not, write to the Free Software
*  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
*  MA  02110-1301  USA.
*/

#include "c-icap.h"

/**
\ingroup API
*/

ICAP_FROM, ICAP_HOST, ICAP_REFERER,
ICAP_USERAGENT,ICAP_PREVIEW
};

enum ci_encapsulated_entities {ICAP_REQ_HDR, ICAP_RES_HDR,
ICAP_REQ_BODY, ICAP_RES_BODY,
ICAP_NULL_BODY,ICAP_OPT_BODY };
CI_DECLARE_DATA extern const char *ci_encaps_entities[];

#ifdef __CYGWIN__

const char *ci_encaps_entity_string(int e);

#else

#define ci_encaps_entity_string(e) (e<=ICAP_OPT_BODY&&e>=ICAP_REQ_HDR?ci_encaps_entities[e]:"UNKNOWN")

#endif

/**
* This is a struct which can store a set of headers.
* The developers should not touch ci_headers_list_t objects directly but better use the
* documented macros and functions
*/
int size;
int used;
int bufsize;
int bufused;
char *buf;
int packed;

00077 typedef struct ci_encaps_entity{
int start;
int type;
void *entity;
} ci_encaps_entity_t;

#define BUFSIZE          4096

/**
* Allocate memory for a ci_headers_list_t object and initialize it.
\return the allocated object on success, NULL otherwise.
*
*/

/**
\param heads is a pointer to the ci_headers_list_t object to be destroyed
*
*/

/**
* Resets and initialize a ci_headers_list_t object
*
*/

/**
*
*example usage:
\code
\endcode
*
*/

/**
\return non zero on success zero otherwise
*/

/**
\return non zero on success, zero otherwise
*
*example usage:
\code
\endcode
*
*/

/**
\return a pointer to the start of the first occurrence of the header on success, NULL otherwise
*
*example usage:
\code
\endcode
* In this example on success the head pointer will point to a \em "Content-Lenght: 1025" string
*
*/

/**
* Search for a header in a header list and return the value of the first occurrence of this header
\return a pointer to the start of the header on success, NULL otherwise
*
*example usage:
\code
int content_length;
\endcode
*
*/

/*The following headers are only used internally */