Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros Groups
Functions
n_hash.c File Reference
`#include "n_hash.h"`
Include dependency graph for n_hash.c:

Go to the source code of this file.

## Functions

FORCE_INLINE uint32_t | getblock (const uint32_t *p, int i)
| Block read - (from murmur's author) if your platform needs to do endian-swapping or can only handle aligned reads, do the conversion here. More...
FORCE_INLINE uint32_t | fmix32 (uint32_t h)
| Finalization mix - force all bits of a hash block to avalanche (from murmur's author) More...
FORCE_INLINE uint64_t | fmix64 (uint64_t k)
| Finalization mix - force all bits of a hash block to avalanche, 64bit version (from murmur's author) More...
void | MurmurHash3_x86_32 (const void *key, int len, uint32_t seed, void *out)
void | MurmurHash3_x86_128 (const void *key, const int len, uint32_t seed, void *out)
char * | ht_node_type (HASH_NODE *node)
| get the type of a node , text version More...
HASH_TABLE * | new_ht (int size)
| Create a hash table with the given size. More...
int | ht_put_int (HASH_TABLE *table, char *key, int val)
| put an integral value with given key in the targeted hash table More...
int | ht_put_double (HASH_TABLE *table, char *key, double val)
| put a double value with given key in the targeted hash table More...
int | ht_put_ptr (HASH_TABLE *table, char *key, void *val, void(*destructor)(void *ptr))
| put a pointer value with given key in the targeted hash table More...
int | ht_put_string (HASH_TABLE *table, char *key, char *val)
| put a null terminated char *string with given key in the targeted hash table More...
HASH_NODE * | ht_get_node (HASH_TABLE *table, char *key)
| return the associated key's node inside the hash_table More...
int | ht_get_int (HASH_TABLE *table, char *key, int *val)
| Retrieve an integral value in the hash table, at the given key. Leave val untouched if key is not found. More...
int | ht_get_double (HASH_TABLE *table, char *key, double *val)
| Retrieve a double value in the hash table, at the given key. Leave val untouched if key is not found. More...
int | ht_get_ptr (HASH_TABLE *table, char *key, void **val)
| Retrieve a pointer value in the hash table, at the given key. Leave val untouched if key is not found. More...
int | ht_get_string (HASH_TABLE *table, char *key, char **val)
| Retrieve a char *string value in the hash table, at the given key. Leave val untouched if key is not found. More...
int | ht_remove (HASH_TABLE *table, char *key)
| Remove a key from a hash table. More...
int | empty_ht (HASH_TABLE *table)
| Empty a hash table. More...
int | destroy_ht (HASH_TABLE **table)
| Free and set the table to NULL. More...

## Detailed Description

Hash functions and table

Author
  Castagnier Mickael

Version
  2.0

Date
  16/03/2015

Definition in file n_hash.c.

## Function Documentation

FORCE_INLINE uint32_t fmix32 | ( | uint32_t | h | ) |

Finalization mix - force all bits of a hash block to avalanche (from murmur's author)

Parameters

  h | value

Returns
  mixed value

Definition at line 51 of file n_hash.c.

Here is the caller graph for this function:

FORCE_INLINE uint64_t fmix64 | ( | uint64_t | k | ) |

Finalization mix - force all bits of a hash block to avalanche, 64bit version (from murmur's author)

Parameters

  k | value

Returns
  mixed value

Definition at line 67 of file n_hash.c.

FORCE_INLINE uint32_t getblock | ( | const uint32_t * | p,
|  | int | i
| ) |  |

Block read - (from murmur's author) if your platform needs to do endian-swapping or can only handle aligned reads, do the conversion here.

Parameters

  p | value
  i | position

Returns
  value at position inside block

Definition at line 34 of file n_hash.c.

Here is the caller graph for this function: