diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 13:34:00 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 18:55:46 -0400 |
commit | cfdf0e333d240526436aff5f886a1da6a0959bce (patch) | |
tree | a22071401f406723f38bdc4c825245e36bd61b73 /include | |
parent | 9910a30f0c26b3180d46418abad760f86a253aa2 (diff) | |
download | stasis-cfdf0e333d240526436aff5f886a1da6a0959bce.tar.gz |
Changes to ini_write() behavior:
* Caller can choose to dump raw unmodified key/value pairs, or render all values through the template engine
* Fixes spurious line feeds injected into the output stream
* Uses LINE_SEP instead of "\n"
Diffstat (limited to 'include')
-rw-r--r-- | include/ini.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/ini.h b/include/ini.h index 41692b6..af81895 100644 --- a/include/ini.h +++ b/include/ini.h @@ -5,6 +5,10 @@ #include <stddef.h> #include <stdbool.h> +#define INI_WRITE_RAW 0 ///< Dump INI data. Contents are not modified. +#define INI_WRITE_PRESERVE 1 ///< Dump INI data. Template strings are + ///< expanded to preserve runtime state. + #define INIVAL_TYPE_INT 1 ///< Integer #define INIVAL_TYPE_UINT 2 ///< Unsigned integer #define INIVAL_TYPE_LONG 3 ///< Long integer @@ -173,7 +177,7 @@ int ini_getval(struct INIFILE *ini, char *section_name, char *key, int type, uni * @param file pointer to address of file stream * @return 0 on success, -1 on error */ -int ini_write(struct INIFILE *ini, FILE **stream); +int ini_write(struct INIFILE *ini, FILE **stream, unsigned mode); /** * Free memory allocated by ini_open() |