aboutsummaryrefslogtreecommitdiff
path: root/ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctl.c')
-rw-r--r--ctl.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/ctl.c b/ctl.c
new file mode 100644
index 0000000..1a3627c
--- /dev/null
+++ b/ctl.c
@@ -0,0 +1,44 @@
+#include <stdio.h>
+#include <string.h>
+#include "db.h"
+#include "query.h"
+#include "site.h"
+
+void
+showfront()
+{
+ char *title;
+
+ title = site.name;
+ printf("Content-Type: text/html\n\n");
+ #include "t/head.tc"
+ #include "t/front.tc"
+ #include "t/foot.tc"
+}
+
+void
+showpost(int id)
+{
+ char *title;
+
+ title = site.name;
+ printf("Content-Type: text/html\n\n");
+ #include "t/head.tc"
+ #include "t/post.tc"
+ #include "t/foot.tc"
+}
+
+void
+showuser(int id)
+{
+ char *title;
+ struct user *user;
+
+ user = getuser(id);
+ title = site.name;
+ printf("Content-Type: text/html\n\n");
+ #include "t/head.tc"
+ #include "t/user.tc"
+ #include "t/foot.tc"
+ free(user);
+} \ No newline at end of file