diff options
| author | Franklin Wei <git@fwei.tk> | 2016-01-13 18:08:52 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-01-13 18:08:52 -0500 |
| commit | cc9c177672edcc65933b15ba91831bf09bbec023 (patch) | |
| tree | 1f717027c56e92acaecf2ccf581c83d979b9a461 /src/userdb.h | |
| parent | 06880048df2202b1828e5367b1697aee305a2358 (diff) | |
| download | netcosm-0.2.zip netcosm-0.2.tar.gz netcosm-0.2.tar.bz2 netcosm-0.2.tar.xz | |
rewrite everything to use libev0.2
Diffstat (limited to 'src/userdb.h')
| -rw-r--r-- | src/userdb.h | 16 |
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); |