]> jfr.im git - irc/quakenet/newserv.git/blame_incremental - whowas/whowas.h
glines: Only use CIDR masks when necessary.
[irc/quakenet/newserv.git] / whowas / whowas.h
... / ...
CommitLineData
1#ifndef __WHOWAS_H
2#define __WHOWAS_H
3
4#define WW_MAXAGE 3600
5#define WW_MAXCHANNELS 20
6#define WW_MAXENTRIES 100000
7#define WW_MASKLEN (HOSTLEN + USERLEN + NICKLEN)
8#define WW_REASONLEN 512
9
10typedef struct whowas {
11 int type;
12 time_t timestamp;
13 nick nick; /* unlinked nick */
14 chanindex *channels[WW_MAXCHANNELS];
15
16 /* WHOWAS_QUIT or WHOWAS_KILL */
17 sstring *reason;
18
19 /* WHOWAS_RENAME */
20 sstring *newnick;
21
22 unsigned int marker;
23
24 struct whowas *next;
25 struct whowas *prev;
26} whowas;
27
28extern whowas whowasrecs[WW_MAXENTRIES];
29extern int whowasoffset; /* points to oldest record */
30
31#define WHOWAS_UNUSED 0
32#define WHOWAS_USED 1
33#define WHOWAS_QUIT 2
34#define WHOWAS_KILL 3
35#define WHOWAS_RENAME 4
36
37whowas *whowas_fromnick(nick *np, int standalone);
38nick *whowas_tonick(whowas *ww);
39void whowas_freenick(nick *np);
40whowas *whowas_chase(const char *target, int maxage);
41const char *whowas_format(whowas *ww);
42const char *whowas_formatchannels(whowas *ww);
43void whowas_clean(whowas *ww);
44void whowas_free(whowas *ww);
45
46unsigned int nextwhowasmarker(void);
47
48#endif /* __WHOWAS_H */