]> jfr.im git - irc/quakenet/newserv.git/blame - whowas/whowas.h
Implement newsearch support for whowas.
[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
fa6819a7
GB
5#define WW_MAXENTRIES 100000
6#define WW_MASKLEN (HOSTLEN + USERLEN + NICKLEN)
7#define WW_REASONLEN 512
8
9typedef struct whowas {
4030a47e 10 int type;
0eb4cbd3
GB
11 time_t timestamp;
12 nick *nick; /* unlinked nick */
4030a47e
GB
13
14 /* WHOWAS_QUIT or WHOWAS_KILL */
d6385de2 15 sstring *reason;
fa6819a7 16
4030a47e
GB
17 /* WHOWAS_RENAME */
18 sstring *newnick;
fa6819a7 19
0eb4cbd3
GB
20 unsigned int marker;
21
fa6819a7 22 struct whowas *next;
d6385de2 23 struct whowas *prev;
fa6819a7 24} whowas;
363e3ed0
GB
25
26extern whowas *whowas_head, *whowas_tail;
27extern int whowas_count;
28
4030a47e
GB
29#define WHOWAS_QUIT 0
30#define WHOWAS_KILL 1
31#define WHOWAS_RENAME 2
56cab147 32
accce086 33whowas *whowas_fromnick(nick *np);
0eb4cbd3
GB
34nick *whowas_tonick(whowas *ww);
35void whowas_freenick(nick *np);
56cab147 36whowas *whowas_chase(const char *nick, int maxage);
0eb4cbd3 37const char *whowas_format(whowas *ww);
accce086 38void whowas_free(whowas *ww);
0eb4cbd3
GB
39
40unsigned int nextwhowasmarker(void);
41
42#endif /* __WHOWAS_H */