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