X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/55ed35b4539c789b378645a4db757ed1368875d7..28aa186de14dc4fa7488866e70beb6ae933dde79:/whowas/whowas.h diff --git a/whowas/whowas.h b/whowas/whowas.h index f98074be..b24aff30 100644 --- a/whowas/whowas.h +++ b/whowas/whowas.h @@ -1,17 +1,45 @@ +#ifndef __WHOWAS_H +#define __WHOWAS_H + #define WW_MAXAGE 3600 -#define WW_MAXENTRIES 100000 +#define WW_MAXENTRIES 250000 #define WW_MASKLEN (HOSTLEN + USERLEN + NICKLEN) #define WW_REASONLEN 512 typedef struct whowas { - char nick[NICKLEN+1]; - char ident[USERLEN+1]; - char host[HOSTLEN+1]; - char realname[REALLEN+1]; + int type; + time_t timestamp; + nick nick; /* unlinked nick */ + + /* WHOWAS_QUIT or WHOWAS_KILL */ sstring *reason; - time_t seen; + /* WHOWAS_RENAME */ + sstring *newnick; + + unsigned int marker; struct whowas *next; struct whowas *prev; } whowas; + +extern whowas whowasrecs[WW_MAXENTRIES]; +extern int whowasoffset; /* points to oldest record */ + +#define WHOWAS_UNUSED 0 +#define WHOWAS_USED 1 +#define WHOWAS_QUIT 2 +#define WHOWAS_KILL 3 +#define WHOWAS_RENAME 4 + +whowas *whowas_fromnick(nick *np, int standalone); +nick *whowas_tonick(whowas *ww); +void whowas_freenick(nick *np); +whowas *whowas_chase(const char *target, int maxage); +const char *whowas_format(whowas *ww); +void whowas_clean(whowas *ww); +void whowas_free(whowas *ww); + +unsigned int nextwhowasmarker(void); + +#endif /* __WHOWAS_H */