From 7dbbe725e8b59a7ed813342bd5cb47c81bc2cf1c Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 15 Apr 2024 00:36:20 -0400 Subject: Add ini_has_key() and expose ini_section_search() function * ini_section_search now has three matching modes _EXACT, _BEGINS, and _SUBSTR --- include/ini.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/ini.h') diff --git a/include/ini.h b/include/ini.h index a444665..fa2bd98 100644 --- a/include/ini.h +++ b/include/ini.h @@ -9,6 +9,9 @@ #define INI_WRITE_PRESERVE 1 ///< Dump INI data. Template strings are #define INI_SETVAL_APPEND 0 #define INI_SETVAL_REPLACE 1 +#define INI_SEARCH_EXACT 0 +#define INI_SEARCH_BEGINS 1 +#define INI_SEARCH_SUBSTR 2 ///< expanded to preserve runtime state. #define INIVAL_TYPE_INT 1 ///< Integer @@ -89,6 +92,23 @@ struct INIFILE { */ struct INIFILE *ini_open(const char *filename); +/** + * + * @param ini + * @param value + * @return + */ +struct INISection *ini_section_search(struct INIFILE **ini, unsigned mode, char *value); + +/** + * + * @param ini + * @param section + * @param key + * @return + */ +int ini_has_key(struct INIFILE *ini, const char *section, const char *key); + /** * Assign value to a section key * @param ini -- cgit