/[svn]/branches/newio/include/hash.h
ViewVC logotype

Contents of /branches/newio/include/hash.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2420 - (show annotations)
Tue Jul 23 17:45:56 2013 UTC (9 years ago) by michael
File MIME type: text/x-csrc
File size: 2195 byte(s)
- Fixed misc. compile warnings

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