39 #define HASH_MULTIPLIER 33
40 #define HASH_START 5381
43 #define HASH_MAX_FILL .75
44 #define HASH_MIN_FILL .01
47 #define HASH_MIN_SIZE 256
48 #define HASH_MAX_SIZE 0x80000000ul
119 entry->next = new_table[new_index];
120 new_table[new_index] =
entry;
128 hash->
table = new_table;
224 if (
entry->hash_value == hash_value && strcmp((
const char *)
name, (
const char *)
entry->
name) == 0) {
243 entry->hash_value = hash_value;
244 entry->orig_index = -1;
279 if (
entry->hash_value == hash_value && strcmp((
const char *)
name, (
const char *)
entry->
name) == 0) {
280 if (
entry->orig_index == -1) {
296 entry->current_index = -1;
325 if (strcmp((
const char *)
name, (
const char *)
entry->
name) == 0) {
327 if (
entry->orig_index != -1) {
328 return entry->orig_index;
332 if (
entry->current_index != -1) {
333 return entry->current_index;
356 if (new_size <= hash->table_size) {
377 if (
entry->orig_index == -1) {
RZ_API void Ht_() free(HtName_(Ht) *ht)
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
static struct sockaddr static addrlen static backlog const void static flags void flags
zip_int64_t current_index
struct zip_hash_entry * next
zip_hash_entry_t ** table
void error(const char *msg)
bool _zip_hash_revert(zip_hash_t *hash, zip_error_t *error)
static zip_uint32_t hash_string(const zip_uint8_t *name)
bool _zip_hash_delete(zip_hash_t *hash, const zip_uint8_t *name, zip_error_t *error)
zip_int64_t _zip_hash_lookup(zip_hash_t *hash, const zip_uint8_t *name, zip_flags_t flags, zip_error_t *error)
static bool hash_resize(zip_hash_t *hash, zip_uint32_t new_size, zip_error_t *error)
static void free_list(zip_hash_entry_t *entry)
bool _zip_hash_reserve_capacity(zip_hash_t *hash, zip_uint64_t capacity, zip_error_t *error)
bool _zip_hash_add(zip_hash_t *hash, const zip_uint8_t *name, zip_uint64_t index, zip_flags_t flags, zip_error_t *error)
zip_hash_t * _zip_hash_new(zip_error_t *error)
static zip_uint32_t size_for_capacity(zip_uint64_t capacity)
void _zip_hash_free(zip_hash_t *hash)