diff options
author | jani@a88-113-38-195.elisa-laajakaista.fi <> | 2007-05-24 13:24:36 +0300 |
---|---|---|
committer | jani@a88-113-38-195.elisa-laajakaista.fi <> | 2007-05-24 13:24:36 +0300 |
commit | fc3b3a0a864fd142f65bbd5ff611d2f09041a258 (patch) | |
tree | 94027c861a0c3fd6ad62c4bee7ae5f7b1088f056 /include/hash.h | |
parent | 2ff938d21c596d1769076d2703b22120d2cf8336 (diff) | |
parent | 088e2395f1833f16c2ea3f7405f604165b4aa2cc (diff) | |
download | mariadb-git-fc3b3a0a864fd142f65bbd5ff611d2f09041a258.tar.gz |
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
Diffstat (limited to 'include/hash.h')
-rw-r--r-- | include/hash.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/include/hash.h b/include/hash.h index 78499a4f810..d924e62a0ec 100644 --- a/include/hash.h +++ b/include/hash.h @@ -30,12 +30,13 @@ extern "C" { /* flags for hash_init */ #define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */ -typedef byte *(*hash_get_key)(const byte *,uint*,my_bool); +typedef uchar *(*hash_get_key)(const uchar *,size_t*,my_bool); typedef void (*hash_free_key)(void *); typedef struct st_hash { - uint key_offset,key_length; /* Length of key if const length */ - uint records, blength; + size_t key_offset,key_length; /* Length of key if const length */ + size_t blength; + ulong records; uint flags; DYNAMIC_ARRAY array; /* Place for hash_keys */ hash_get_key get_key; @@ -48,21 +49,21 @@ typedef uint HASH_SEARCH_STATE; #define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,B,C,D,E,F,G, H CALLER_INFO) my_bool _hash_init(HASH *hash, CHARSET_INFO *charset, - uint default_array_elements, uint key_offset, - uint key_length, hash_get_key get_key, + ulong default_array_elements, size_t key_offset, + size_t key_length, hash_get_key get_key, void (*free_element)(void*), uint flags CALLER_INFO_PROTO); void hash_free(HASH *tree); void my_hash_reset(HASH *hash); -byte *hash_element(HASH *hash,uint idx); -gptr hash_search(const HASH *info, const byte *key, uint length); -gptr hash_first(const HASH *info, const byte *key, uint length, +uchar *hash_element(HASH *hash,ulong idx); +uchar *hash_search(const HASH *info, const uchar *key, size_t length); +uchar *hash_first(const HASH *info, const uchar *key, size_t length, HASH_SEARCH_STATE *state); -gptr hash_next(const HASH *info, const byte *key, uint length, - HASH_SEARCH_STATE *state); -my_bool my_hash_insert(HASH *info,const byte *data); -my_bool hash_delete(HASH *hash,byte *record); -my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length); -void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, byte *new_row); +uchar *hash_next(const HASH *info, const uchar *key, size_t length, + HASH_SEARCH_STATE *state); +my_bool my_hash_insert(HASH *info,const uchar *data); +my_bool hash_delete(HASH *hash,uchar *record); +my_bool hash_update(HASH *hash,uchar *record,uchar *old_key,size_t old_key_length); +void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row); my_bool hash_check(HASH *hash); /* Only in debug library */ #define hash_clear(H) bzero((char*) (H),sizeof(*(H))) |