2 * IRC - Internet Relay Chat, include/whowas.h
3 * Copyright (C) 1990 Markku Savela
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 1, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef INCLUDED_whowas_h
22 #define INCLUDED_whowas_h
23 #ifndef INCLUDED_sys_types_h
24 #include <sys/types.h> /* size_t */
25 #define INCLUDED_sys_types_h
34 #define BITS_PER_COL 3
35 #define BITS_PER_COL_MASK 0x7
36 #define WW_MAX_INITIAL 16
38 #define MAX_SUB (1 << BITS_PER_COL)
39 #define WW_MAX_INITIAL_MASK (WW_MAX_INITIAL - 1)
40 #define WW_MAX (WW_MAX_INITIAL * MAX_SUB)
56 struct Client *online; /* Needed for get_history() (nick chasing) */
57 struct Whowas *hnext; /* Next entry with the same hash value */
58 struct Whowas **hprevnextp; /* Pointer to previous next pointer */
59 struct Whowas *cnext; /* Next entry with the same 'online' pointer */
60 struct Whowas **cprevnextp; /* Pointer to previous next pointer */
61 struct Whowas *wnext; /* Next entry in whowas linked list */
62 struct Whowas *wprev; /* Pointer to previous next pointer */
68 extern struct Whowas* whowashash[];
70 extern unsigned int hash_whowas_name(const char *name);
72 extern struct Client *get_history(const char *nick, time_t timelimit);
73 extern void add_history(struct Client *cptr, int still_on);
74 extern void off_history(const struct Client *cptr);
75 extern void initwhowas(void);
76 extern void count_whowas_memory(int *wwu, size_t *wwm, int *wwa, size_t *wwam);
78 extern void whowas_realloc(void);
80 #endif /* INCLUDED_whowas_h */