Main Page Alphabetical List Compound List File List Compound Members File Members

# parsecfg.h File Reference

Go to the source code of this file.

## Compounds
struct | cfgList_tag
struct | cfgStruct
## Defines
#define | PARSECFG_VERSION "3.6.7"
## Typedefs
typedef cfgList_tag | cfgList
## Enumerations
enum | cfgErrorCode { CFG_NO_ERROR, CFG_OPEN_FAIL, CFG_CREATE_FAIL, CFG_SYNTAX_ERROR, CFG_WRONG_PARAMETER, CFG_INTERNAL_ERROR, CFG_INVALID_NUMBER, CFG_OUT_OF_RANGE, CFG_MEM_ALLOC_FAIL, CFG_BOOL_ERROR, CFG_USED_SECTION, CFG_NO_CLOSING_BRACE, CFG_JUST_RETURN_WITHOUT_MSG }
enum | cfgFileType { CFG_SIMPLE, CFG_INI }
enum | cfgValueType { CFG_END, CFG_BOOL, CFG_STRING, CFG_INT, CFG_UINT, CFG_LONG, CFG_ULONG, CFG_STRING_LIST, CFG_FLOAT, CFG_DOUBLE }
enum | cfgKeywordValue { CFG_PARAMETER, CFG_VALUE, CFG_SECTION }
enum | cfgQuote { CFG_NO_QUOTE, CFG_SINGLE_QUOTE, CFG_DOUBLE_QUOTE }
## Functions
void | cfgSetFatalFunc (void(*f)(cfgErrorCode, const char *, int, const char *))
int | cfgParse (const char *file, cfgStruct cfg[], cfgFileType type)
int | cfgDump (const char *file, cfgStruct cfg[], cfgFileType type, int max_section)
int | fetchVarFromCfgFile (const char *file, char *parameter_name, void *result_value, cfgValueType value_type, cfgFileType file_type, int section_num, const char *section_name)
int | cfgSectionNameToNumber (const char *name)
char * | cfgSectionNumberToName (int num)
int | cfgAllocForNewSection (cfgStruct cfg[], const char *name)
int | cfgStoreValue (cfgStruct cfg[], const char *parameter, const char *value, cfgFileType type, int section)
void | printconfdata (cfgStruct *dat, cfgFileType type)

## Define Documentation

#define PARSECFG_VERSION "3.6.7"

## Typedef Documentation

typedef struct cfgList_tag cfgList

## Enumeration Type Documentation

enum cfgErrorCode

  | Enumeration values:
  CFG_NO_ERROR |
  CFG_OPEN_FAIL |
  CFG_CREATE_FAIL |
  CFG_SYNTAX_ERROR |
  CFG_WRONG_PARAMETER |
  CFG_INTERNAL_ERROR |
  CFG_INVALID_NUMBER |
  CFG_OUT_OF_RANGE |
  CFG_MEM_ALLOC_FAIL |
  CFG_BOOL_ERROR |
  CFG_USED_SECTION |
  CFG_NO_CLOSING_BRACE |
  CFG_JUST_RETURN_WITHOUT_MSG |

enum cfgFileType

  | Enumeration values:
  CFG_SIMPLE |
  CFG_INI |

enum cfgKeywordValue

  | Enumeration values:
  CFG_PARAMETER |
  CFG_VALUE |
  CFG_SECTION |

enum cfgQuote

  | Enumeration values:
  CFG_NO_QUOTE |
  CFG_SINGLE_QUOTE |
  CFG_DOUBLE_QUOTE |

enum cfgValueType

  | Enumeration values:
  CFG_END |
  CFG_BOOL |
  CFG_STRING |
  CFG_INT |
  CFG_UINT |
  CFG_LONG |
  CFG_ULONG |
  CFG_STRING_LIST |
  CFG_FLOAT |
  CFG_DOUBLE |

## Function Documentation

int cfgAllocForNewSection | ( | cfgStruct | cfg[],
|  | const char * | name
| ) |

int cfgDump | ( | const char * | file,
|  | cfgStruct | cfg[],
|  | cfgFileType | type,
|  | int | max_section
| ) |

int cfgParse | ( | const char * | file,
|  | cfgStruct | cfg[],
|  | cfgFileType | type
| ) |

int cfgSectionNameToNumber | ( | const char * | name | ) |

char* cfgSectionNumberToName | ( | int | num | ) |

void cfgSetFatalFunc | ( | void(* | f)(cfgErrorCode, const char *, int, const char *) | ) |

int cfgStoreValue | ( | cfgStruct | cfg[],
|  | const char * | parameter,
|  | const char * | value,
|  | cfgFileType | type,
|  | int | section
| ) |

int fetchVarFromCfgFile | ( | const char * | file,
|  | char * | parameter_name,
|  | void * | result_value,
|  | cfgValueType | value_type,
|  | cfgFileType | file_type,
|  | int | section_num,
|  | const char * | section_name
| ) |

void printconfdata | ( | cfgStruct * | dat,
|  | cfgFileType | type
| ) |