struct cfg bar; struct cfg mouse; char *str; Bool b; cfg_section(CFG_ROOT, &bar, "bar"); while(cfg_section(&bar, &mouse, "mouse") != -1) { str = cfg_getstr(&bar, "key", "default"); b = cfg_getbool(&bar, "key", False); }