Blender  V2.59
Functions | Variables
BLI_ghash.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLO_sys_types.h"

Go to the source code of this file.

Functions

GHashBLI_ghash_new (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info)
int BLI_ghash_size (GHash *gh)
void BLI_ghash_free (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHashIteratorBLI_ghashIterator_new (GHash *gh)
void BLI_ghashIterator_init (GHashIterator *ghi, GHash *gh)
void BLI_ghashIterator_free (GHashIterator *ghi)
void * BLI_ghashIterator_getKey (GHashIterator *ghi)
void * BLI_ghashIterator_getValue (GHashIterator *ghi)
void BLI_ghashIterator_step (GHashIterator *ghi)
int BLI_ghashIterator_isDone (GHashIterator *ghi)
unsigned int BLI_ghashutil_ptrhash (const void *key)
int BLI_ghashutil_ptrcmp (const void *a, const void *b)
unsigned int BLI_ghashutil_inthash (const void *ptr)
int BLI_ghashutil_intcmp (const void *a, const void *b)
unsigned int BLI_ghashutil_strhash (const void *ptr)
int BLI_ghashutil_strcmp (const void *a, const void *b)

Variables

unsigned int hashsizes []

Detailed Description

Definition in file BLI_ghash.c.


Function Documentation

void BLI_ghash_free ( GHash gh,
GHashKeyFreeFP  keyfreefp,
GHashValFreeFP  valfreefp 
)
GHash* BLI_ghash_new ( GHashHashFP  hashfp,
GHashCmpFP  cmpfp,
const char *  info 
)
int BLI_ghash_size ( GHash gh)
void BLI_ghashIterator_free ( GHashIterator ghi)
void* BLI_ghashIterator_getKey ( GHashIterator ghi)

Retrieve the key from an iterator.

Parameters:
ghiThe iterator.
Returns:
The key at the current index, or NULL if the iterator is done.

Definition at line 134 of file BLI_ghash.c.

References GHashIterator::curEntry, Entry::key, and NULL.

Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), and sb_detect_vertex_collisionCached().

void* BLI_ghashIterator_getValue ( GHashIterator ghi)
void BLI_ghashIterator_init ( GHashIterator ghi,
GHash gh 
)

Init an already allocated GHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly BLI_ghash_size(gh) times before becoming done.

Parameters:
ghiThe GHashIterator to initialize.
ghThe GHash to iterate over.

Definition at line 119 of file BLI_ghash.c.

References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, GHash::nbuckets, and NULL.

Referenced by BIF_currentTemplate(), BIF_listTemplates(), filterSmartReebGraph(), mergeArcFaces(), and RIG_reconnectControlBones().

int BLI_ghashIterator_isDone ( GHashIterator ghi)
GHashIterator* BLI_ghashIterator_new ( GHash gh)

Create a new GHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly BLI_ghash_size(gh) times before becoming done.

Parameters:
ghThe GHash to iterate over.
Returns:
Pointer to a new DynStr.

Definition at line 106 of file BLI_ghash.c.

References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, MEM_mallocN(), GHash::nbuckets, and NULL.

Referenced by applyModifier(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), dupli_keyIndexHash(), free_sss(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), WM_menutype_contains(), WM_menutype_free(), and WM_operatortype_iter().

void BLI_ghashIterator_step ( GHashIterator ghi)
int BLI_ghashutil_intcmp ( const void *  a,
const void *  b 
)
unsigned int BLI_ghashutil_inthash ( const void *  ptr)
int BLI_ghashutil_ptrcmp ( const void *  a,
const void *  b 
)
unsigned int BLI_ghashutil_ptrhash ( const void *  key)
int BLI_ghashutil_strcmp ( const void *  a,
const void *  b 
)
unsigned int BLI_ghashutil_strhash ( const void *  ptr)

Variable Documentation

unsigned int hashsizes[]
Initial value:
 {
        5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 
        16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 
        4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 
        268435459
}

Definition at line 43 of file BLI_ghash.c.

Referenced by BLI_edgehash_insert(), BLI_edgehash_new(), and BLI_ghash_new().