]>
Commit | Line | Data |
---|---|---|
0eb4cbd3 GB |
1 | #ifndef __WHOWAS_H |
2 | #define __WHOWAS_H | |
3 | ||
55ed35b4 | 4 | #define WW_MAXAGE 3600 |
69df6b34 | 5 | #define WW_MAXENTRIES 250000 |
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 */ |
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 | 25 | |
0495c1d1 GB |
26 | extern whowas whowasrecs[WW_MAXENTRIES]; |
27 | extern int whowasoffset; /* points to oldest record */ | |
363e3ed0 | 28 | |
0495c1d1 | 29 | #define WHOWAS_UNUSED 0 |
a45da344 GB |
30 | #define WHOWAS_USED 1 |
31 | #define WHOWAS_QUIT 2 | |
32 | #define WHOWAS_KILL 3 | |
33 | #define WHOWAS_RENAME 4 | |
56cab147 | 34 | |
0495c1d1 | 35 | whowas *whowas_fromnick(nick *np, int standalone); |
0eb4cbd3 GB |
36 | nick *whowas_tonick(whowas *ww); |
37 | void whowas_freenick(nick *np); | |
0495c1d1 | 38 | whowas *whowas_chase(const char *target, int maxage); |
0eb4cbd3 | 39 | const char *whowas_format(whowas *ww); |
0495c1d1 | 40 | void whowas_clean(whowas *ww); |
accce086 | 41 | void whowas_free(whowas *ww); |
0eb4cbd3 GB |
42 | |
43 | unsigned int nextwhowasmarker(void); | |
44 | ||
45 | #endif /* __WHOWAS_H */ |