confuse-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Confuse-devel] bug in libconfuse


From: address@hidden
Subject: [Confuse-devel] bug in libconfuse
Date: Fri, 03 Oct 2008 23:16:22 +0000
User-agent: Thunderbird 2.0.0.16 (X11/20080707)

Cannot call my error function.

example: test.c:

#include <confuse.h>

void my_errfunc(cfg_t *cfg, const char *fmt, va_list ap) // my error function
{
        printf("--my error function--\n");
        vprintf(fmt, ap);
}

int main(int argc, char **argv)
{
        cfg_opt_t device_opts[] = {
                CFG_END()
        };
        cfg_opt_t opts[] = {
                CFG_SEC("device", device_opts, CFGF_NONE),
                CFG_END()
        };
        cfg_t *cfg;

        cfg = cfg_init(opts, CFGF_NONE);
        cfg_set_error_function(cfg, my_errfunc);

        cfg_parse(cfg, "test.conf");

        cfg_free(cfg);

        return 0;
}

example test.conf:

device
{
        protocol
        {
        }
}







reply via email to

[Prev in Thread] Current Thread [Next in Thread]