]> jfr.im git - irc/quakenet/newserv.git/blob - authext/authext.h
Add eXtended service broadcast module (allows sending of authflags without ircd support).
[irc/quakenet/newserv.git] / authext / authext.h
1 #ifndef __AUTHEXT_H
2 #define __AUTHEXT_H
3
4 #include "../lib/flags.h"
5
6 #define MAXAUTHNAMEEXTS 5
7
8 struct nick;
9
10 typedef struct authname {
11 unsigned long userid;
12 int usercount;
13 unsigned int marker;
14 struct nick *nicks;
15 struct authname *next, *nextbyname;
16 unsigned int namebucket;
17 flag_t flags;
18 /* These are extensions only used by other modules */
19 void *exts[MAXAUTHNAMEEXTS];
20 } authname;
21
22 #define AUTHNAMEHASHSIZE 60000
23
24 extern authname *authnametable[AUTHNAMEHASHSIZE];
25
26 /* Allocators */
27 authname *newauthname(void);
28 void freeauthname (authname *hp);
29
30 /* EXT management */
31 int registerauthnameext(const char *name);
32 int findauthnameext(const char *name);
33 void releaseauthnameext(int index);
34
35 /* Actual user commands */
36 authname *findauthname(unsigned long userid);
37 authname *findauthnamebyname(const char *name);
38 authname *findorcreateauthname(unsigned long userid, const char *name);
39 void releaseauthname(authname *anp);
40
41 /* Marker */
42 unsigned int nextauthnamemarker(void);
43
44 authname *getauthbyname(const char *name);
45
46 #endif