aboutsummaryrefslogtreecommitdiff
path: root/include/ini.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-15 00:36:20 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-15 01:03:35 -0400
commit7dbbe725e8b59a7ed813342bd5cb47c81bc2cf1c (patch)
tree64a325354ca84a29855ff30027a6220524848bcd /include/ini.h
parent0db784a48f28a240e2a768d2773ba7cd4833a92d (diff)
downloadstasis-7dbbe725e8b59a7ed813342bd5cb47c81bc2cf1c.tar.gz
Add ini_has_key() and expose ini_section_search() function
* ini_section_search now has three matching modes _EXACT, _BEGINS, and _SUBSTR
Diffstat (limited to 'include/ini.h')
-rw-r--r--include/ini.h20
1 files changed, 20 insertions, 0 deletions
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
@@ -90,6 +93,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
* @param type INI_SETVAL_APPEND or INI_SETVAL_REPLACE