]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | typedef 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 |
27 | extern whowas *whowasrecs; |
28 | extern int whowasmax; | |
0495c1d1 | 29 | extern 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 | 37 | whowas *whowas_fromnick(nick *np, int standalone); |
0eb4cbd3 GB |
38 | nick *whowas_tonick(whowas *ww); |
39 | void whowas_freenick(nick *np); | |
0495c1d1 | 40 | whowas *whowas_chase(const char *target, int maxage); |
0eb4cbd3 | 41 | const char *whowas_format(whowas *ww); |
dd33b9ca | 42 | const char *whowas_formatchannels(whowas *ww); |
0495c1d1 | 43 | void whowas_clean(whowas *ww); |
accce086 | 44 | void whowas_free(whowas *ww); |
0eb4cbd3 GB |
45 | |
46 | unsigned int nextwhowasmarker(void); | |
47 | ||
48 | #endif /* __WHOWAS_H */ |