header.h File Reference
Go to the source code of this file.
|
Data Structures |
| struct | header_t |
Enumerations |
| enum | { HLM_OVERRIDE,
HLM_KEEP,
HLM_ADD
} |
Functions |
| int | header_create (header_t **) |
| int | header_load (header_t *, io_t *) |
| int | header_load_from_cgienv (header_t *h) |
| int | header_load_ex (header_t *h, io_t *io, int mode) |
| int | header_free (header_t *) |
| int | header_add_field (header_t *h, field_t *f) |
| int | header_del_field (header_t *h, field_t *f) |
| field_t * | header_get_field (header_t *h, const char *name) |
| int | header_clear (header_t *h) |
| const char * | header_get_field_value (header_t *h, const char *name) |
| int | header_set_field (header_t *h, const char *name, const char *value) |
| field_t * | header_get_fieldn (header_t *h, size_t idx) |
| size_t | header_field_count (header_t *h) |
Enumeration Type Documentation
|
|
- Enumeration values:
-
| HLM_OVERRIDE |
|
| HLM_KEEP |
if a field with the same name already exists override it |
| HLM_ADD |
if a field with the same name already exists add another field with the same name |
Definition at line 22 of file header.h. |
Function Documentation
|
|
Add a field to a header.
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 211 of file header.c. |
|
|
Clear a header.
Clear all items in header h.
- Parameters:
-
- Returns:
0 if successful, non-zero on error
Definition at line 62 of file header.c. |
|
|
Delete a field from a header.
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 189 of file header.c. |
| size_t header_field_count |
( |
header_t * |
h |
) |
|
|
|
|
Count fields in a header.
Return the number of fields in header h.
- Parameters:
-
- Returns:
- the number of fields found in
h
Definition at line 88 of file header.c. |
|
|
Get a field given a 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 138 of file header.c. |
| const char* header_get_field_value |
( |
header_t * |
h, |
|
|
const char * |
name |
|
) |
|
|
|
|
Get field value.
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. |
|
|
Get ith field in a header.
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 106 of file header.c. |
| int header_load_from_cgienv |
( |
header_t * |
h |
) |
|
|
| int header_set_field |
( |
header_t * |
h, |
|
|
const char * |
name, |
|
|
const char * |
value |
|
) |
|
|
|
|
Set the value of a field in a header.
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 29 of file header.c. |