hash.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #define DEFAULT_HASH_SIZE 7951
10 extern "C" {
11  typedef unsigned int HASHHASH(const void *, unsigned int);
12  struct _hash_link {
13  char *key;
14  struct _hash_link *next;
15  void *item;
16  };
17  typedef int HASHCMP(const void *, const void *);
18 
19  typedef struct _hash_link hash_link;
20 
21  struct _hash_table {
22  int valid;
26  unsigned int size;
27  unsigned int current_slot;
29  };
30  typedef struct _hash_table hash_table;
31 
32  extern int hash_links_allocated;
33  /* AYJ: defined by globals.h */
34 //extern int store_hash_buckets; /* 0 */
35 //extern hash_table *store_table; /* NULL */
36  extern hash_table *hash_create(HASHCMP *, int, HASHHASH *);
37  extern void hash_insert(hash_table *, const char *, void *);
38  extern int hash_delete(hash_table *, const char *);
40  int hash_unlink(hash_table *, hash_link *, int);
41  void hash_join(hash_table *, hash_link *);
43  hash_link *hash_lookup(hash_table *, const void *);
46  hash_link *hash_get_bucket(hash_table *, unsigned int);
47  void hashFreeMemory(hash_table *);
51 
52 }
53 
SQUIDCEXTERN void hash_first(hash_table *)
Definition: hash.cc:176
SQUIDCEXTERN void hashFreeMemory(hash_table *)
Definition: hash.cc:272
unsigned int HASHHASH(const void *, unsigned int)
Definition: hash.h:14
int hash_delete_link(hash_table *, hash_link *)
Definition: hash.c:299
SQUIDCEXTERN HASHHASH hash_string
Definition: hash.h:45
int hash_unlink(hash_table *, hash_link *, int)
Definition: hash.c:268
HASHCMP * cmp
Definition: hash.h:24
SQUIDCEXTERN void hash_join(hash_table *, hash_link *)
Definition: hash.cc:132
unsigned int current_slot
Definition: hash.h:27
hash_link * current_ptr
Definition: hash.h:28
HASHHASH hash_url
Definition: hash.h:49
SQUIDCEXTERN hash_link * hash_lookup(hash_table *, const void *)
Definition: hash.cc:147
SQUIDCEXTERN hash_link * hash_get_bucket(hash_table *, unsigned int)
Definition: hash.cc:248
SQUIDCEXTERN hash_table * hash_create(HASHCMP *, int, HASHHASH *)
Definition: hash.cc:109
int hash_links_allocated
void hash_insert(hash_table *, const char *, void *)
Definition: hash.c:158
SQUIDCEXTERN hash_link * hash_next(hash_table *)
Definition: hash.cc:192
int valid
Definition: hash.h:22
unsigned int size
Definition: hash.h:26
SQUIDCEXTERN void hash_remove_link(hash_table *, hash_link *)
Definition: hash.cc:224
hash_link ** buckets
Definition: hash.h:23
SQUIDCEXTERN HASHHASH hash4
Definition: hash.h:46
int hash_delete(hash_table *, const char *)
Definition: hash.c:255
HASHHASH * hash
Definition: hash.h:25
int HASHCMP(const void *, const void *)
Definition: hash.h:13

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors