Add error checking function for config parser
This commit is contained in:
parent
f4d6f5a1ae
commit
ed4c18f2be
@ -188,4 +188,15 @@ enum config_parser_ret config_parser_close_file(config_parser_handle_t handle)
|
|||||||
return (res == FR_OK ? CONFIG_PARSER_OK : CONFIG_PARSER_IOERR);
|
return (res == FR_OK ? CONFIG_PARSER_OK : CONFIG_PARSER_IOERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool config_parser_ret_is_abort_condition(enum config_parser_ret return_val)
|
||||||
|
{
|
||||||
|
if (return_val == CONFIG_PARSER_END_REACHED ||
|
||||||
|
return_val == CONFIG_PARSER_GENERIC_ERR ||
|
||||||
|
return_val == CONFIG_PARSER_IOERR ||
|
||||||
|
return_val == CONFIG_PARSER_PARAM_ERR)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
@ -90,6 +90,8 @@ enum config_parser_ret config_parser_write_entry(config_parser_handle_t handle,
|
|||||||
|
|
||||||
enum config_parser_ret config_parser_close_file(config_parser_handle_t handle);
|
enum config_parser_ret config_parser_close_file(config_parser_handle_t handle);
|
||||||
|
|
||||||
|
bool config_parser_ret_is_abort_condition(enum config_parser_ret return_val);
|
||||||
|
|
||||||
#endif /* _CONFIG_PARSER_H_ */
|
#endif /* _CONFIG_PARSER_H_ */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
Loading…
Reference in New Issue
Block a user