* created node for the provided name. On error, NULL will be returned.
*/
static ConfNode *
-ConfGetNodeOrCreate(char *name, int final)
+ConfGetNodeOrCreate(const char *name, int final)
{
ConfNode *parent = root;
ConfNode *node = NULL;
* node does not exist.
*/
ConfNode *
-ConfGetNode(char *name)
+ConfGetNode(const char *name)
{
ConfNode *node = root;
char node_name[NODE_NAME_MAX];
* \retval 1 if the value was set otherwise 0.
*/
int
-ConfSet(char *name, char *val)
+ConfSet(const char *name, char *val)
{
ConfNode *node = ConfGetNodeOrCreate(name, 0);
if (node == NULL || node->final) {
* \retval 1 if the value was set otherwise 0.
*/
int
-ConfSetFinal(char *name, char *val)
+ConfSetFinal(const char *name, char *val)
{
ConfNode *node = ConfGetNodeOrCreate(name, 1);
if (node == NULL) {
* be returned.
*/
int
-ConfGet(char *name, char **vptr)
+ConfGet(const char *name, char **vptr)
{
ConfNode *node = ConfGetNode(name);
if (node == NULL) {
}
}
-int ConfGetChildValue(ConfNode *base, char *name, char **vptr)
+int ConfGetChildValue(const ConfNode *base, const char *name, char **vptr)
{
ConfNode *node = ConfNodeLookupChild(base, name);
}
-int ConfGetChildValueWithDefault(ConfNode *base, ConfNode *dflt, char *name, char **vptr)
+int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, char **vptr)
{
int ret = ConfGetChildValue(base, name, vptr);
/* Get 'default' value */
* converted to an interger, otherwise 0 will be returned.
*/
int
-ConfGetInt(char *name, intmax_t *val)
+ConfGetInt(const char *name, intmax_t *val)
{
char *strval;
intmax_t tmpint;
return 1;
}
-int ConfGetChildValueInt(ConfNode *base, char *name, intmax_t *val)
+int ConfGetChildValueInt(const ConfNode *base, const char *name, intmax_t *val)
{
char *strval;
intmax_t tmpint;
}
-int ConfGetChildValueIntWithDefault(ConfNode *base, ConfNode *dflt, char *name, intmax_t *val)
+int ConfGetChildValueIntWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, intmax_t *val)
{
int ret = ConfGetChildValueInt(base, name, val);
/* Get 'default' value */
* converted to a boolean, otherwise 0 will be returned.
*/
int
-ConfGetBool(char *name, int *val)
+ConfGetBool(const char *name, int *val)
{
char *strval;
return 1;
}
-int ConfGetChildValueBool(ConfNode *base, char *name, int *val)
+int ConfGetChildValueBool(const ConfNode *base, const char *name, int *val)
{
char *strval;
return 1;
}
-int ConfGetChildValueBoolWithDefault(ConfNode *base, ConfNode *dflt, char *name, int *val)
+int ConfGetChildValueBoolWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, int *val)
{
int ret = ConfGetChildValueBool(base, name, val);
/* Get 'default' value */
* converted to a double, otherwise 0 will be returned.
*/
int
-ConfGetDouble(char *name, double *val)
+ConfGetDouble(const char *name, double *val)
{
char *strval;
double tmpdo;
* converted to a double, otherwise 0 will be returned.
*/
int
-ConfGetFloat(char *name, float *val)
+ConfGetFloat(const char *name, float *val)
{
char *strval;
double tmpfl;
* most likely indicating the parameter was not set.
*/
int
-ConfRemove(char *name)
+ConfRemove(const char *name)
{
ConfNode *node;
* \brief Dump a configuration node and all its children.
*/
void
-ConfNodeDump(ConfNode *node, const char *prefix)
+ConfNodeDump(const ConfNode *node, const char *prefix)
{
ConfNode *child;
* \retval A pointer the child ConfNode if found otherwise NULL.
*/
ConfNode *
-ConfNodeLookupChild(ConfNode *node, const char *name)
+ConfNodeLookupChild(const ConfNode *node, const char *name)
{
ConfNode *child;
* \retval A pointer the child ConfNodes value if found otherwise NULL.
*/
const char *
-ConfNodeLookupChildValue(ConfNode *node, const char *name)
+ConfNodeLookupChildValue(const ConfNode *node, const char *name)
{
ConfNode *child;
* \return the ConfNode matching or NULL
*/
-ConfNode *ConfNodeLookupKeyValue(ConfNode *base, const char *key, const char *value)
+ConfNode *ConfNodeLookupKeyValue(const ConfNode *base, const char *key, const char *value)
{
ConfNode *child;
* returned, even if the child node does not exist.
*/
int
-ConfNodeChildValueIsTrue(ConfNode *node, const char *key)
+ConfNodeChildValueIsTrue(const ConfNode *node, const char *key)
{
const char *val;
* \param file The name of the file
* \retval str Pointer to the string path + sig_file
*/
-char *ConfLoadCompleteIncludePath(char *file)
+char *ConfLoadCompleteIncludePath(const char *file)
{
char *defaultpath = NULL;
char *path = NULL;
void ConfInit(void);
void ConfDeInit(void);
ConfNode *ConfGetRootNode(void);
-int ConfGet(char *name, char **vptr);
-int ConfGetInt(char *name, intmax_t *val);
-int ConfGetBool(char *name, int *val);
-int ConfGetDouble(char *name, double *val);
-int ConfGetFloat(char *name, float *val);
-int ConfSet(char *name, char *val);
-int ConfSetFinal(char *name, char *val);
+int ConfGet(const char *name, char **vptr);
+int ConfGetInt(const char *name, intmax_t *val);
+int ConfGetBool(const char *name, int *val);
+int ConfGetDouble(const char *name, double *val);
+int ConfGetFloat(const char *name, float *val);
+int ConfSet(const char *name, char *val);
+int ConfSetFinal(const char *name, char *val);
void ConfDump(void);
-void ConfNodeDump(ConfNode *node, const char *prefix);
+void ConfNodeDump(const ConfNode *node, const char *prefix);
ConfNode *ConfNodeNew(void);
void ConfNodeFree(ConfNode *);
-ConfNode *ConfGetNode(char *key);
+ConfNode *ConfGetNode(const char *key);
void ConfCreateContextBackup(void);
void ConfRestoreContextBackup(void);
-ConfNode *ConfNodeLookupChild(ConfNode *node, const char *key);
-const char *ConfNodeLookupChildValue(ConfNode *node, const char *key);
+ConfNode *ConfNodeLookupChild(const ConfNode *node, const char *key);
+const char *ConfNodeLookupChildValue(const ConfNode *node, const char *key);
void ConfNodeRemove(ConfNode *);
void ConfRegisterTests();
-int ConfNodeChildValueIsTrue(ConfNode *node, const char *key);
+int ConfNodeChildValueIsTrue(const ConfNode *node, const char *key);
int ConfValIsTrue(const char *val);
int ConfValIsFalse(const char *val);
void ConfNodePrune(ConfNode *node);
-ConfNode *ConfNodeLookupKeyValue(ConfNode *base, const char *key, const char *value);
-int ConfGetChildValue(ConfNode *base, char *name, char **vptr);
-int ConfGetChildValueInt(ConfNode *base, char *name, intmax_t *val);
-int ConfGetChildValueBool(ConfNode *base, char *name, int *val);
-int ConfGetChildValueWithDefault(ConfNode *base, ConfNode *dflt, char *name, char **vptr);
-int ConfGetChildValueIntWithDefault(ConfNode *base, ConfNode *dflt, char *name, intmax_t *val);
-int ConfGetChildValueBoolWithDefault(ConfNode *base, ConfNode *dflt, char *name, int *val);
-char *ConfLoadCompleteIncludePath(char *);
+ConfNode *ConfNodeLookupKeyValue(const ConfNode *base, const char *key, const char *value);
+int ConfGetChildValue(const ConfNode *base, const char *name, char **vptr);
+int ConfGetChildValueInt(const ConfNode *base, const char *name, intmax_t *val);
+int ConfGetChildValueBool(const ConfNode *base, const char *name, int *val);
+int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, char **vptr);
+int ConfGetChildValueIntWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, intmax_t *val);
+int ConfGetChildValueBoolWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, int *val);
+char *ConfLoadCompleteIncludePath(const char *);
#endif /* ! __CONF_H__ */