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
{
}
}