Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

field_t - field manipulation


Functions

int field_set (field_t *f, const char *name, const char *value)
 Set a field.
int field_set_from_line (field_t *f, const char *ln)
 Set a field from a line.
const char * field_get_name (field_t *f)
 Get the name of a field.
const char * field_get_value (field_t *f)
 Get the value of a field.
int field_create (const char *name, const char *value, field_t **pf)
 Create a field.
int field_free (field_t *f)
 Free a field.

Detailed Description


Function Documentation

int field_create const char *  name,
const char *  value,
field_t **  pf
 

Create a field from name and value into *pf.

Parameters:
name field name
value field value
pf address of field pointer
Returns:
0 if successful, non-zero on error

Definition at line 144 of file field.c.

References field_free(), field_t, field_s::name, and field_s::value.

Referenced by header_set_field(), response_redirect(), and response_set_cookie().

int field_free field_t f  ) 
 

Free field f.

Parameters:
f field object
Returns:
0, always

Definition at line 178 of file field.c.

References field_t, field_s::name, and field_s::value.

Referenced by field_create(), header_clear(), header_set_field(), response_del_field(), and response_set_cookie().

const char* field_get_name field_t f  ) 
 

Return the string value of field f.

Parameters:
f field object
Returns:
the (null-terminated) string corresponding to the field name

Definition at line 110 of file field.c.

References field_t, and field_s::name.

Referenced by response_get_max_header_size().

const char* field_get_value field_t f  ) 
 

Return the string value of field f.

Parameters:
f field object
Returns:
the (null-terminated) string corresponding to the field value

Definition at line 126 of file field.c.

References field_t, and field_s::value.

Referenced by header_get_field_value(), and response_get_max_header_size().

int field_set field_t f,
const char *  name,
const char *  value
 

Set field f to have name and value.

Parameters:
f field object
name field name
value field value
Returns:
0 if successful, non-zero on error

Definition at line 34 of file field.c.

References field_t, field_s::name, and field_s::value.

Referenced by field_set_from_line(), and header_set_field().

int field_set_from_line field_t f,
const char *  ln
 

Set the name and value of field f. Name and value must be separated by ":".

Parameters:
f field object
ln line
Returns:
0 if successful, non-zero on error

Definition at line 73 of file field.c.

References field_set(), and field_t.


←Products
© 2005-2006 - KoanLogic S.r.l. - All rights reserved