ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/include/hash.h
Revision: 190
Committed: Sun Oct 23 22:06:17 2005 UTC (20 years, 9 months ago) by adx
Content type: text/x-chdr
File size: 2411 byte(s)
Log Message:
* prototypes are now prefixed with either nothing or EXTERN
  (meaning it's an ircd.dll API)
* dynamic modules now work on win32.

File Contents

# User Rev Content
1 adx 30 /*
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 knight 31 * $Id$
23 adx 30 */
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 ResvChannel;
36     struct UserHost;
37 knight 114 struct ListTask;
38 adx 30
39     enum {
40     HASH_TYPE_ID,
41     HASH_TYPE_CLIENT,
42     HASH_TYPE_CHANNEL,
43     HASH_TYPE_USERHOST,
44     HASH_TYPE_RESERVED
45     };
46    
47 adx 190 void init_hash(void);
48 adx 30
49 adx 190 EXTERN void hash_add_client(struct Client *);
50     EXTERN void hash_del_client(struct Client *);
51     EXTERN void hash_add_channel(struct Channel *);
52     EXTERN void hash_del_channel(struct Channel *);
53     EXTERN void hash_add_resv(struct ResvChannel *);
54     EXTERN void hash_del_resv(struct ResvChannel *);
55     EXTERN void hash_add_id(struct Client *);
56     EXTERN void hash_del_id(struct Client *);
57     EXTERN void hash_add_userhost(struct UserHost *);
58     EXTERN void hash_del_userhost(struct UserHost *);
59 adx 30
60 adx 190 EXTERN struct UserHost *hash_find_userhost(const char *);
61     EXTERN struct Client *hash_find_id(const char *);
62     EXTERN struct Client *find_client(const char *);
63     EXTERN struct Client *find_server(const char *);
64     EXTERN struct Channel *hash_find_channel(const char *);
65     EXTERN void *hash_get_bucket(int, unsigned int);
66     EXTERN struct ResvChannel *hash_find_resv(const char *);
67 adx 30
68 adx 190 EXTERN void free_list_task(struct ListTask *, struct Client *);
69     EXTERN void safe_list_channels(struct Client *, struct ListTask *, int, int);
70    
71     EXTERN unsigned int strhash(const char *);
72 adx 30 #endif /* INCLUDED_hash_h */

Properties

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