Blender V2.61 - r43446
|
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 | |
GHash * | BLI_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) |
GHashIterator * | BLI_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) |
GHashPair * | BLI_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) |
A general (pointer -> pointer) hash table ADT.
Definition in file BLI_ghash.h.
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 void(* GHashValFreeFP)(void *val) |
Definition at line 43 of file BLI_ghash.h.
void BLI_ghash_free | ( | GHash * | gh, |
GHashKeyFreeFP | keyfreefp, | ||
GHashValFreeFP | valfreefp | ||
) |
Definition at line 170 of file BLI_ghash.c.
References BLI_mempool_destroy(), GHash::buckets, credits_svn_gen::e, GHash::entrypool, i, MEM_freeN(), GHash::nbuckets, GHash::nentries, Entry::next, and NULL.
Referenced by animdata_filter_remove_duplis(), applyModifier(), BIF_freeTemplates(), BIF_makeListTemplates(), BKE_icons_free(), BKE_nlastrip_validate_name(), BLI_argsFree(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_free_transdata(), build_mesh_leaf_node(), cloneRigGraph(), cloth_bvh_objcollisions_nearcheck(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), createSlideVerts(), DNA_sdna_free(), esubdivideflag(), free_curve_editNurb_keyIndex(), free_forest(), free_mesh_orco_hash(), free_pose_channels_hash(), free_scratch(), free_sss(), free_undoCurve(), freeSlideVerts(), game_copy_pose(), GPU_codegen_exit(), IMB_moviecache_free(), imb_thread_cache_exit(), imb_tile_cache_exit(), knife_cut_exec(), make_object_duplilist_real(), mesh_get_x_mirror_faces(), REEB_freeArc(), RIG_freeRigGraph(), RNA_exit(), strand_shade_cache_free(), tracks_map_free(), undoCurve_to_editCurve(), WM_menutype_free(), wm_operatortype_free(), and wpaint_make_validmap().
int BLI_ghash_haskey | ( | GHash * | gh, |
void * | key | ||
) |
Definition at line 158 of file BLI_ghash.c.
References GHash::buckets, GHash::cmpfp, credits_svn_gen::e, hash, GHash::hashfp, Entry::key, GHash::nbuckets, and Entry::next.
Referenced by animdata_filter_remove_duplis(), applyModifier(), BLO_blendhandle_get_linkable_groups(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), esubdivideflag(), map_insert_vert(), nla_editbone_name_check(), RIG_reconnectControlBones(), and wpaint_make_validmap().
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 | ||
) |
Definition at line 115 of file BLI_ghash.c.
References GHash::buckets, GHash::cmpfp, credits_svn_gen::e, hash, GHash::hashfp, Entry::key, GHash::nbuckets, Entry::next, NULL, and Entry::val.
Referenced by applyModifier(), BIF_setTemplate(), BKE_icon_changed(), BKE_icon_get(), BKE_icon_set(), BLI_pbvh_get_grid_updates(), BME_assign_transdata(), BME_get_transdata(), ccd_build_deflector_hash(), ccd_update_deflector_hash(), cloneArc(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), createSlideVerts(), dag_find_node(), DNA_struct_find_nr(), doEdgeSlide(), fill_quad_double_adj_fan(), fill_quad_double_adj_inner(), fill_quad_double_adj_path(), fill_quad_double_op(), fill_quad_quadruple(), fill_quad_single(), fill_quad_singlevert(), fill_quad_triple(), fill_tri_double(), fill_tri_single(), fill_tri_triple(), freeSlideVerts(), game_copy_pose(), get_next_free_id(), get_object_orco(), get_pose_channel(), getCVKeyIndex(), GPU_build_mesh_buffers(), GPU_lookup_function(), imb_global_cache_get_tile(), IMB_moviecache_get(), imb_thread_cache_get_tile(), imb_tile_cache_tile_free(), lookUp(), make_object_duplilist_real(), map_insert_vert(), mesh_get_x_mirror_faces(), RIG_reconnectControlBones(), sample_sss(), seg_intersect(), sss_pass_done(), strand_shade_get(), strand_shade_refcount(), strand_shade_unref(), tracks_map_merge(), WM_menutype_find(), WM_operatortype_find(), and wpaint_make_validmap().
GHash* BLI_ghash_new | ( | GHashHashFP | hashfp, |
GHashCmpFP | cmpfp, | ||
const char * | info | ||
) |
Definition at line 59 of file BLI_ghash.c.
References BLI_mempool_create(), GHash::buckets, GHash::cmpfp, GHash::cursize, GHash::entrypool, FALSE, GHash::hashfp, hashsizes, MEM_mallocN(), GHash::nbuckets, and GHash::nentries.
Referenced by animdata_filter_remove_duplis(), applyModifier(), BIF_makeListTemplates(), BKE_icons_init(), BKE_nlastrip_validate_name(), BLI_argsInit(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_init_transdata(), build_mesh_leaf_node(), cloneRigGraph(), cloth_bvh_objcollisions_nearcheck(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), copyArc(), createArc(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), esubdivideflag(), game_copy_pose(), get_object_orco(), GPU_lookup_function(), IMB_moviecache_create(), imb_thread_cache_init(), IMB_tile_cache_params(), init_editNurb_keyIndex(), init_structDNA(), knife_cut_exec(), make_object_duplilist_real(), make_pose_channels_hash(), make_sss_tree(), mesh_get_x_mirror_faces(), newRigGraph(), RNA_init(), sb_new_scratch(), set_object_orco(), strand_shade_cache_create(), tracks_map_new(), WM_menutype_init(), wm_operatortype_init(), and wpaint_make_validmap().
int BLI_ghash_remove | ( | GHash * | gh, |
void * | key, | ||
GHashKeyFreeFP | keyfreefp, | ||
GHashValFreeFP | valfreefp | ||
) |
Definition at line 128 of file BLI_ghash.c.
References BLI_mempool_free(), GHash::buckets, GHash::cmpfp, credits_svn_gen::e, GHash::entrypool, hash, GHash::hashfp, Entry::key, GHash::nbuckets, GHash::nentries, Entry::next, NULL, p, and Entry::val.
Referenced by BKE_icon_delete(), check_unused_keys(), createSlideVerts(), ED_armature_bone_rename(), imb_global_cache_get_tile(), IMB_moviecache_put(), imb_thread_cache_get_tile(), imb_tile_cache_tile_free(), keyIndex_delCV(), keyIndex_delNurb(), keyIndex_swap(), keyIndex_updateCV(), strand_shade_get(), strand_shade_unref(), tracks_map_merge(), WM_menutype_freelink(), WM_operatortype_remove(), and wpaint_make_validmap().
int BLI_ghash_size | ( | GHash * | gh | ) |
Definition at line 76 of file BLI_ghash.c.
References GHash::nentries.
Referenced by applyModifier(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), filterSmartReebGraph(), IMB_moviecache_get_cache_segments(), REEB_exportGraph(), verifyFaces(), and wpaint_make_validmap().
void BLI_ghashIterator_free | ( | GHashIterator * | ghi | ) |
Free a GHashIterator.
ghi | The iterator to free. |
Definition at line 225 of file BLI_ghash.c.
References MEM_freeN().
Referenced by applyModifier(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), check_unused_keys(), dupli_keyIndexHash(), free_sss(), IMB_moviecache_get_cache_segments(), operator_search_cb(), pyop_dir(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), and WM_menutype_free().
void* BLI_ghashIterator_getKey | ( | GHashIterator * | ghi | ) |
Retrieve the key from an iterator.
ghi | The iterator. |
Definition at line 230 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(), check_unused_keys(), dupli_keyIndexHash(), IMB_moviecache_get_cache_segments(), 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 | ) |
Retrieve the value from an iterator.
ghi | The iterator. |
Definition at line 234 of file BLI_ghash.c.
References GHashIterator::curEntry, NULL, and Entry::val.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), build_mesh_leaf_node(), check_unused_keys(), dupli_keyIndexHash(), filterSmartReebGraph(), free_sss(), IMB_moviecache_get_cache_segments(), mergeArcFaces(), operator_search_cb(), pyop_dir(), RIG_reconnectControlBones(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), and WM_menutype_free().
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.
ghi | The GHashIterator to initialize. |
gh | The 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 | ) |
Determine if an iterator is done (has reached the end of the hash table).
ghi | The iterator. |
Definition at line 251 of file BLI_ghash.c.
References GHashIterator::curEntry.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), check_unused_keys(), dupli_keyIndexHash(), filterSmartReebGraph(), free_sss(), IMB_moviecache_get_cache_segments(), mergeArcFaces(), operator_search_cb(), pyop_dir(), RIG_reconnectControlBones(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), and WM_menutype_free().
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.
gh | The GHash to iterate over. |
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 | ) |
Steps the iterator to the next index.
ghi | The iterator. |
Definition at line 239 of file BLI_ghash.c.
References GHash::buckets, GHashIterator::curBucket, GHashIterator::curEntry, GHashIterator::gh, GHash::nbuckets, and Entry::next.
Referenced by applyModifier(), BIF_currentTemplate(), BIF_listTemplates(), BLI_pbvh_get_grid_updates(), build_mesh_leaf_node(), check_unused_keys(), dupli_keyIndexHash(), filterSmartReebGraph(), free_sss(), IMB_moviecache_get_cache_segments(), mergeArcFaces(), operator_search_cb(), pyop_dir(), RIG_reconnectControlBones(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), and WM_menutype_free().
int BLI_ghashutil_intcmp | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 284 of file BLI_ghash.c.
Referenced by applyModifier(), BIF_makeListTemplates(), BKE_icons_init(), BLI_ghashutil_paircmp(), build_mesh_leaf_node(), and keycmp().
unsigned int BLI_ghashutil_inthash | ( | const void * | ptr | ) |
Definition at line 270 of file BLI_ghash.c.
Referenced by applyModifier(), BIF_makeListTemplates(), BKE_icons_init(), BLI_ghashutil_pairhash(), and build_mesh_leaf_node().
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 | ||
) |
Definition at line 323 of file BLI_ghash.c.
References A, B, BLI_ghashutil_intcmp(), BLI_ghashutil_ptrcmp(), GHashPair::first, GHashPair::second, and SET_INT_IN_POINTER.
Referenced by make_object_duplilist_real().
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 | ) |
Definition at line 316 of file BLI_ghash.c.
References BLI_ghashutil_inthash(), BLI_ghashutil_ptrhash(), GHashPair::first, hash, GHashPair::second, and SET_INT_IN_POINTER.
Referenced by make_object_duplilist_real().
int BLI_ghashutil_ptrcmp | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 262 of file BLI_ghash.c.
Referenced by animdata_filter_remove_duplis(), BLI_ghashutil_paircmp(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_init_transdata(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), copyArc(), createArc(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), esubdivideflag(), game_copy_pose(), get_object_orco(), init_editNurb_keyIndex(), knife_cut_exec(), make_object_duplilist_real(), make_sss_tree(), sb_new_scratch(), set_object_orco(), strand_shade_cache_create(), and tracks_map_new().
unsigned int BLI_ghashutil_ptrhash | ( | const void * | key | ) |
Definition at line 258 of file BLI_ghash.c.
Referenced by animdata_filter_remove_duplis(), BLI_ghashutil_pairhash(), BLI_pbvh_get_grid_updates(), BLO_blendhandle_get_linkable_groups(), BME_init_transdata(), cloneRigGraph(), codegen_set_unique_ids(), ConvertCSGDescriptorsToDerivedMesh(), copyArc(), createArc(), createSlideVerts(), dag_add_node(), dupli_keyIndexHash(), esubdivideflag(), game_copy_pose(), get_object_orco(), init_editNurb_keyIndex(), knife_cut_exec(), make_object_duplilist_real(), make_sss_tree(), sb_new_scratch(), set_object_orco(), strand_shade_cache_create(), and tracks_map_new().
int BLI_ghashutil_strcmp | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 303 of file BLI_ghash.c.
Referenced by applyModifier(), BKE_nlastrip_validate_name(), GPU_lookup_function(), init_structDNA(), make_pose_channels_hash(), newRigGraph(), RNA_init(), WM_menutype_init(), wm_operatortype_init(), and wpaint_make_validmap().
unsigned int BLI_ghashutil_strhash | ( | const void * | key | ) |
Definition at line 292 of file BLI_ghash.c.
References i.
Referenced by applyModifier(), BKE_nlastrip_validate_name(), GPU_lookup_function(), init_structDNA(), make_pose_channels_hash(), newRigGraph(), RNA_init(), ui_popup_menu_hash(), ui_popup_string_hash(), WM_menutype_init(), wm_operatortype_init(), and wpaint_make_validmap().