Blender V2.61 - r43446
Classes | Typedefs | Functions

BLI_ghash.h File Reference

A general (pointer -> pointer) hash table ADT. More...

Go to the source code of this file.

Classes

struct  Entry
struct  GHash
struct  GHashIterator
struct  GHashPair

Typedefs

typedef unsigned int(* GHashHashFP )(const void *key)
typedef int(* GHashCmpFP )(const void *a, const void *b)
typedef void(* GHashKeyFreeFP )(void *key)
typedef void(* GHashValFreeFP )(void *val)
typedef struct Entry Entry
typedef struct GHash GHash
typedef struct GHashIterator GHashIterator
typedef struct GHashPair GHashPair

Functions

GHashBLI_ghash_new (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info)
void BLI_ghash_free (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghash_insert (GHash *gh, void *key, void *val)
void * BLI_ghash_lookup (GHash *gh, const void *key)
int BLI_ghash_remove (GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
int BLI_ghash_haskey (GHash *gh, void *key)
int BLI_ghash_size (GHash *gh)
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_strhash (const void *key)
int BLI_ghashutil_strcmp (const void *a, const void *b)
unsigned int BLI_ghashutil_inthash (const void *ptr)
int BLI_ghashutil_intcmp (const void *a, const void *b)
GHashPairBLI_ghashutil_pairalloc (const void *first, int second)
unsigned int BLI_ghashutil_pairhash (const void *ptr)
int BLI_ghashutil_paircmp (const void *a, const void *b)
void BLI_ghashutil_pairfree (void *ptr)

Detailed Description

A general (pointer -> pointer) hash table ADT.

Definition in file BLI_ghash.h.


Typedef Documentation

typedef struct Entry Entry
typedef struct GHash GHash
typedef int(* GHashCmpFP)(const void *a, const void *b)

Definition at line 41 of file BLI_ghash.h.

typedef unsigned int(* GHashHashFP)(const void *key)

Definition at line 40 of file BLI_ghash.h.

typedef struct GHashIterator GHashIterator
typedef void(* GHashKeyFreeFP)(void *key)

Definition at line 42 of file BLI_ghash.h.

typedef struct GHashPair GHashPair
typedef void(* GHashValFreeFP)(void *val)

Definition at line 43 of file BLI_ghash.h.


Function Documentation

void BLI_ghash_free ( GHash gh,
GHashKeyFreeFP  keyfreefp,
GHashValFreeFP  valfreefp 
)
int BLI_ghash_haskey ( GHash gh,
void *  key 
)
void BLI_ghash_insert ( GHash gh,
void *  key,
void *  val 
)

Definition at line 81 of file BLI_ghash.c.

References BLI_mempool_alloc(), GHash::buckets, GHash::cursize, credits_svn_gen::e, GHash::entrypool, hash, GHash::hashfp, hashsizes, i, Entry::key, MEM_freeN(), MEM_mallocN(), GHash::nbuckets, GHash::nentries, Entry::next, simple_enum_gen::val, and Entry::val.

Referenced by addFacetoArc(), animdata_filter_remove_duplis(), applyModifier(), BIF_makeListTemplates(), BKE_icon_getid(), BKE_icon_set(), BKE_nlastrip_validate_name(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_assign_transdata(), ccd_build_deflector_hash(), cloneArc(), cloneControl(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), ED_armature_bone_rename(), esubdivideflag(), game_copy_pose(), get_object_orco(), gpu_parse_functions_string(), imb_global_cache_get_tile(), IMB_moviecache_put(), imb_thread_cache_get_tile(), init_editNurb_keyIndex(), init_structDNA(), internalAdd(), keyIndex_swap(), keyIndex_updateCV(), knife_cut_exec(), make_object_duplilist_real(), make_pose_channels_hash(), map_insert_vert(), mergeArcFaces(), mesh_get_x_mirror_faces(), RIG_addControlBone(), RIG_arcFromBoneChain(), RNA_def_property(), RNA_init(), set_object_orco(), sss_create_tree_mat(), strand_shade_get(), strand_shade_refcount(), tracks_map_insert(), tracks_map_merge(), WM_menutype_add(), WM_operatortype_append(), WM_operatortype_append_macro(), WM_operatortype_append_macro_ptr(), WM_operatortype_append_ptr(), and wpaint_make_validmap().

void* BLI_ghash_lookup ( GHash gh,
const void *  key 
)
GHash* BLI_ghash_new ( GHashHashFP  hashfp,
GHashCmpFP  cmpfp,
const char *  info 
)
int BLI_ghash_remove ( GHash gh,
void *  key,
GHashKeyFreeFP  keyfreefp,
GHashValFreeFP  valfreefp 
)
int BLI_ghash_size ( GHash gh)
void BLI_ghashIterator_free ( GHashIterator ghi)
void* BLI_ghashIterator_getKey ( GHashIterator ghi)
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 213 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 199 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(), check_unused_keys(), dupli_keyIndexHash(), free_sss(), IMB_moviecache_get_cache_segments(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), 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)
GHashPair* BLI_ghashutil_pairalloc ( const void *  first,
int  second 
)

Definition at line 308 of file BLI_ghash.c.

References GHashPair::first, MEM_mallocN(), and GHashPair::second.

Referenced by make_object_duplilist_real().

int BLI_ghashutil_paircmp ( const void *  a,
const void *  b 
)
void BLI_ghashutil_pairfree ( void *  ptr)

Definition at line 334 of file BLI_ghash.c.

References MEM_freeN().

Referenced by make_object_duplilist_real().

unsigned int BLI_ghashutil_pairhash ( 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 *  key)