From cfdf0e333d240526436aff5f886a1da6a0959bce Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 2 Apr 2024 13:34:00 -0400 Subject: 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" --- include/ini.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/ini.h') 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 #include +#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() -- cgit