Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | zip_hash_entry |
struct | zip_hash |
Macros | |
#define | HASH_MULTIPLIER 33 |
#define | HASH_START 5381 |
#define | HASH_MAX_FILL .75 |
#define | HASH_MIN_FILL .01 |
#define | HASH_MIN_SIZE 256 |
#define | HASH_MAX_SIZE 0x80000000ul |
Typedefs | |
typedef struct zip_hash_entry | zip_hash_entry_t |
Functions | |
static void | free_list (zip_hash_entry_t *entry) |
static zip_uint32_t | hash_string (const zip_uint8_t *name) |
static bool | hash_resize (zip_hash_t *hash, zip_uint32_t new_size, zip_error_t *error) |
static zip_uint32_t | size_for_capacity (zip_uint64_t capacity) |
zip_hash_t * | _zip_hash_new (zip_error_t *error) |
void | _zip_hash_free (zip_hash_t *hash) |
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) |
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) |
bool | _zip_hash_reserve_capacity (zip_hash_t *hash, zip_uint64_t capacity, zip_error_t *error) |
bool | _zip_hash_revert (zip_hash_t *hash, zip_error_t *error) |
#define HASH_MAX_FILL .75 |
Definition at line 43 of file zip_hash.c.
#define HASH_MAX_SIZE 0x80000000ul |
Definition at line 48 of file zip_hash.c.
#define HASH_MIN_FILL .01 |
Definition at line 44 of file zip_hash.c.
#define HASH_MIN_SIZE 256 |
Definition at line 47 of file zip_hash.c.
#define HASH_MULTIPLIER 33 |
Definition at line 39 of file zip_hash.c.
#define HASH_START 5381 |
Definition at line 40 of file zip_hash.c.
typedef struct zip_hash_entry zip_hash_entry_t |
Definition at line 1 of file zip_hash.c.
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 | ||
) |
Definition at line 205 of file zip_hash.c.
References error(), flags, HASH_MAX_FILL, HASH_MAX_SIZE, HASH_MIN_SIZE, hash_resize(), hash_string(), malloc(), name, entry::name, zip_hash::nentries, NULL, zip_hash::table, zip_hash::table_size, ZIP_ER_EXISTS, ZIP_ER_INVAL, ZIP_ER_MEMORY, zip_error_set(), ZIP_FL_UNCHANGED, and ZIP_INT64_MAX.
Referenced by _zip_open(), _zip_set_name(), and _zip_unchange().
bool _zip_hash_delete | ( | zip_hash_t * | hash, |
const zip_uint8_t * | name, | ||
zip_error_t * | error | ||
) |
Definition at line 264 of file zip_hash.c.
References error(), free(), HASH_MIN_FILL, HASH_MIN_SIZE, hash_resize(), hash_string(), entry::name, zip_hash::nentries, zip_hash_entry::next, NULL, zip_hash::table, zip_hash::table_size, ZIP_ER_INVAL, ZIP_ER_NOENT, and zip_error_set().
Referenced by _zip_set_name(), _zip_unchange(), and zip_delete().
void _zip_hash_free | ( | zip_hash_t * | hash | ) |
Definition at line 184 of file zip_hash.c.
References free(), free_list(), i, NULL, zip_hash::table, and zip_hash::table_size.
Referenced by zip_discard().
zip_int64_t _zip_hash_lookup | ( | zip_hash_t * | hash, |
const zip_uint8_t * | name, | ||
zip_flags_t | flags, | ||
zip_error_t * | error | ||
) |
Definition at line 312 of file zip_hash.c.
References error(), flags, hash_string(), entry::name, zip_hash::nentries, NULL, zip_hash::table, zip_hash::table_size, ZIP_ER_INVAL, ZIP_ER_NOENT, zip_error_set(), and ZIP_FL_UNCHANGED.
Referenced by _zip_name_locate().
zip_hash_t* _zip_hash_new | ( | zip_error_t * | error | ) |
Definition at line 167 of file zip_hash.c.
References error(), malloc(), zip_hash::nentries, NULL, zip_hash::table, zip_hash::table_size, ZIP_ER_MEMORY, and zip_error_set().
Referenced by _zip_new().
bool _zip_hash_reserve_capacity | ( | zip_hash_t * | hash, |
zip_uint64_t | capacity, | ||
zip_error_t * | error | ||
) |
Definition at line 347 of file zip_hash.c.
References error(), hash_resize(), and size_for_capacity().
Referenced by _zip_open().
bool _zip_hash_revert | ( | zip_hash_t * | hash, |
zip_error_t * | error | ||
) |
Definition at line 369 of file zip_hash.c.
References error(), free(), HASH_MIN_FILL, HASH_MIN_SIZE, hash_resize(), i, zip_hash::nentries, zip_hash_entry::next, NULL, p, zip_hash::table, and zip_hash::table_size.
Referenced by zip_unchange_all().
|
static |
|
static |
Definition at line 97 of file zip_hash.c.
References calloc(), error(), free(), i, zip_hash::nentries, NULL, zip_hash::table, zip_hash::table_size, ZIP_ER_MEMORY, and zip_error_set().
Referenced by _zip_hash_add(), _zip_hash_delete(), _zip_hash_reserve_capacity(), and _zip_hash_revert().
|
static |
Definition at line 79 of file zip_hash.c.
References HASH_MULTIPLIER, HASH_START, NULL, and value.
Referenced by _zip_hash_add(), _zip_hash_delete(), and _zip_hash_lookup().
|
static |
Definition at line 136 of file zip_hash.c.
References HASH_MAX_FILL, HASH_MAX_SIZE, v, and ZIP_UINT32_MAX.
Referenced by _zip_hash_reserve_capacity().