diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-15 00:32:05 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-15 00:32:05 -0400 |
commit | 0db784a48f28a240e2a768d2773ba7cd4833a92d (patch) | |
tree | 2abe3e720af86e19643819b65635dd38f04598c1 /include | |
parent | ddc6f95e39c48a639171bc4a41dcf7b4d27aec97 (diff) | |
download | stasis-0db784a48f28a240e2a768d2773ba7cd4833a92d.tar.gz |
Add ini_setval() function
Diffstat (limited to 'include')
-rw-r--r-- | include/ini.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/ini.h b/include/ini.h index af81895..a444665 100644 --- a/include/ini.h +++ b/include/ini.h @@ -7,6 +7,8 @@ #define INI_WRITE_RAW 0 ///< Dump INI data. Contents are not modified. #define INI_WRITE_PRESERVE 1 ///< Dump INI data. Template strings are +#define INI_SETVAL_APPEND 0 +#define INI_SETVAL_REPLACE 1 ///< expanded to preserve runtime state. #define INIVAL_TYPE_INT 1 ///< Integer @@ -88,6 +90,17 @@ struct INIFILE { struct INIFILE *ini_open(const char *filename); /** + * Assign value to a section key + * @param ini + * @param type INI_SETVAL_APPEND or INI_SETVAL_REPLACE + * @param section_name + * @param key + * @param value + * @return + */ +int ini_setval(struct INIFILE **ini, unsigned type, char *section_name, char *key, char *value); + +/** * Retrieve all data records in an INI section * * `example.ini` |