1 
2 #ifndef _WhoWas_h
3 #define _WhoWas_h
4 
5 #define WHOWAS_USERLIST_MAX 300
6 #define WHOWAS_REG_MAX 500
7 #define WHOWAS_CHAN_MAX 20
8 #include "hash.h"
9 
10 typedef struct _whowaschan_str {
11 	struct _whowaschan_str *next;
12 	char *channel;
13 	int refnum;
14 	ChannelList *channellist;
15 	time_t time;
16 } WhowasChanList;
17 
18 typedef struct _whowaswrapchan_str {
19 	HashEntry NickListTable[WHOWASLIST_HASHSIZE];
20 } WhowasWrapChanList;
21 
22 typedef struct _whowas_str {
23 	struct _whowas_str *next;
24 	int	has_ops; 	/* true is user split away with opz */
25 	char 	*channel;	/* name of channel */
26 	time_t 	time;		/* time of split/leave */
27 	char	*server1;
28 	char	*server2;
29 	NickList *nicklist;	/* pointer to nicklist */
30 	ShitList *shitlist;	/* pointer to shitlist */
31 	ChannelList *channellist;
32 } WhowasList;
33 
34 typedef struct _whowas_wrap_str {
35 	unsigned long total_hits;
36 	unsigned long total_links;
37 	unsigned long total_unlinks;
38 	HashEntry NickListTable[WHOWASLIST_HASHSIZE];
39 } WhowasWrapList;
40 
41 WhowasList *check_whowas_buffer (char *, char *, char *);
42 WhowasList *check_whowas_nick_buffer (char *, char *, int);
43 WhowasList *check_whosplitin_buffer (char *, char *, char *, int);
44 
45 void add_to_whowas_buffer (NickList *, char *, char *, char *);
46 void add_to_whosplitin_buffer (NickList *, char *, char *, char *);
47 
48 int remove_oldest_whowas (WhowasWrapList *, time_t, int);
49 void clean_whowas_list (void);
50 void sync_whowas_adduser (UserList *);
51 void sync_whowas_unuser (UserList *);
52 void sync_whowas_addshit (ShitList *);
53 void sync_whowas_unshit (ShitList *);
54 
55 WhowasChanList *check_whowas_chan_buffer (char *, int, int);
56 void add_to_whowas_chan_buffer (ChannelList *);
57 int remove_oldest_chan_whowas (WhowasChanList **, time_t, int);
58 void clean_whowas_chan_list (void);
59 void show_whowas (void);
60 void show_wholeft (char *);
61 
62 extern WhowasWrapList whowas_splitin_list;
63 #endif
64