]> jfr.im git - irc/quakenet/newserv.git/blame - whowas/whowas.h
LUA: port luadb to dbapi2 to drop postgres dependency
[irc/quakenet/newserv.git] / whowas / whowas.h
CommitLineData
0eb4cbd3
GB
1#ifndef __WHOWAS_H
2#define __WHOWAS_H
3
dd33b9ca 4#define WW_MAXCHANNELS 20
291fdf5f 5#define WW_DEFAULT_MAXENTRIES 1000
fa6819a7
GB
6#define WW_MASKLEN (HOSTLEN + USERLEN + NICKLEN)
7#define WW_REASONLEN 512
8
9typedef struct whowas {
4030a47e 10 int type;
0eb4cbd3 11 time_t timestamp;
0495c1d1 12 nick nick; /* unlinked nick */
dd33b9ca 13 chanindex *channels[WW_MAXCHANNELS];
4030a47e
GB
14
15 /* WHOWAS_QUIT or WHOWAS_KILL */
d6385de2 16 sstring *reason;
fa6819a7 17
4030a47e
GB
18 /* WHOWAS_RENAME */
19 sstring *newnick;
fa6819a7 20
0eb4cbd3
GB
21 unsigned int marker;
22
fa6819a7 23 struct whowas *next;
d6385de2 24 struct whowas *prev;
fa6819a7 25} whowas;
363e3ed0 26
291fdf5f
CP
27extern whowas *whowasrecs;
28extern int whowasmax;
0495c1d1 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 */