FORS Pipeline Reference Manual  5.0.9
Data Structures | Macros | Typedefs | Functions
PAF File Utilities

Data Structures

struct  _FORS_PAF_RECORD_
 
struct  _FORS_PAF_
 

Macros

#define TIME_ISO8601_LENGTH   (20)
 

Typedefs

typedef struct _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. More...
 
ForsPAFnewForsPAF (const char *name, const char *type, const char *id, const char *desc)
 Create a new PAF object. More...
 
int forsPAFIsEmpty (const ForsPAF *paf)
 Check whether a PAF object is empty. More...
 
size_t forsPAFGetSize (const ForsPAF *paf)
 Get the actual size of the given PAF object. More...
 
int forsPAFIsValidName (const char *name)
 Verify that the given string is a valid PAF keyword. More...
 
int forsPAFAppendBool (ForsPAF *paf, const char *name, int value, const char *comment)
 Append a boolean value to a PAF object. More...
 
int forsPAFAppendInt (ForsPAF *paf, const char *name, int value, const char *comment)
 Append a integer value to a PAF object. More...
 
int forsPAFAppendDouble (ForsPAF *paf, const char *name, double value, const char *comment)
 Append a double value to a PAF object. More...
 
int forsPAFAppendString (ForsPAF *paf, const char *name, const char *value, const char *comment)
 Append a string value to a PAF object. More...
 
int forsPAFWrite (ForsPAF *paf)
 Write a PAF object to a disk file. More...
 

Detailed Description

TBD

Function Documentation

void deleteForsPAF ( ForsPAF paf)

Destroy a PAF object.

Parameters
pafPAF object to destroy.
Returns
Nothing.

The function deallocates all memory used for the PAF object paf.

Definition at line 511 of file fors_paf.c.

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.

Parameters
nameParameter file name.
typeParameter file type.
idParameter file identifier string.
descShort description for the parameter file.
Returns
The handle for the newly created PAF object.

The function allocates the memory for a PAF object and initializes the PAF object with the strings name, type, id and desc passed to the function, where id and desc may be omitted, i.e. 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 550 of file fors_paf.c.

Referenced by fors_qc_start_group().

int forsPAFIsEmpty ( const ForsPAF paf)

Check whether a PAF object is empty.

Parameters
pafPAF object to query.
Returns
The function returns 1 if paf is empty, otherwise the return value is 0.

The function checks whether the record list of the PAF object paf contains any records.

Definition at line 594 of file fors_paf.c.

Referenced by fors_qc_end_group().

size_t forsPAFGetSize ( const ForsPAF paf)

Get the actual size of the given PAF object.

Parameters
pafPAF object to query.
Returns
The number of PAF records currently stored in the record list, or 0 if the PAF object is empty.

The function computes the actual size, i.e. the number of parmeter records, stored in the record list of the PAF object paf. Header entries do not contribute the size of a PAF object.

Definition at line 618 of file fors_paf.c.

int forsPAFIsValidName ( const char *  name)

Verify that the given string is a valid PAF keyword.

Parameters
nameName string to verify.
Returns
The function returns 1 if the given name is valid, if not 0 is returned.

The function does a simple check on the given string. To be a valid PAF keyword the name should start with a letter, it should only contain upper case letters and it may not contain blanks.

Definition at line 642 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.

Parameters
pafPAF object to which the record is appended.
nameParameter name.
valueParameter value.
commentParameter description.
Returns
The function returns EXIT_SUCCESS if the record was successfully appended, or EXIT_FAILURE otherwise.

The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object paf.

Definition at line 695 of file fors_paf.c.

References forsPAFIsValidName().

int forsPAFAppendInt ( ForsPAF paf,
const char *  name,
int  value,
const char *  comment 
)

Append a integer value to a PAF object.

Parameters
pafPAF object to which the record is appended.
nameParameter name.
valueParameter value.
commentParameter description.
Returns
The function returns EXIT_SUCCESS if the record was successfully appended, or EXIT_FAILURE otherwise.

The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object paf.

Definition at line 729 of file fors_paf.c.

References forsPAFIsValidName().

int forsPAFAppendDouble ( ForsPAF paf,
const char *  name,
double  value,
const char *  comment 
)

Append a double value to a PAF object.

Parameters
pafPAF object to which the record is appended.
nameParameter name.
valueParameter value.
commentParameter description.
Returns
The function returns EXIT_SUCCESS if the record was successfully appended, or EXIT_FAILURE otherwise.

The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object paf.

Definition at line 764 of file fors_paf.c.

References forsPAFIsValidName().

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.

Parameters
pafPAF object to which the record is appended.
nameParameter name.
valueParameter value string.
commentParameter description.
Returns
The function returns EXIT_SUCCESS if the record was successfully appended, or EXIT_FAILURE otherwise.

The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object paf.

Definition at line 800 of file fors_paf.c.

References forsPAFIsValidName().

Referenced by fors_qc_write_string().

int forsPAFWrite ( ForsPAF paf)

Write a PAF object to a disk file.

Parameters
pafPAF object to save.
Returns
The function returns EXIT_SUCCESS if the object was successfully written to the file, otherwise EXIT_FAILURE is returned.

The function converts the PAF object into an ASCII file on disk, using the name used to create the PAF object as a file name for the disk file.

Definition at line 834 of file fors_paf.c.

Referenced by fors_qc_end_group().