aboutsummaryrefslogtreecommitdiff
path: root/db.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-09-19 14:46:47 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-09-19 14:46:47 +0200
commit53569c91e4ebdbba96e6286f846dead1d427e6e2 (patch)
tree70d9e65a3e175d034349dbfb17e1044b752a1334 /db.h
parent3f2a9bc6638dbe09bd8c70fdac068555659e58ac (diff)
downloadcforum-53569c91e4ebdbba96e6286f846dead1d427e6e2.tar.gz
Use single header file
There are drawbacks with this approach, but the benefit -- for a small-ish project -- is that the single header file can serve as a very good overview and guide for people exploring the code for the first time.
Diffstat (limited to 'db.h')
-rw-r--r--db.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/db.h b/db.h
deleted file mode 100644
index 1385b98..0000000
--- a/db.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <sqlite3.h>
-
-sqlite3 *db;
-
-struct att{
- int id;
- int post;
- int bytes; /* Size of data. */
- char *name;
- char *desc;
- char *mime;
- char *data;
-};
-
-struct post{
- int id;
- int parent;
- int user;
- int created;
- int edited;
- char *subject;
- char *text;
-};
-
-struct user{
- int id;
- int created;
- char *name;
- char *full;
- char *hash;
-};
-
-int addatt(struct att *);
-int adduser(struct user *);
-struct att *getatt(sqlite3_stmt *);
-struct post *getpost(sqlite3_stmt *);
-struct user *getuser(sqlite3_stmt *);
-struct att *nextatt(sqlite3_stmt *);
-struct post *nextpost(sqlite3_stmt *);
-struct user *nextuser(sqlite3_stmt *);
-sqlite3_stmt *selectbyint(char *, char *, int); \ No newline at end of file