aboutsummaryrefslogtreecommitdiff
path: root/src/userdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/userdb.h')
-rw-r--r--src/userdb.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/userdb.h b/src/userdb.h
index ac169b2..a941e9a 100644
--- a/src/userdb.h
+++ b/src/userdb.h
@@ -1,12 +1,8 @@
+#pragma once
+
#include "netcosm.h"
#include "auth.h"
-/*
- * on-disk database for storing user data
- *
- * child processes MUST go through the master to use this
- */
-
struct userdata_t {
char username[MAX_NAME_LEN + 1];
@@ -16,8 +12,11 @@ struct userdata_t {
char passhash[AUTH_HASHLEN * 2 + 1];
int priv;
+ room_id room;
};
+/*** functions for the master process ONLY ***/
+
/* call before using anything else */
void userdb_init(const char *dbfile);
@@ -42,3 +41,8 @@ void userdb_shutdown(void);
/* save the DB to disk */
void userdb_write(const char*);
+
+/*** child-only functions ***/
+struct userdata_t *userdb_request_lookup(const char *name);
+bool userdb_request_add(struct userdata_t *data);
+bool userdb_request_remove(const char *name);