This function returns NULL in case of error.
*/
/*--------------------------------------------------------------------------*/
-char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys)
+char ** iniparser_getseckeys(dictionary * d, char * s)
{
char **keys;
i++;
}
}
+ free(keym);
+ return keys;
- return (char**)keys;
}
/*-------------------------------------------------------------------------*/
the dictionary, do not free or modify it.
*/
/*--------------------------------------------------------------------------*/
-char * iniparser_getstring(const dictionary * d, const char * key, const char * def)
+char * iniparser_getstring(dictionary * d, const char * key, char * def)
{
- const char * lc_key ;
+ char * lc_key ;
char * sval ;
- char tmp_str[ASCIILINESZ+1];
if (d==NULL || key==NULL)
- return (char*)def ;
+ return def ;
- lc_key = strlwc(key, tmp_str, sizeof(tmp_str));
- sval = (char*)dictionary_get(d, lc_key, def);
+ lc_key = xstrdup(key);
+ strlwc(lc_key);
+ sval = dictionary_get(d, lc_key, def);
+ free(lc_key);
return sval ;
}
This function returns NULL in case of error.
*/
/*--------------------------------------------------------------------------*/
-char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys);
-
+char ** iniparser_getseckeys(dictionary * d, char * s);
/*-------------------------------------------------------------------------*/
/**
the dictionary, do not free or modify it.
*/
/*--------------------------------------------------------------------------*/
-char * iniparser_getstring(const dictionary * d, const char * key, const char * def);
+char * iniparser_getstring(dictionary * d, const char * key, char * def);
/*-------------------------------------------------------------------------*/
/**