summaryrefslogtreecommitdiffstats
path: root/libass/ass_cache.h
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-20 23:00:30 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-20 23:00:30 +0000
commitb75201782a04de81810ac34c133ae91bffd587a8 (patch)
tree5da605116a12f0064cca6af81a216818f9518707 /libass/ass_cache.h
parentd9a142a827487c9ce22e299bbd3dc3634b82113c (diff)
downloadlibass-b75201782a04de81810ac34c133ae91bffd587a8.tar.bz2
libass-b75201782a04de81810ac34c133ae91bffd587a8.tar.xz
Add generic hash map implementation.
Reimplement both font cache and glyph cache on top of it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23034 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass/ass_cache.h')
-rw-r--r--libass/ass_cache.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h
index a4a5bf4..8e07457 100644
--- a/libass/ass_cache.h
+++ b/libass/ass_cache.h
@@ -58,5 +58,17 @@ glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key);
void ass_glyph_cache_reset(void);
void ass_glyph_cache_done(void);
+typedef struct hashmap_s hashmap_t;
+typedef void (*hashmap_item_dtor_t)(void* key, size_t key_size, void* value, size_t value_size);
+typedef int (*hashmap_key_compare_t)(void* key1, void* key2, size_t key_size);
+typedef unsigned (*hashmap_hash_t)(void* key, size_t key_size);
+
+hashmap_t* hashmap_init(size_t key_size, size_t value_size, int nbuckets,
+ hashmap_item_dtor_t item_dtor, hashmap_key_compare_t key_compare,
+ hashmap_hash_t hash);
+void hashmap_done(hashmap_t* map);
+void hashmap_insert(hashmap_t* map, void* key, void* value);
+void* hashmap_find(hashmap_t* map, void* key);
+
#endif