1#include <stdio.h> 2#include <confuse.h> 3 4int main(void) 5{ 6 cfg_opt_t opts[] = 7 { 8 CFG_STR("target", "World", CFGF_NONE), 9 CFG_END() 10 }; 11 cfg_t *cfg; 12 13 cfg = cfg_init(opts, CFGF_NONE); 14 if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 15 return 1; 16 17 printf("Hello, %s!\n", cfg_getstr(cfg, "target")); 18 19 cfg_free(cfg); 20 return 0; 21} 22 23