diff options
Diffstat (limited to 'include/lf.h')
-rw-r--r-- | include/lf.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/lf.h b/include/lf.h index 27de5653db9..c37b7ebf567 100644 --- a/include/lf.h +++ b/include/lf.h @@ -130,22 +130,26 @@ C_MODE_END C_MODE_START +typedef struct st_lf_hash LF_HASH; +typedef void (*lf_hash_initializer)(LF_HASH *hash, void *dst, const void *src); + #define LF_HASH_UNIQUE 1 /* lf_hash overhead per element (that is, sizeof(LF_SLIST) */ extern const int LF_HASH_OVERHEAD; -typedef struct { +struct st_lf_hash { LF_DYNARRAY array; /* hash itself */ LF_ALLOCATOR alloc; /* allocator for elements */ my_hash_get_key get_key; /* see HASH */ + lf_hash_initializer initializer; /* called when an element is inserted */ CHARSET_INFO *charset; /* see HASH */ uint key_offset, key_length; /* see HASH */ uint element_size; /* size of memcpy'ed area on insert */ uint flags; /* LF_HASH_UNIQUE, etc */ int32 volatile size; /* size of array */ int32 volatile count; /* number of elements in the hash */ -} LF_HASH; +}; void lf_hash_init(LF_HASH *hash, uint element_size, uint flags, uint key_offset, uint key_length, my_hash_get_key get_key, |