diff options
author | default <nobody@localhost> | 2022-09-21 18:27:30 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2022-09-21 18:27:30 +0200 |
commit | e7c886beb77a570cdac02bc36077e247618e2e20 (patch) | |
tree | b308aa531635b9237699abadb541d1a99cab7d4a /main.c | |
parent | 7efb6d5833c20a82ccb4bf2c89e5ce43831db540 (diff) |
More httpd work.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -7,8 +7,50 @@ #include "snac.h" +int usage(void) +{ + printf("usage:\n"); + return 1; +} + + int main(int argc, char *argv[]) { + char *cmd; + char *basedir; + int argi = 1; + + argc--; + if (argc < argi) + return usage(); + + cmd = argv[argi++]; + + if (strcmp(cmd, "init") == 0) { + return 0; + } + + if (argc < argi) + return usage(); + + basedir = argv[argi++]; + + if (!srv_open(basedir)) { + srv_log(xs_fmt("error opening database at %s", basedir)); + return 1; + } + + if (strcmp(cmd, "httpd") == 0) { + httpd(); + return 0; + } + + return 0; +} + + +#if 0 +{ snac snac; printf("%s\n", tid(0)); @@ -85,3 +127,4 @@ int main(int argc, char *argv[]) return 0; } +#endif |