/[svn]/ircd-hybrid/trunk/include/hash.h
ViewVC logotype

Contents of /ircd-hybrid/trunk/include/hash.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5347 - (show annotations)
Sun Jan 11 12:42:20 2015 UTC (8 years, 1 month ago) by michael
File MIME type: text/x-csrc
File size: 2197 byte(s)
- Update copyright years

1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2015 ircd-hybrid development team
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 * USA
20 */
21
22 /*! \file hash.h
23 * \brief A header for the ircd hashtable code.
24 * \version $Id$
25 */
26
27 #ifndef INCLUDED_hash_h
28 #define INCLUDED_hash_h
29
30 #define FNV1_32_INIT 0x811c9dc5
31 #define FNV1_32_BITS 16
32 #define FNV1_32_SIZE (1 << FNV1_32_BITS) /* 2^16 = 65536 */
33 #define HASHSIZE FNV1_32_SIZE
34
35 struct Client;
36 struct Channel;
37 struct UserHost;
38
39 enum
40 {
41 HASH_TYPE_ID,
42 HASH_TYPE_CLIENT,
43 HASH_TYPE_CHANNEL,
44 HASH_TYPE_USERHOST
45 };
46
47 extern void hash_init(void);
48 extern void hash_add_client(struct Client *);
49 extern void hash_del_client(struct Client *);
50 extern void hash_add_channel(struct Channel *);
51 extern void hash_del_channel(struct Channel *);
52 extern void hash_add_id(struct Client *);
53 extern void hash_del_id(struct Client *);
54 extern void hash_add_userhost(struct UserHost *);
55 extern void hash_del_userhost(struct UserHost *);
56
57 extern struct UserHost *hash_find_userhost(const char *);
58 extern struct Client *hash_find_id(const char *);
59 extern struct Client *hash_find_client(const char *);
60 extern struct Client *hash_find_server(const char *);
61 extern struct Channel *hash_find_channel(const char *);
62 extern void *hash_get_bucket(int, unsigned int);
63
64 extern void free_list_task(struct Client *);
65 extern void safe_list_channels(struct Client *, int);
66
67 extern unsigned int strhash(const char *);
68 #endif /* INCLUDED_hash_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.30