8 void listconfig(struct gconffile **cf, char *block, int compact) {
13 getconfigline(cf, block, &opt, &val, &conftype);
17 if (conftype == CONF_STR && !strcasecmp(opt, "include")) {
18 if (!pushgconffiles(cf, val))
19 debugx(1, DBG_ERR, "failed to include config file %s", val);
26 printf(compact ? "%s=%s;" : "\t%s=%s\n", opt, val);
28 printf("%s=%s\n", opt, val);
31 printf("%s %s {%s", opt, val, compact ? "" : "\n");
32 listconfig(cf, val, compact);
36 printf("Unsupported config type\n");
41 int main(int argc, char **argv) {
43 struct gconffile *cfs;
45 debug_init("catgconf");
46 debug_set_level(DBG_WARN);
48 while ((c = getopt(argc, argv, "c")) != -1) {
57 if (argc - optind != 1)
60 cfs = openconfigfile(argv[optind]);
61 listconfig(&cfs, NULL, compact);
65 debug(DBG_ERR, "Usage:\n%s [ -c ] configfile", argv[0]);