8 void listconfig(struct gconffile **cf, char *block, int compact) {
9 char *opt = NULL, *val = NULL;
15 getconfigline(cf, block, &opt, &val, &conftype);
19 if (conftype == CONF_STR && !strcasecmp(opt, "include")) {
20 if (!pushgconfpaths(cf, val))
21 debugx(1, DBG_ERR, "failed to include config file %s", val);
28 printf(compact ? "%s=%s;" : "\t%s=%s\n", opt, val);
30 printf("%s=%s\n", opt, val);
33 printf("%s %s {%s", opt, val, compact ? "" : "\n");
34 listconfig(cf, val, compact);
38 printf("Unsupported config type\n");
43 int main(int argc, char **argv) {
45 struct gconffile *cfs;
47 debug_init("catgconf");
48 debug_set_level(DBG_WARN);
50 while ((c = getopt(argc, argv, "c")) != -1) {
59 if (argc - optind != 1)
62 cfs = openconfigfile(argv[optind]);
63 listconfig(&cfs, NULL, compact);
67 debug(DBG_ERR, "Usage:\n%s [ -c ] configfile", argv[0]);
71 /* Local Variables: */
72 /* c-file-style: "stroustrup" */