From 71a36d7553b288ea9d0d396b3fbb1afcea8e7c04 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 8 Apr 2020 21:08:54 +0300 Subject: [PATCH] Ini multientry support improvement. --- include/ini.h | 3 ++- ini.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/ini.h b/include/ini.h index 4cd5e77f..c4f32dbb 100644 --- a/include/ini.h +++ b/include/ini.h @@ -26,6 +26,7 @@ bool ini_save(struct ini_data *ini, const TCHAR *path); void ini_initcontext(struct ini_data *ini, struct ini_context *ctx); void ini_setlast(struct ini_data *ini, const TCHAR *section, const TCHAR *key, struct ini_context *ctx); void ini_setlastasstart(struct ini_data *ini, struct ini_context *ctx); +void ini_setnextasstart(struct ini_data *ini, struct ini_context *ctx); void ini_setcurrentasstart(struct ini_data *ini, struct ini_context *ctx); void ini_addnewstring(struct ini_data *ini, const TCHAR *section, const TCHAR *key, const TCHAR *val); @@ -46,4 +47,4 @@ bool ini_getsection(struct ini_data *ini, int idx, TCHAR **section); bool ini_addstring(struct ini_data *ini, const TCHAR *section, const TCHAR *key, const TCHAR *val); bool ini_delete(struct ini_data *ini, const TCHAR *section, const TCHAR *key); -bool ini_nextsection(struct ini_data *ini, TCHAR *section); \ No newline at end of file +bool ini_nextsection(struct ini_data *ini, TCHAR *section); diff --git a/ini.cpp b/ini.cpp index af3c45d6..864bd83c 100644 --- a/ini.cpp +++ b/ini.cpp @@ -495,6 +495,11 @@ void ini_setcurrentasstart(struct ini_data *ini, struct ini_context *ctx) ctx->start = ctx->lastpos; } +void ini_setnextasstart(struct ini_data *ini, struct ini_context *ctx) +{ + ctx->start = ctx->lastpos + 1; +} + void ini_setlast(struct ini_data *ini, const TCHAR *section, const TCHAR *key, struct ini_context *ctx) { for (int c = ctx->start + 1; c < ini->inilines; c++) { -- 2.47.3