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

Header fields manipulation


Functions

int field_set (field_t *, const char *name, const char *value)
 Set a field.
int field_set_from_line (field_t *, const char *line)
 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.

Detailed Description


Function Documentation

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 42 of file field.c.

References 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 81 of file field.c.

References field_set().

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 118 of file field.c.

References field_s::name.

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 134 of file field.c.

References field_s::value.

Referenced by header_get_field_value().