]> jfr.im git - irc/quakenet/newserv.git/blame_incremental - authext/authext.h
fix bug in G stats
[irc/quakenet/newserv.git] / authext / authext.h
... / ...
CommitLineData
1#ifndef __AUTHEXT_H
2#define __AUTHEXT_H
3
4#include "../irc/irc_config.h"
5#include "../lib/flags.h"
6#include "../lib/ccassert.h"
7
8#include <sys/types.h>
9
10#define MAXAUTHNAMEEXTS 5
11
12/* checking to see that u_int64_t == unsigned long long for strtoull */
13CCASSERT(sizeof(unsigned long long) == sizeof(u_int64_t))
14
15struct nick;
16
17typedef struct authname {
18 unsigned long userid;
19 int usercount;
20 unsigned int marker;
21 struct nick *nicks;
22 struct authname *next, *nextbyname;
23 unsigned int namebucket;
24 u_int64_t flags;
25 char name[ACCOUNTLEN+1];
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 */
35authname *newauthname(void);
36void freeauthname (authname *hp);
37
38/* EXT management */
39int registerauthnameext(const char *name, int persistant);
40int findauthnameext(const char *name);
41void releaseauthnameext(int index);
42
43/* Actual user commands */
44authname *findauthname(unsigned long userid);
45authname *findauthnamebyname(const char *name);
46authname *findorcreateauthname(unsigned long userid, const char *name);
47void releaseauthname(authname *anp);
48
49/* Marker */
50unsigned int nextauthnamemarker(void);
51
52authname *getauthbyname(const char *name);
53
54#endif