From b2fada1dd19211d71e04557653d08e697134a6ce Mon Sep 17 00:00:00 2001 From: Erik K Date: Fri, 13 May 2022 17:24:26 +0000 Subject: initial commit --- config.h | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 config.h (limited to 'config.h') diff --git a/config.h b/config.h new file mode 100644 index 0000000..96a42b7 --- /dev/null +++ b/config.h @@ -0,0 +1,94 @@ +#ifndef CONFIG_H +#define CONFIG_H +#include + +#define CLEN 512 + +#define DUMPSTR(N, S) fprintf(stderr, "%-15s: %s\n", N, S); +#define DUMPCFG() \ + DUMPSTR("DbLoc", kdbloc); \ + DUMPSTR("ContentDir", kcontentdir); \ + DUMPSTR("LinkPreset", klinkpreset); \ + DUMPSTR("Autoedit", kautoedit); \ + DUMPSTR("Autoexport", kautoexport); \ + DUMPSTR("SkullExport", kskullexport); \ + DUMPSTR("RssTitle", krsstitle); \ + DUMPSTR("RssDescription", krssdescription); \ + DUMPSTR("RssLink", krsslink); \ + DUMPSTR("RssExport", krssexport); \ + DUMPSTR("PostsExport", kpostsexport); \ + +char *storepointer(const char *, int *); + +extern char kdbloc[]; +extern char kcontentdir[]; +extern char klinkpreset[]; +extern char kautoedit[]; +extern char kautoexport[]; + +extern char kskullexport[]; + +extern char krsstitle[]; +extern char krssdescription[]; +extern char krsslink[]; +extern char krssexport[]; + +extern char kpostsexport[]; + +#ifdef MAIN +char kdbloc[CLEN] = "sm.tsv"; +char kcontentdir[CLEN] = "content"; +char klinkpreset[CLEN] = "https://previousplan.org/%"; +char kautoedit[CLEN] = "True"; +char kautoexport[CLEN] = "False"; + +char kskullexport[CLEN] = "export"; + +char krsstitle[CLEN] = "Previous Plan!"; +char krssdescription[CLEN] = "Previous Plan! Blog"; +char krsslink[CLEN] = "https://previousplan.org/rss.xml"; +char krssexport[CLEN] = "export/rss.xml"; + +char kpostsexport[CLEN] = "export/posts.html"; + +char * +storepointer(const char *key, int *ispath) +{ + *ispath = 0; + if (!strcasecmp(key, "DbLoc")) { + *ispath = 1; + return kdbloc; + } + if (!strcasecmp(key, "ContentDir")) { + *ispath = 1; + return kcontentdir; + } + if (!strcasecmp(key, "LinkPreset")) + return klinkpreset; + if (!strcasecmp(key, "Autoedit")) + return kautoedit; + if (!strcasecmp(key, "Autoexport")) + return kautoexport; + if (!strcasecmp(key, "SkullExport")) { + *ispath = 1; + return kskullexport; + } + if (!strcasecmp(key, "RssTitle")) + return krsstitle; + if (!strcasecmp(key, "RssDescription")) + return krssdescription; + if (!strcasecmp(key, "RssLink")) + return krsslink; + if (!strcasecmp(key, "RssExport")) { + *ispath = 1; + return krssexport; + } + if (!strcasecmp(key, "PostsExport")) { + *ispath = 1; + return kpostsexport; + } + return NULL; +} +#endif + +#endif /* ! CONFIG_H */ -- cgit v1.2.3