cfparser: new section callback
authorMarko Kreen <markokr@gmail.com>
Wed, 26 Jan 2011 12:04:29 +0000 (14:04 +0200)
committerMarko Kreen <markokr@gmail.com>
Wed, 26 Jan 2011 12:04:29 +0000 (14:04 +0200)
usual/cfparser.c
usual/cfparser.h

index 9a856a26bdc37cd5e08ca66501a2552a31cdc734..1fd9a79114b730cf64cfd2cbe48359fffd694ebb 100644 (file)
@@ -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;
 
index 14a39b043b7a11e933fd5c187b5e1852e979f101..7929da886ec27e889a491028dd73880eaf0c8fe0 100644 (file)
@@ -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);
 };
 
 /**