]>
Commit | Line | Data |
---|---|---|
1 | #ifndef __AUTHEXT_H | |
2 | #define __AUTHEXT_H | |
3 | ||
4 | #include "../irc/irc_config.h" | |
5 | #include "../lib/flags.h" | |
6 | ||
7 | #include <sys/types.h> | |
8 | ||
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; | |
18 | struct authname *next, *nextbyname; | |
19 | unsigned int namebucket; | |
20 | u_int64_t flags; | |
21 | char name[ACCOUNTLEN+1]; | |
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 */ | |
31 | authname *newauthname(void); | |
32 | void freeauthname (authname *hp); | |
33 | ||
34 | /* EXT management */ | |
35 | int registerauthnameext(const char *name, int persistant); | |
36 | int findauthnameext(const char *name); | |
37 | void releaseauthnameext(int index); | |
38 | ||
39 | /* Actual user commands */ | |
40 | authname *findauthname(unsigned long userid); | |
41 | authname *findauthnamebyname(const char *name); | |
42 | authname *findorcreateauthname(unsigned long userid, const char *name); | |
43 | void releaseauthname(authname *anp); | |
44 | ||
45 | /* Marker */ | |
46 | unsigned int nextauthnamemarker(void); | |
47 | ||
48 | authname *getauthbyname(const char *name); | |
49 | ||
50 | #endif |