]>
Commit | Line | Data |
---|---|---|
57583275 | 1 | #ifndef __AUTHEXT_H |
2 | #define __AUTHEXT_H | |
3 | ||
4 | #define MAXAUTHNAMEEXTS 5 | |
5 | ||
6 | struct nick; | |
7 | ||
8 | typedef struct authname { | |
9 | unsigned long userid; | |
10 | int usercount; | |
11 | unsigned int marker; | |
12 | struct nick *nicks; | |
5a335041 CP |
13 | struct authname *next, *nextbyname; |
14 | unsigned int namebucket; | |
57583275 | 15 | /* These are extensions only used by other modules */ |
16 | void *exts[MAXAUTHNAMEEXTS]; | |
17 | } authname; | |
18 | ||
19 | #define AUTHNAMEHASHSIZE 60000 | |
20 | ||
21 | extern authname *authnametable[AUTHNAMEHASHSIZE]; | |
22 | ||
23 | /* Allocators */ | |
5a335041 | 24 | authname *newauthname(void); |
57583275 | 25 | void freeauthname (authname *hp); |
26 | ||
27 | /* EXT management */ | |
28 | int registerauthnameext(const char *name); | |
29 | int findauthnameext(const char *name); | |
30 | void releaseauthnameext(int index); | |
31 | ||
32 | /* Actual user commands */ | |
33 | authname *findauthname(unsigned long userid); | |
5a335041 CP |
34 | authname *findauthnamebyname(const char *name); |
35 | authname *findorcreateauthname(unsigned long userid, const char *name); | |
57583275 | 36 | void releaseauthname(authname *anp); |
37 | ||
38 | /* Marker */ | |
5a335041 | 39 | unsigned int nextauthnamemarker(void); |
57583275 | 40 | |
41 | #endif |