aboutsummaryrefslogtreecommitdiff
path: root/db.h
diff options
context:
space:
mode:
Diffstat (limited to 'db.h')
-rw-r--r--db.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/db.h b/db.h
index 2377ec2..c8b73f1 100644
--- a/db.h
+++ b/db.h
@@ -28,6 +28,11 @@ struct db_user_list{
struct db_name_id *list;
};
+struct db_strings_list{
+ i64 count;
+ char **list;
+};
+
void db_init(void);
void db_close(void);
@@ -48,6 +53,9 @@ char* db_get_username(i64 userid);
char* db_get_pass(i64 userid);
bool db_delete_user(i64 userid);
i64 db_find_user(const char *name); // -1 if not found
+struct db_strings_list db_user_tokens(i64 userid);
+bool db_add_token(i64 userid,const char *token);
+bool db_delete_token(i64 userid,const char *token);
void db_create_message(i64 roomid,i64 userid,i64 timestamp,const char *message);
struct db_message_list db_get_messages(i64 roomid,i64 count); // gets latest `count` messages
@@ -56,3 +64,4 @@ void db_nullify_name_id(struct db_name_id ni);
void db_nullify_room_list(struct db_room_list rl);
void db_nullify_user_list(struct db_user_list ul);
void db_nullify_message_list(struct db_message_list ml);
+void db_nullify_strings_list(struct db_strings_list sl);