Data Structures | |
struct | _FORS_PAF_RECORD_ |
struct | _FORS_PAF_ |
Defines | |
#define | TIME_ISO8601_LENGTH (20) |
Typedefs | |
typedef _FORS_PAF_RECORD_ | ForsPAFRecord |
Functions | |
static char * | getTimeISO8601 (void) |
static size_t | _forsPAFValueSize (ForsPAFType type, const void *value) |
static void | _forsPAFRecordDestroy (ForsPAFRecord *record) |
static ForsPAFRecord * | _forsPAFRecordCreate (const char *name, ForsPAFType type, const void *value, const char *comment) |
static void | _forsPAFRecordSet (ForsPAFRecord *record, const char *name, ForsPAFType type, const void *value, const char *comment) |
static int | _forsPAFAppend (ForsPAFRecord ***list, int *pos, const char *name, ForsPAFType type, const void *value, const char *comment) |
static ForsPAFRecord ** | _forsPAFHeaderCreate (const char *name, const char *type, const char *id, const char *desc, int *pos) |
static const char * | _forsPAFFormatRecord (ForsPAFRecord *record) |
void | deleteForsPAF (ForsPAF *paf) |
Destroy a PAF object. | |
ForsPAF * | newForsPAF (const char *name, const char *type, const char *id, const char *desc) |
Create a new PAF object. | |
int | forsPAFIsEmpty (const ForsPAF *paf) |
Check whether a PAF object is empty. | |
size_t | forsPAFGetSize (const ForsPAF *paf) |
Get the actual size of the given PAF object. | |
int | forsPAFIsValidName (const char *name) |
Verify that the given string is a valid PAF keyword. | |
int | forsPAFAppendBool (ForsPAF *paf, const char *name, int value, const char *comment) |
Append a boolean value to a PAF object. | |
int | forsPAFAppendInt (ForsPAF *paf, const char *name, int value, const char *comment) |
Append a integer value to a PAF object. | |
int | forsPAFAppendDouble (ForsPAF *paf, const char *name, double value, const char *comment) |
Append a double value to a PAF object. | |
int | forsPAFAppendString (ForsPAF *paf, const char *name, const char *value, const char *comment) |
Append a string value to a PAF object. | |
int | forsPAFWrite (ForsPAF *paf) |
Write a PAF object to a disk file. |
void deleteForsPAF | ( | ForsPAF * | paf | ) |
Destroy a PAF object.
paf | PAF object to destroy. |
Definition at line 509 of file fors_paf.c.
References _forsPAFRecordDestroy(), _FORS_PAF_::header, _FORS_PAF_::name, _FORS_PAF_::nh, _FORS_PAF_::nr, and _FORS_PAF_::records.
Referenced by fors_qc_end_group().
ForsPAF* newForsPAF | ( | const char * | name, | |
const char * | type, | |||
const char * | id, | |||
const char * | desc | |||
) |
Create a new PAF object.
name | Parameter file name. | |
type | Parameter file type. | |
id | Parameter file identifier string. | |
desc | Short description for the parameter file. |
NULL
maybe passed for id and/or desc. The argument name will be used as the file name in case the PAF object is written to a disk file.
Definition at line 548 of file fors_paf.c.
References _forsPAFHeaderCreate(), _FORS_PAF_::header, _FORS_PAF_::name, _FORS_PAF_::nh, _FORS_PAF_::nr, and _FORS_PAF_::records.
Referenced by fors_qc_start_group().
int forsPAFIsEmpty | ( | const ForsPAF * | paf | ) |
Check whether a PAF object is empty.
paf | PAF object to query. |
Definition at line 587 of file fors_paf.c.
References _FORS_PAF_::nr.
Referenced by fors_qc_end_group().
size_t forsPAFGetSize | ( | const ForsPAF * | paf | ) |
Get the actual size of the given PAF object.
paf | PAF object to query. |
Definition at line 611 of file fors_paf.c.
References _FORS_PAF_::nr.
int forsPAFIsValidName | ( | const char * | name | ) |
Verify that the given string is a valid PAF keyword.
name | Name string to verify. |
Definition at line 635 of file fors_paf.c.
Referenced by forsPAFAppendBool(), forsPAFAppendDouble(), forsPAFAppendInt(), and forsPAFAppendString().
int forsPAFAppendBool | ( | ForsPAF * | paf, | |
const char * | name, | |||
int | value, | |||
const char * | comment | |||
) |
Append a boolean value to a PAF object.
paf | PAF object to which the record is appended. | |
name | Parameter name. | |
value | Parameter value. | |
comment | Parameter description. |
EXIT_SUCCESS
if the record was successfully appended, or EXIT_FAILURE
otherwise.Definition at line 688 of file fors_paf.c.
References _forsPAFAppend(), forsPAFIsValidName(), _FORS_PAF_::nr, and _FORS_PAF_::records.
int forsPAFAppendInt | ( | ForsPAF * | paf, | |
const char * | name, | |||
int | value, | |||
const char * | comment | |||
) |
Append a integer value to a PAF object.
paf | PAF object to which the record is appended. | |
name | Parameter name. | |
value | Parameter value. | |
comment | Parameter description. |
EXIT_SUCCESS
if the record was successfully appended, or EXIT_FAILURE
otherwise.Definition at line 722 of file fors_paf.c.
References _forsPAFAppend(), forsPAFIsValidName(), _FORS_PAF_::nr, and _FORS_PAF_::records.
Referenced by fors_qc_write_int().
int forsPAFAppendDouble | ( | ForsPAF * | paf, | |
const char * | name, | |||
double | value, | |||
const char * | comment | |||
) |
Append a double value to a PAF object.
paf | PAF object to which the record is appended. | |
name | Parameter name. | |
value | Parameter value. | |
comment | Parameter description. |
EXIT_SUCCESS
if the record was successfully appended, or EXIT_FAILURE
otherwise.Definition at line 757 of file fors_paf.c.
References _forsPAFAppend(), forsPAFIsValidName(), _FORS_PAF_::nr, and _FORS_PAF_::records.
Referenced by fors_qc_write_double().
int forsPAFAppendString | ( | ForsPAF * | paf, | |
const char * | name, | |||
const char * | value, | |||
const char * | comment | |||
) |
Append a string value to a PAF object.
paf | PAF object to which the record is appended. | |
name | Parameter name. | |
value | Parameter value string. | |
comment | Parameter description. |
EXIT_SUCCESS
if the record was successfully appended, or EXIT_FAILURE
otherwise.Definition at line 793 of file fors_paf.c.
References _forsPAFAppend(), forsPAFIsValidName(), _FORS_PAF_::nr, and _FORS_PAF_::records.
Referenced by fors_qc_write_string(), and fors_qc_write_string_chat().
int forsPAFWrite | ( | ForsPAF * | paf | ) |
Write a PAF object to a disk file.
paf | PAF object to save. |
EXIT_SUCCESS
if the object was successfully written to the file, otherwise EXIT_FAILURE
is returned.Definition at line 827 of file fors_paf.c.
References _forsPAFFormatRecord(), _FORS_PAF_::header, _FORS_PAF_::name, _FORS_PAF_::nh, _FORS_PAF_::nr, and _FORS_PAF_::records.
Referenced by fors_qc_end_group().