Mostly cosmetic changes to INI file parser
This commit is contained in:
parent
dd9c8ab4f9
commit
9cfd315dbf
@ -122,7 +122,7 @@ static int inifile_read_line(FAR struct inifile_state_s *priv);
|
|||||||
static int inifile_read_noncomment_line(FAR struct inifile_state_s *priv);
|
static int inifile_read_noncomment_line(FAR struct inifile_state_s *priv);
|
||||||
static bool inifile_seek_to_section(FAR struct inifile_state_s *priv,
|
static bool inifile_seek_to_section(FAR struct inifile_state_s *priv,
|
||||||
FAR const char *section);
|
FAR const char *section);
|
||||||
static int inifile_read_variable(FAR struct inifile_state_s *priv,
|
static bool inifile_read_variable(FAR struct inifile_state_s *priv,
|
||||||
FAR struct inifile_var_s *varinfo);
|
FAR struct inifile_var_s *varinfo);
|
||||||
static FAR char *
|
static FAR char *
|
||||||
inifile_find_section_variable(FAR struct inifile_state_s *priv,
|
inifile_find_section_variable(FAR struct inifile_state_s *priv,
|
||||||
@ -358,7 +358,7 @@ static bool inifile_seek_to_section(FAR struct inifile_state_s *priv,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int inifile_read_variable(FAR struct inifile_state_s *priv,
|
static bool inifile_read_variable(FAR struct inifile_state_s *priv,
|
||||||
FAR struct inifile_var_s *varinfo)
|
FAR struct inifile_var_s *varinfo)
|
||||||
{
|
{
|
||||||
FAR char *ptr;
|
FAR char *ptr;
|
||||||
@ -478,7 +478,7 @@ static FAR char *
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static char *inifile_find_variable(FAR struct inifile_state_s *priv,
|
static FAR char *inifile_find_variable(FAR struct inifile_state_s *priv,
|
||||||
FAR const char *section,
|
FAR const char *section,
|
||||||
FAR const char *variable)
|
FAR const char *variable)
|
||||||
{
|
{
|
||||||
@ -532,7 +532,7 @@ INIHANDLE inifile_initialize(FAR char *inifile_name)
|
|||||||
if (!priv)
|
if (!priv)
|
||||||
{
|
{
|
||||||
inidbg("ERROR: Failed to allocate state structure\n");
|
inidbg("ERROR: Failed to allocate state structure\n");
|
||||||
return NULL;
|
return (INIHANDLE)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the specified INI file for reading */
|
/* Open the specified INI file for reading */
|
||||||
@ -549,7 +549,7 @@ INIHANDLE inifile_initialize(FAR char *inifile_name)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
inidbg("ERROR: Could not open \"%s\"\n", inifile_name);
|
inidbg("ERROR: Could not open \"%s\"\n", inifile_name);
|
||||||
return NULL;
|
return (INIHANDLE)NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,10 +659,12 @@ long inifile_read_integer(INIHANDLE handle,
|
|||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
/* Then convert the string to an integer value */
|
/* Then convert the string to an integer value (accept any base, and
|
||||||
|
* ignore all conversion errors.
|
||||||
|
*/
|
||||||
|
|
||||||
inivdbg("%s=\"%s\"\n", variable, value);
|
inivdbg("%s=\"%s\"\n", variable, value);
|
||||||
ret = strtol(value, NULL, 10);
|
ret = strtol(value, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the value that we found. */
|
/* Return the value that we found. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user