From a810a03ba0962beea1811d50a60d835d7a25e26d Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 26 Jan 2011 14:04:29 +0200 Subject: [PATCH] cfparser: new section callback --- usual/cfparser.c | 5 +++++ usual/cfparser.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/usual/cfparser.c b/usual/cfparser.c index 9a856a2..1fd9a79 100644 --- a/usual/cfparser.c +++ b/usual/cfparser.c @@ -289,6 +289,11 @@ static bool fill_defaults(struct LoaderCtx *ctx) if (!s) goto fail; + if (s->section_start) { + if (!s->section_start(ctx->top_base, ctx->cur_sect)) + return false; + } + if (s->set_key) return true; diff --git a/usual/cfparser.h b/usual/cfparser.h index 14a39b0..7929da8 100644 --- a/usual/cfparser.h +++ b/usual/cfparser.h @@ -117,6 +117,9 @@ struct CfSect { /** Get dynamic keys (optional) */ const char *(*get_key)(void *base, const char *key, char *buf, int buflen); + + /** New section callback (optional) */ + bool (*section_start)(void *top_base, const char *sect_name); }; /** -- 2.39.5