]> jfr.im git - irc/quakenet/newserv.git/blame - authext/authext.h
Lua version now excludes "Lua engine", at least for MODULEVERSION.
[irc/quakenet/newserv.git] / authext / authext.h
CommitLineData
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#include "../lib/ccassert.h"
7
8#include <sys/types.h>
0b0fb773 9
57583275 10#define MAXAUTHNAMEEXTS 5
11
92acf9ae
CP
12/* checking to see that u_int64_t == unsigned long long for strtoull */
13CCASSERT(sizeof(unsigned long long) == sizeof(u_int64_t))
14
57583275 15struct nick;
16
17typedef struct authname {
18 unsigned long userid;
19 int usercount;
20 unsigned int marker;
21 struct nick *nicks;
5a335041
CP
22 struct authname *next, *nextbyname;
23 unsigned int namebucket;
92acf9ae 24 u_int64_t flags;
1a96a370 25 char name[ACCOUNTLEN+1];
57583275 26 /* These are extensions only used by other modules */
27 void *exts[MAXAUTHNAMEEXTS];
28} authname;
29
30#define AUTHNAMEHASHSIZE 60000
31
32extern authname *authnametable[AUTHNAMEHASHSIZE];
33
34/* Allocators */
5a335041 35authname *newauthname(void);
57583275 36void freeauthname (authname *hp);
37
38/* EXT management */
39int registerauthnameext(const char *name);
40int findauthnameext(const char *name);
41void releaseauthnameext(int index);
42
43/* Actual user commands */
44authname *findauthname(unsigned long userid);
5a335041
CP
45authname *findauthnamebyname(const char *name);
46authname *findorcreateauthname(unsigned long userid, const char *name);
57583275 47void releaseauthname(authname *anp);
48
49/* Marker */
5a335041 50unsigned int nextauthnamemarker(void);
57583275 51
1cf62143
CP
52authname *getauthbyname(const char *name);
53
57583275 54#endif