c-icap-doc  0.1
Data Structures | Functions | Variables
Text formating api

Functions and structures used for text formating. More...

Data Structures

struct  ci_fmt_entry
 This structure used to implement text formating directives. More...
 

Functions

int ci_format_text (ci_request_t *req_data, const char *fmt, char *buffer, int len, struct ci_fmt_entry *user_table)
 Produces formated text based on template text. More...
 

Variables

struct ci_fmt_entry GlobalTable []
 Internal formating directives table. More...
 

Detailed Description

Functions and structures used for text formating.

Function Documentation

int ci_format_text ( ci_request_t req_data,
const char *  fmt,
char *  buffer,
int  len,
struct ci_fmt_entry user_table 
)

Produces formated text based on template text.

Parameters
req_dataThe current request
fmtThe format string
bufferThe output buffer
lenThe length of the output buffer
user_tableAn array of user defined directives
Returns
Non zero on success, zero on error

This function uses the internal formating directives table. Also the user can define his own table.

Variable Documentation

struct ci_fmt_entry GlobalTable[]

Internal formating directives table.

This table define the following directives:
"%a": Remote IP-Address
"%la": Local IP Address
"%lp": Local port
"%>a": Http Client IP Address
"%<A": Http Server IP Address
"%ts": Seconds since epoch
"%tl": Local time
"%tg": GMT time
"%>ho": Modified Http request header
"%huo": Modified Http request url
"%<ho": Modified Http reply header
"%iu": Icap request url
"%im": Icap method
"%is": Icap status code
"%>ih": Icap request header
"%<ih": Icap response header
"%ipl": Icap preview length
"%Ih": Http bytes received
"%Oh": Http bytes sent
"%Ib": Http body bytes received
"%Ob": Http body bytes sent
"%I": Bytes received
"%O": Bytes sent
"%bph": Body data preview
"%un": Username
"%Sl": Log string set by service
"%Sa": Attribute value set by service
Not yet implemented:
"%tr": Response time
"%hu": Http request url
"%>hi": Http request header
"%<hi": Http reply header
"%Hs": Http reply status
"%Hso": Modified Http reply status