netatalk  4.4.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
hash_t Struct Reference

#include <hash.h>

Data Fields

struct hnode_t ** hash_table
hashcount_t hash_nchains
hashcount_t hash_nodecount
hashcount_t hash_maxcount
hashcount_t hash_highmark
hashcount_t hash_lowmark
hash_comp_t hash_compare
hash_fun_t hash_function
hnode_alloc_t hash_allocnode
hnode_free_t hash_freenode
void * hash_context
hash_val_t hash_mask
int hash_dynamic

Detailed Description

This is the hash table control structure. It keeps track of information about a hash table, as well as the hash table itself. Notes:

  1. Pointer to the hash table proper. The table is an array of pointers to hash nodes (of type hnode_t). If the table is empty, every element of this table is a null pointer. A non-null entry points to the first element of a chain of nodes.
  2. This member keeps track of the size of the hash table—that is, the number of chain pointers.
  3. The count member maintains the number of elements that are presently in the hash table.
  4. The maximum count is the greatest number of nodes that can populate this table. If the table contains this many nodes, no more can be inserted, and the hash_isfull() function returns true.
  5. The high mark is a population threshold, measured as a number of nodes, which, if exceeded, will trigger a table expansion. Only dynamic hash tables are subject to this expansion.
  6. The low mark is a minimum population threshold, measured as a number of nodes. If the table population drops below this value, a table shrinkage will occur. Only dynamic tables are subject to this reduction. No table will shrink beneath a certain absolute minimum number of nodes.
  7. This is the a pointer to the hash table's comparison function. The function is set once at initialization or creation time.
  8. Pointer to the table's hashing function, set once at creation or initialization time.
  9. The current hash table mask. If the size of the hash table is 2^N, this value has its low N bits set to 1, and the others clear. It is used to select bits from the result of the hashing function to compute an index into the table.
  10. A flag which indicates whether the table is to be dynamically resized. It is set to 1 in dynamically allocated tables, 0 in tables that are statically allocated.

Field Documentation

◆ hash_allocnode

hnode_alloc_t hash_t::hash_allocnode

◆ hash_compare

hash_comp_t hash_t::hash_compare

7

◆ hash_context

void* hash_t::hash_context

◆ hash_dynamic

int hash_t::hash_dynamic

10

◆ hash_freenode

hnode_free_t hash_t::hash_freenode

◆ hash_function

hash_fun_t hash_t::hash_function

8

◆ hash_highmark

hashcount_t hash_t::hash_highmark

5

◆ hash_lowmark

hashcount_t hash_t::hash_lowmark

6

◆ hash_mask

hash_val_t hash_t::hash_mask

9

◆ hash_maxcount

hashcount_t hash_t::hash_maxcount

4

◆ hash_nchains

hashcount_t hash_t::hash_nchains

2

◆ hash_nodecount

hashcount_t hash_t::hash_nodecount

3

◆ hash_table

struct hnode_t** hash_t::hash_table

1


The documentation for this struct was generated from the following file: