tizrcfile

group tizrcfile

Functions

const char* tiz_rcfile_get_value(const char * section, const char * key)

Returns a value string from a give section using the value’s key

Return
A newly allocated string or NULL if the specified key cannot be found.
Parameters
  • section: String indicating the section where the key-value list pair is to be found.
  • key: A search key in the specified section.

char** tiz_rcfile_get_value_list(const char * section, const char * key, unsigned long * length)

Returns a value string from a give section using the value’s key

Return
An array of NULL-terminated strings or NULL if the specified key cannot be found. The array should be freed by the caller.
Parameters
  • section: String indicating the section where the key-value list pair is to be found.
  • key: A search key in the specified section.
  • length: The length of the returned list.

int tiz_rcfile_compare_value(const char * section, const char * key, const char * value)

Returns an integer less than, equal to, or greater than zero if the section-key-value triad provided is respectively, not found, found and matching, or found and no matching.

Return
Returns an integer less than (key or section not found), equal to (section and key found, value matched), or greater than zero (section and key found, value unmatched).
Parameters
  • section: String indicating the section where the key-value pair is to be found.
  • key: A search key in the specified section.
  • value: The value to be matched against.

int tiz_rcfile_status(void)

Returns 0 if the status of the configuration file is such that a tizonia configuration file has been found at one of the expected locations and the file can be opened and read by the current user.

Return
On success, zero is returned. On error, -1 is returned.