118 const char *sSectionName);
124 const char *sSectionName);
137 const char *sKey,
long *pVal);
140 const char *sKey,
double *pVal);
153 const char *sKey,
int *pVal)
155 return ConfigGetLong(pConfig, sSectionName, sKey, (
long *)pVal);
170 const char *sKey,
unsigned long *pVal)
172 return ConfigGetLong(pConfig, sSectionName, sKey, (
long *)pVal);
188 const char *sSectionName,
203 const char *sKey,
const char *sVal);
206 const char *sKey,
long lVal);
209 const char *sKey,
unsigned long ulVal);
212 const char *sKey,
double fVal);
227 const char *sKey,
int iVal)
229 return ConfigSetLong(pConfig, sSectionName, sKey, (
long)iVal);
248 const char *sSectionName);
257 #endif // _RNR_CONFIG_H int ConfigSetDouble(Config_T *pConfig, const char *sSectionName, const char *sKey, double fVal)
Set or update a double value in the configuration database.
int ConfigSetLong(Config_T *pConfig, const char *sSectionName, const char *sKey, long lVal)
Set or update a long value in the configuration database.
int ConfigGetDouble(Config_T *pConfig, const char *sSectionName, const char *sKey, double *pVal)
Get and convert a double value from the configuration database.
void ConfigDbSetName(Config_T *pConfig, const char *sMainName)
Assign a new name for the configuration database.
int ConfigSetULong(Config_T *pConfig, const char *sSectionName, const char *sKey, unsigned long ulVal)
Set or update an unsigned long value in the configuration database.
int ConfigDelete(Config_T *pConfig, const char *sSectionName, const char *sKey)
Delete entry from the configuration database.
void ConfigDbPrint(Config_T *pConfig, FILE *fp)
Print configuration database to the output file stream.
ConfigSection_T * ConfigSectionGet(Config_T *pConfig, const char *sSectionName)
Get a section from the configuration database.
ConfigIter_T * ConfigDbIterNew(Config_T *pConfig)
Create a new configuration database iterator.
Config_T * ConfigDbNew(const char *sMainName)
Create and initialize a new empty configuration database.
static int ConfigGetULong(Config_T *pConfig, const char *sSectionName, const char *sKey, unsigned long *pVal)
Get and convert an unsigned long value from the configuration database.
#define C_DECLS_BEGIN
C declaration block begin in C.
int ConfigSectionDelete(Config_T *pConfig, ConfigSection_T *sSectionName)
Delete a section from the configuration database.
Config_T * ConfigDbReadFp(FILE *fp, const char *sFileName)
Create a new configuration database from a opened configuration file.
int ConfigGetLong(Config_T *pConfig, const char *sSectionName, const char *sKey, long *pVal)
Get and convert a long value from the configuration database.
RoadNarrows Robotics common configuration file.
static const char * ConfigGetStrDft(Config_T *pConfig, const char *sSectionName, const char *sKey, const char *sValDft)
Get a value from the configuration database or default.
void ConfigDbDelete(Config_T *pConfig)
Delete the configuration database.
#define C_DECLS_END
C declaration block end in C.
const char * ConfigIterNext(ConfigIter_T *pIter)
Get the next value in iteration.
void ConfigSectionPrint(ConfigSection_T *pSect, FILE *fp)
Print one section to the output file stream.
const char * ConfigGetStr(Config_T *pConfig, const char *sSectionName, const char *sKey)
Get a string value from the configuration database.
static int ConfigGetInt(Config_T *pConfig, const char *sSectionName, const char *sKey, int *pVal)
Get and convert an int value from the configuration database.
Config_T * ConfigDbRead(const char *sFileName)
Create a new configuration database from a configuration file.
void ConfigIterDelete(ConfigIter_T *pIter)
Delete a configuration iterator.
int ConfigSetStr(Config_T *pConfig, const char *sSectionName, const char *sKey, const char *sVal)
Set or update a string value in the configuration database.
static int ConfigSetInt(Config_T *pConfig, const char *sSectionName, const char *sKey, int iVal)
Set or update an int value in the configuration database.
const char * ConfigDbGetName(Config_T *pConfig)
Get the current name assigned to the configuration database.
ConfigSection_T * ConfigSectionNew(Config_T *pConfig, const char *sSectionName)
Add a new empty section to the configuration database.
ConfigIter_T * ConfigSectionIterNew(Config_T *pConfig, const char *sSectionName)
Create a new configuration section iterator.