better texture binding
[voxelands-alt.git] / inc / auth.h
blob300ef3130c16dbcade3849bc9f5d6cdf2ee20f24
1 #ifndef _AUTH_H_
2 #define _AUTH_H_
4 #include <stdint.h>
6 #define PRIV_NONE 0x0000
7 #define PRIV_BUILD 0x0001 /* build/interact */
8 #define PRIV_TELEPORT 0x0002 /* teleport */
9 #define PRIV_SETTIME 0x0004 /* set the time */
10 #define PRIV_PRIVS 0x0008 /* grant/revoke privs */
11 #define PRIV_SERVER 0x0010 /* server management (shutdown/settings/etc) */
12 #define PRIV_SHOUT 0x0020 /* chat */
13 #define PRIV_BAN 0x0040 /* ban/unban */
15 /* increment this if a priv is added */
16 #define PRIV_COUNT 7
18 #define PRIV_DEFAULT (PRIV_BUILD|PRIV_SHOUT)
19 #define PRIV_ALL 0x7FFFFFFFFFFFFFFF
20 #define PRIV_INVALID 0x8000000000000000
22 #ifndef _HAVE_AUTHDATA_TYPE
23 #define _HAVE_AUTHDATA_TYPE
24 typedef struct authdata_s {
25 char pwd[64];
26 uint64_t privs;
27 } authdata_t;
28 #endif
30 /* defined in auth.c */
31 int auth_privs2str(uint64_t privs, char* buff, int size);
32 uint64_t auth_str2privs(char* str);
33 int auth_init(char* file);
34 void auth_exit(void);
35 void auth_load(void);
36 void auth_save(void);
37 int auth_exists(char* name);
38 void auth_set(char* name, authdata_t data);
39 void auth_add(char* name);
40 int auth_getpwd(char* name, char buff[64]);
41 void auth_setpwd(char* name, char* pwd);
42 uint64_t auth_getprivs(char* name);
43 void auth_setprivs(char* name, uint64_t privs);
45 #endif