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

header_t - header manipulation


Functions

int header_set_field (header_t *h, const char *name, const char *value)
 Set the value of a field in a header.
int header_clear (header_t *h)
 Clear a header.
size_t header_field_count (header_t *h)
 Count fields in a header.
field_theader_get_fieldn (header_t *h, size_t idx)
 Get ith field in a header.
field_theader_get_field (header_t *h, const char *name)
 Get a field given a name.
const char * header_get_field_value (header_t *h, const char *name)
 Get field value.
int header_del_field (header_t *h, field_t *f)
 Delete a field from a header.
int header_add_field (header_t *h, field_t *f)
 Add a field to a header.
int header_load_from_cgienv (header_t *h)
int header_load (header_t *h, io_t *io)
int header_create (header_t **ph)
int header_free (header_t *h)

Detailed Description


Function Documentation

int header_add_field header_t h,
field_t f
 

Add a field f to header h.

Parameters:
h header object
f field to be added
Returns:
0 on success, non-zero otherwise

Definition at line 209 of file header.c.

References field_t, fields, and nfields.

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

int header_clear header_t h  ) 
 

Clear all items in header h.

Parameters:
h header object
Returns:
0 if successful, non-zero on error

Definition at line 66 of file header.c.

References field_free(), field_t, fields, and header_del_field().

Referenced by header_free().

int header_create header_t **  ph  ) 
 

Definition at line 349 of file header.c.

References fields.

Referenced by request_create(), and response_create().

int header_del_field header_t h,
field_t f
 

Delete the supplied field f in header h.

Parameters:
h header object
f field to be deleted
Returns:
0 on success, non-zero otherwise

Definition at line 188 of file header.c.

References field_t, fields, and nfields.

Referenced by header_clear(), and response_del_field().

size_t header_field_count header_t h  ) 
 

Return the number of fields in header h.

Parameters:
h header object
Returns:
the number of fields found in h

Definition at line 91 of file header.c.

References nfields.

Referenced by response_get_max_header_size(), and response_print_header_to_io().

int header_free header_t h  ) 
 

Definition at line 367 of file header.c.

References header_clear().

Referenced by request_free(), response_create(), and response_free().

field_t* header_get_field header_t h,
const char *  name
 

Return the first matching field_t object with name name in header h

Parameters:
h header object
name name of the field to be searched
Returns:
  • the field string corresponding to name
  • NULL if no field could be found

Definition at line 139 of file header.c.

References field_t, fields, and field_s::name.

Referenced by header_get_field_value(), header_set_field(), request_get_field(), and response_del_field().

const char* header_get_field_value header_t h,
const char *  name
 

Return a string representation of the field with name name in header h

Parameters:
h header object
name name of the field
Returns:
  • the field string corresponding to name
  • NULL if no field could be found

Definition at line 166 of file header.c.

References field_get_value(), field_t, and header_get_field().

Referenced by request_get_field_value(), and request_is_encoding_accepted().

field_t* header_get_fieldn header_t h,
size_t  idx
 

Return the field_t object at index idx in header h.

Parameters:
h header object
idx index
Returns:
the pointer to the field or NULL if no field could be found

Definition at line 108 of file header.c.

References field_t, fields, and nfields.

Referenced by response_get_max_header_size(), and response_print_header_to_io().

int header_load header_t h,
io_t io
 

Definition at line 292 of file header.c.

References io_t, and u_getline().

Referenced by request_parse_header().

int header_load_from_cgienv header_t h  ) 
 

Definition at line 252 of file header.c.

References header_set_field(), and MIN.

Referenced by request_parse_header().

int header_set_field header_t h,
const char *  name,
const char *  value
 

Set the value of field name to value in header h.

Parameters:
h header object
name name of the field
value value of the field
Returns:
0 if successful, non-zero on error

Definition at line 34 of file header.c.

References field_create(), field_free(), field_set(), field_t, header_add_field(), and header_get_field().

Referenced by header_load_from_cgienv(), request_set_field(), response_set_content_encoding(), response_set_content_length(), response_set_content_type(), response_set_date(), response_set_field(), and response_set_last_modified().


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