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