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