field.h File Reference

Go to the source code of this file.

Data Structures

struct  param_s
struct  field_s

Typedefs

typedef struct param_s param_t
typedef struct param_list_s params_t
typedef struct field_s field_t
typedef struct field_list_s fields_t

Functions

 TAILQ_HEAD (param_list_s, param_s)
 TAILQ_HEAD (field_list_s, field_s)
int field_create (const char *name, const char *value, field_t **)
int field_set (field_t *, const char *name, const char *value)
int field_set_from_line (field_t *, const char *line)
int field_free (field_t *)
const char * field_get_name (field_t *f)
const char * field_get_value (field_t *f)

Typedef Documentation

typedef struct field_s field_t
typedef struct field_list_s fields_t

Definition at line 41 of file field.h.

typedef struct param_s param_t
typedef struct param_list_s params_t

Definition at line 29 of file field.h.


Function Documentation

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

Create a field.

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

int field_free ( field_t f  ) 

Free a field.

Free field f.

Parameters:
f field object
Returns:
0, always

Definition at line 183 of file field.c.

const char* field_get_name ( field_t f  ) 

Get the name of a field.

Return the string value of field f.

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

Definition at line 112 of file field.c.

const char* field_get_value ( field_t f  ) 

Get the value of a field.

Return the string value of field f.

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

Definition at line 129 of file field.c.

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

Set a field.

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.

int field_set_from_line ( field_t f,
const char *  ln 
)

Set a field from a line.

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

TAILQ_HEAD ( field_list_s  ,
field_s   
)
TAILQ_HEAD ( param_list_s  ,
param_s   
)