]> jfr.im git - irc/rqf/shadowircd.git/blame - include/whowas.h
Move RPL_WHOISLOGGEDIN to sendto_one_numeric().
[irc/rqf/shadowircd.git] / include / whowas.h
CommitLineData
212380e3 1/*
2 * ircd-ratbox: A slightly useful ircd.
3 * whowas.h: Header for the whowas functions.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2004 ircd-ratbox development team
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 *
212380e3 24 */
25#ifndef INCLUDED_whowas_h
26#define INCLUDED_whowas_h
27
28#include "ircd_defs.h"
29#include "client.h"
30
31#include "setup.h"
32
33/*
34 * Whowas hash table size
35 *
36 */
37#define WW_MAX_BITS 16
38#define WW_MAX 65536
39
40struct User;
41struct Client;
42
43/*
44 lets speed this up...
45 also removed away information. *tough*
46 - Dianora
47 */
48struct Whowas
49{
50 int hashv;
51 char name[NICKLEN + 1];
52 char username[USERLEN + 1];
53 char hostname[HOSTLEN + 1];
54 char sockhost[HOSTIPLEN + 1];
55 const char *servername;
56 char realname[REALLEN + 1];
57 time_t logoff;
58 struct Client *online; /* Pointer to new nickname for chasing or NULL */
59 struct Whowas *next; /* for hash table... */
60 struct Whowas *prev; /* for hash table... */
61 struct Whowas *cnext; /* for client struct linked list */
62 struct Whowas *cprev; /* for client struct linked list */
63};
64
65/*
66** initwhowas
67*/
68extern void initwhowas(void);
69
70/*
71** add_history
72** Add the currently defined name of the client to history.
73** usually called before changing to a new name (nick).
74** Client must be a fully registered user (specifically,
75** the user structure must have been allocated).
76*/
77void add_history(struct Client *, int);
78
79/*
80** off_history
81** This must be called when the client structure is about to
82** be released. History mechanism keeps pointers to client
83** structures and it must know when they cease to exist. This
84** also implicitly calls AddHistory.
85*/
86void off_history(struct Client *);
87
88/*
89** get_history
90** Return the current client that was using the given
91** nickname within the timelimit. Returns NULL, if no
92** one found...
93*/
94struct Client *get_history(const char *, time_t);
95 /* Nick name */
96 /* Time limit in seconds */
97
98/*
99** for debugging...counts related structures stored in whowas array.
100*/
101void count_whowas_memory(size_t *, size_t *);
102
103/* XXX m_whowas.c in modules needs these */
104extern struct Whowas WHOWAS[];
105extern struct Whowas *WHOWASHASH[];
106extern unsigned int hash_whowas_name(const char *name);
107
108#endif /* INCLUDED_whowas_h */