]>
Commit | Line | Data |
---|---|---|
57583275 | 1 | #ifndef __AUTHEXT_H |
2 | #define __AUTHEXT_H | |
3 | ||
1a96a370 | 4 | #include "../irc/irc_config.h" |
0b0fb773 | 5 | #include "../lib/flags.h" |
92acf9ae CP |
6 | |
7 | #include <sys/types.h> | |
0b0fb773 | 8 | |
57583275 | 9 | #define MAXAUTHNAMEEXTS 5 |
10 | ||
11 | struct nick; | |
12 | ||
13 | typedef struct authname { | |
14 | unsigned long userid; | |
15 | int usercount; | |
16 | unsigned int marker; | |
17 | struct nick *nicks; | |
5a335041 CP |
18 | struct authname *next, *nextbyname; |
19 | unsigned int namebucket; | |
92acf9ae | 20 | u_int64_t flags; |
1a96a370 | 21 | char name[ACCOUNTLEN+1]; |
57583275 | 22 | /* These are extensions only used by other modules */ |
23 | void *exts[MAXAUTHNAMEEXTS]; | |
24 | } authname; | |
25 | ||
26 | #define AUTHNAMEHASHSIZE 60000 | |
27 | ||
28 | extern authname *authnametable[AUTHNAMEHASHSIZE]; | |
29 | ||
30 | /* Allocators */ | |
5a335041 | 31 | authname *newauthname(void); |
57583275 | 32 | void freeauthname (authname *hp); |
33 | ||
34 | /* EXT management */ | |
04b12064 | 35 | int registerauthnameext(const char *name, int persistant); |
57583275 | 36 | int findauthnameext(const char *name); |
37 | void releaseauthnameext(int index); | |
38 | ||
39 | /* Actual user commands */ | |
40 | authname *findauthname(unsigned long userid); | |
5a335041 CP |
41 | authname *findauthnamebyname(const char *name); |
42 | authname *findorcreateauthname(unsigned long userid, const char *name); | |
57583275 | 43 | void releaseauthname(authname *anp); |
44 | ||
45 | /* Marker */ | |
5a335041 | 46 | unsigned int nextauthnamemarker(void); |
57583275 | 47 | |
1cf62143 CP |
48 | authname *getauthbyname(const char *name); |
49 | ||
57583275 | 50 | #endif |