1.1 --- a/src/auth/auth-cache.c Fri Dec 19 08:50:14 2008 +0200
1.2 +++ b/src/auth/auth-cache.c Fri Dec 19 09:06:38 2008 +0200
1.3 @@ -86,7 +86,7 @@
1.4 auth_cache_node_unlink(cache, node);
1.5
1.6 cache->size_left += node->alloc_size;
1.7 - hash_remove(cache->hash, node->data);
1.8 + hash_table_remove(cache->hash, node->data);
1.9 i_free(node);
1.10 }
1.11
1.12 @@ -119,8 +119,8 @@
1.13 struct auth_cache *cache;
1.14
1.15 cache = i_new(struct auth_cache, 1);
1.16 - cache->hash = hash_create(default_pool, default_pool, 0, str_hash,
1.17 - (hash_cmp_callback_t *)strcmp);
1.18 + cache->hash = hash_table_create(default_pool, default_pool, 0, str_hash,
1.19 + (hash_cmp_callback_t *)strcmp);
1.20 cache->size_left = max_size;
1.21 cache->ttl_secs = ttl_secs;
1.22 cache->neg_ttl_secs = neg_ttl_secs;
1.23 @@ -139,7 +139,7 @@
1.24 lib_signals_unset_handler(SIGUSR2, sig_auth_cache_stats, cache);
1.25
1.26 auth_cache_clear(cache);
1.27 - hash_destroy(&cache->hash);
1.28 + hash_table_destroy(&cache->hash);
1.29 i_free(cache);
1.30 }
1.31
1.32 @@ -147,7 +147,7 @@
1.33 {
1.34 while (cache->tail != NULL)
1.35 auth_cache_node_destroy(cache, cache->tail);
1.36 - hash_clear(cache->hash, FALSE);
1.37 + hash_table_clear(cache->hash, FALSE);
1.38 }
1.39
1.40 const char *
1.41 @@ -169,7 +169,7 @@
1.42 auth_request_get_var_expand_table(request,
1.43 auth_request_str_escape));
1.44
1.45 - node = hash_lookup(cache->hash, str_c(str));
1.46 + node = hash_table_lookup(cache->hash, str_c(str));
1.47 if (node == NULL) {
1.48 cache->miss_count++;
1.49 return NULL;
1.50 @@ -233,7 +233,7 @@
1.51 while (cache->size_left < alloc_size)
1.52 auth_cache_node_destroy(cache, cache->tail);
1.53
1.54 - node = hash_lookup(cache->hash, str_c(str));
1.55 + node = hash_table_lookup(cache->hash, str_c(str));
1.56 if (node != NULL) {
1.57 /* key is already in cache (probably expired), remove it */
1.58 auth_cache_node_destroy(cache, node);
1.59 @@ -250,7 +250,7 @@
1.60 auth_cache_node_link_head(cache, node);
1.61
1.62 cache->size_left -= alloc_size;
1.63 - hash_insert(cache->hash, node->data, node);
1.64 + hash_table_insert(cache->hash, node->data, node);
1.65 }
1.66
1.67 void auth_cache_remove(struct auth_cache *cache,
1.68 @@ -265,7 +265,7 @@
1.69 auth_request_get_var_expand_table(request,
1.70 auth_request_str_escape));
1.71
1.72 - node = hash_lookup(cache->hash, str_c(str));
1.73 + node = hash_table_lookup(cache->hash, str_c(str));
1.74 if (node == NULL)
1.75 return;
1.76
2.1 --- a/src/auth/auth-request-handler.c Fri Dec 19 08:50:14 2008 +0200
2.2 +++ b/src/auth/auth-request-handler.c Fri Dec 19 09:06:38 2008 +0200
2.3 @@ -52,7 +52,7 @@
2.4 handler = p_new(pool, struct auth_request_handler, 1);
2.5 handler->refcount = 1;
2.6 handler->pool = pool;
2.7 - handler->requests = hash_create(default_pool, pool, 0, NULL, NULL);
2.8 + handler->requests = hash_table_create(default_pool, pool, 0, NULL, NULL);
2.9 handler->auth = auth;
2.10 handler->callback = callback;
2.11 handler->context = context;
2.12 @@ -71,18 +71,18 @@
2.13 if (--handler->refcount > 0)
2.14 return;
2.15
2.16 - iter = hash_iterate_init(handler->requests);
2.17 - while (hash_iterate(iter, &key, &value)) {
2.18 + iter = hash_table_iterate_init(handler->requests);
2.19 + while (hash_table_iterate(iter, &key, &value)) {
2.20 struct auth_request *auth_request = value;
2.21
2.22 auth_request_unref(&auth_request);
2.23 }
2.24 - hash_iterate_deinit(&iter);
2.25 + hash_table_iterate_deinit(&iter);
2.26
2.27 /* notify parent that we're done with all requests */
2.28 handler->callback(NULL, handler->context);
2.29
2.30 - hash_destroy(&handler->requests);
2.31 + hash_table_destroy(&handler->requests);
2.32 pool_unref(&handler->pool);
2.33 }
2.34
2.35 @@ -97,7 +97,7 @@
2.36 static void auth_request_handler_remove(struct auth_request_handler *handler,
2.37 struct auth_request *request)
2.38 {
2.39 - hash_remove(handler->requests, POINTER_CAST(request->id));
2.40 + hash_table_remove(handler->requests, POINTER_CAST(request->id));
2.41 auth_request_unref(&request);
2.42 }
2.43
2.44 @@ -106,14 +106,14 @@
2.45 struct hash_iterate_context *iter;
2.46 void *key, *value;
2.47
2.48 - iter = hash_iterate_init(handler->requests);
2.49 - while (hash_iterate(iter, &key, &value)) {
2.50 + iter = hash_table_iterate_init(handler->requests);
2.51 + while (hash_table_iterate(iter, &key, &value)) {
2.52 struct auth_request *request = value;
2.53
2.54 if (request->last_access + AUTH_REQUEST_TIMEOUT < ioloop_time)
2.55 auth_request_handler_remove(handler, request);
2.56 }
2.57 - hash_iterate_deinit(&iter);
2.58 + hash_table_iterate_deinit(&iter);
2.59 }
2.60
2.61 static void get_client_extra_fields(struct auth_request *request,
2.62 @@ -352,7 +352,7 @@
2.63 return FALSE;
2.64 }
2.65
2.66 - hash_insert(handler->requests, POINTER_CAST(id), request);
2.67 + hash_table_insert(handler->requests, POINTER_CAST(id), request);
2.68
2.69 if (request->auth->ssl_require_client_cert &&
2.70 !request->valid_client_cert) {
2.71 @@ -402,7 +402,7 @@
2.72
2.73 id = (unsigned int)strtoul(args, NULL, 10);
2.74
2.75 - request = hash_lookup(handler->requests, POINTER_CAST(id));
2.76 + request = hash_table_lookup(handler->requests, POINTER_CAST(id));
2.77 if (request == NULL) {
2.78 struct auth_stream_reply *reply;
2.79
2.80 @@ -489,7 +489,7 @@
2.81
2.82 reply = auth_stream_reply_init(pool_datastack_create());
2.83
2.84 - request = hash_lookup(handler->requests, POINTER_CAST(client_id));
2.85 + request = hash_table_lookup(handler->requests, POINTER_CAST(client_id));
2.86 if (request == NULL) {
2.87 i_error("Master request %u.%u not found",
2.88 handler->client_pid, client_id);
3.1 --- a/src/auth/db-ldap.c Fri Dec 19 08:50:14 2008 +0200
3.2 +++ b/src/auth/db-ldap.c Fri Dec 19 09:06:38 2008 +0200
3.3 @@ -917,13 +917,13 @@
3.4
3.5 if (*name != '\0' &&
3.6 (skip_attr == NULL || strcmp(skip_attr, value) != 0)) {
3.7 - hash_insert(attr_map, name, value);
3.8 + hash_table_insert(attr_map, name, value);
3.9 (*attr_names_r)[j++] = name;
3.10 }
3.11 }
3.12 if (str_len(static_data) > 0) {
3.13 - hash_insert(attr_map, "",
3.14 - p_strdup(conn->pool, str_c(static_data)));
3.15 + hash_table_insert(attr_map, "",
3.16 + p_strdup(conn->pool, str_c(static_data)));
3.17 }
3.18 }
3.19
3.20 @@ -986,7 +986,7 @@
3.21 ctx->auth_request = auth_request;
3.22 ctx->attr_map = attr_map;
3.23
3.24 - static_data = hash_lookup(attr_map, "");
3.25 + static_data = hash_table_lookup(attr_map, "");
3.26 if (static_data != NULL) {
3.27 const struct var_expand_table *table;
3.28 string_t *str;
3.29 @@ -1023,7 +1023,7 @@
3.30 static void
3.31 db_ldap_result_change_attr(struct db_ldap_result_iterate_context *ctx)
3.32 {
3.33 - ctx->name = hash_lookup(ctx->attr_map, ctx->attr);
3.34 + ctx->name = hash_table_lookup(ctx->attr_map, ctx->attr);
3.35 ctx->template = NULL;
3.36
3.37 if (ctx->debug != NULL) {
3.38 @@ -1260,9 +1260,9 @@
3.39 aqueue_deinit(&conn->request_queue);
3.40
3.41 if (conn->pass_attr_map != NULL)
3.42 - hash_destroy(&conn->pass_attr_map);
3.43 + hash_table_destroy(&conn->pass_attr_map);
3.44 if (conn->user_attr_map != NULL)
3.45 - hash_destroy(&conn->user_attr_map);
3.46 + hash_table_destroy(&conn->user_attr_map);
3.47 pool_unref(&conn->pool);
3.48 }
3.49
4.1 --- a/src/auth/db-passwd-file.c Fri Dec 19 08:50:14 2008 +0200
4.2 +++ b/src/auth/db-passwd-file.c Fri Dec 19 09:06:38 2008 +0200
4.3 @@ -29,7 +29,7 @@
4.4 char *user;
4.5 size_t len;
4.6
4.7 - if (hash_lookup(pw->users, username) != NULL) {
4.8 + if (hash_table_lookup(pw->users, username) != NULL) {
4.9 i_error("passwd-file %s: User %s exists more than once",
4.10 pw->path, username);
4.11 return;
4.12 @@ -136,7 +136,7 @@
4.13 p_strsplit_spaces(pw->pool, extra_fields, " ");
4.14 }
4.15
4.16 - hash_insert(pw->users, user, pu);
4.17 + hash_table_insert(pw->users, user, pu);
4.18 }
4.19
4.20 static struct passwd_file *
4.21 @@ -150,7 +150,7 @@
4.22 pw->fd = -1;
4.23
4.24 if (db->files != NULL)
4.25 - hash_insert(db->files, pw->path, pw);
4.26 + hash_table_insert(db->files, pw->path, pw);
4.27 return pw;
4.28 }
4.29
4.30 @@ -179,8 +179,8 @@
4.31 pw->size = st.st_size;
4.32
4.33 pw->pool = pool_alloconly_create(MEMPOOL_GROWING"passwd_file", 10240);
4.34 - pw->users = hash_create(default_pool, pw->pool, 100,
4.35 - str_hash, (hash_cmp_callback_t *)strcmp);
4.36 + pw->users = hash_table_create(default_pool, pw->pool, 100,
4.37 + str_hash, (hash_cmp_callback_t *)strcmp);
4.38
4.39 input = i_stream_create_fd(pw->fd, 4096, FALSE);
4.40 i_stream_set_return_partial_line(input, TRUE);
4.41 @@ -203,7 +203,7 @@
4.42
4.43 if (pw->db->debug) {
4.44 i_info("passwd-file %s: Read %u users",
4.45 - pw->path, hash_count(pw->users));
4.46 + pw->path, hash_table_count(pw->users));
4.47 }
4.48 return TRUE;
4.49 }
4.50 @@ -217,7 +217,7 @@
4.51 }
4.52
4.53 if (pw->users != NULL)
4.54 - hash_destroy(&pw->users);
4.55 + hash_table_destroy(&pw->users);
4.56 if (pw->pool != NULL)
4.57 pool_unref(&pw->pool);
4.58 }
4.59 @@ -225,7 +225,7 @@
4.60 static void passwd_file_free(struct passwd_file *pw)
4.61 {
4.62 if (pw->db->files != NULL)
4.63 - hash_remove(pw->db->files, pw->path);
4.64 + hash_table_remove(pw->db->files, pw->path);
4.65
4.66 passwd_file_close(pw);
4.67 i_free(pw->path);
4.68 @@ -309,9 +309,9 @@
4.69
4.70 db->path = i_strdup(path);
4.71 if (db->vars) {
4.72 - db->files = hash_create(default_pool, default_pool, 100,
4.73 - str_hash,
4.74 - (hash_cmp_callback_t *)strcmp);
4.75 + db->files = hash_table_create(default_pool, default_pool, 100,
4.76 + str_hash,
4.77 + (hash_cmp_callback_t *)strcmp);
4.78 } else {
4.79 db->default_file = passwd_file_new(db, path);
4.80 }
4.81 @@ -352,14 +352,14 @@
4.82 if (db->default_file != NULL)
4.83 passwd_file_free(db->default_file);
4.84 else {
4.85 - iter = hash_iterate_init(db->files);
4.86 - while (hash_iterate(iter, &key, &value)) {
4.87 + iter = hash_table_iterate_init(db->files);
4.88 + while (hash_table_iterate(iter, &key, &value)) {
4.89 struct passwd_file *file = value;
4.90
4.91 passwd_file_free(file);
4.92 }
4.93 - hash_iterate_deinit(&iter);
4.94 - hash_destroy(&db->files);
4.95 + hash_table_iterate_deinit(&iter);
4.96 + hash_table_destroy(&db->files);
4.97 }
4.98 i_free(db->path);
4.99 i_free(db);
4.100 @@ -396,7 +396,7 @@
4.101 dest = t_str_new(256);
4.102 var_expand(dest, db->path, table);
4.103
4.104 - pw = hash_lookup(db->files, str_c(dest));
4.105 + pw = hash_table_lookup(db->files, str_c(dest));
4.106 if (pw == NULL) {
4.107 /* doesn't exist yet. create lookup for it. */
4.108 pw = passwd_file_new(db, str_c(dest));
4.109 @@ -420,7 +420,7 @@
4.110 "lookup: user=%s file=%s",
4.111 str_c(username), pw->path);
4.112
4.113 - pu = hash_lookup(pw->users, str_c(username));
4.114 + pu = hash_table_lookup(pw->users, str_c(username));
4.115 if (pu == NULL)
4.116 auth_request_log_info(request, "passwd-file", "unknown user");
4.117 return pu;
5.1 --- a/src/auth/otp-skey-common.c Fri Dec 19 08:50:14 2008 +0200
5.2 +++ b/src/auth/otp-skey-common.c Fri Dec 19 09:06:38 2008 +0200
5.3 @@ -20,17 +20,17 @@
5.4 if (otp_lock_table != NULL)
5.5 return;
5.6
5.7 - otp_lock_table = hash_create(system_pool, system_pool,
5.8 - 128, strcase_hash,
5.9 - (hash_cmp_callback_t *)strcasecmp);
5.10 + otp_lock_table = hash_table_create(system_pool, system_pool,
5.11 + 128, strcase_hash,
5.12 + (hash_cmp_callback_t *)strcasecmp);
5.13 }
5.14
5.15 int otp_try_lock(struct auth_request *auth_request)
5.16 {
5.17 - if (hash_lookup(otp_lock_table, auth_request->user))
5.18 + if (hash_table_lookup(otp_lock_table, auth_request->user))
5.19 return FALSE;
5.20
5.21 - hash_insert(otp_lock_table, auth_request->user, auth_request);
5.22 + hash_table_insert(otp_lock_table, auth_request->user, auth_request);
5.23
5.24 return TRUE;
5.25 }
5.26 @@ -43,7 +43,7 @@
5.27 if (!request->lock)
5.28 return;
5.29
5.30 - hash_remove(otp_lock_table, auth_request->user);
5.31 + hash_table_remove(otp_lock_table, auth_request->user);
5.32 request->lock = FALSE;
5.33 }
5.34
6.1 --- a/src/auth/passdb-checkpassword.c Fri Dec 19 08:50:14 2008 +0200
6.2 +++ b/src/auth/passdb-checkpassword.c Fri Dec 19 09:06:38 2008 +0200
6.3 @@ -25,7 +25,7 @@
6.4 verify_plain_callback_t *callback =
6.5 (verify_plain_callback_t *)request->callback;
6.6
6.7 - hash_remove(module->clients, POINTER_CAST(request->pid));
6.8 + hash_table_remove(module->clients, POINTER_CAST(request->pid));
6.9
6.10 if (result == PASSDB_RESULT_OK) {
6.11 if (strchr(str_c(request->input_buf), '\n') != NULL) {
6.12 @@ -99,7 +99,7 @@
6.13 struct checkpassword_passdb_module *module)
6.14 {
6.15 struct chkpw_auth_request *request =
6.16 - hash_lookup(module->clients, POINTER_CAST(status->pid));
6.17 + hash_table_lookup(module->clients, POINTER_CAST(status->pid));
6.18
6.19 switch (checkpassword_sigchld_handler(status, request)) {
6.20 case SIGCHLD_RESULT_UNKNOWN_CHILD:
6.21 @@ -216,7 +216,8 @@
6.22 io_add(fd_out[1], IO_WRITE, checkpassword_child_output,
6.23 chkpw_auth_request);
6.24
6.25 - hash_insert(module->clients, POINTER_CAST(pid), chkpw_auth_request);
6.26 + hash_table_insert(module->clients, POINTER_CAST(pid),
6.27 + chkpw_auth_request);
6.28
6.29 if (checkpassword_passdb_children != NULL)
6.30 child_wait_add_pid(checkpassword_passdb_children, pid);
6.31 @@ -238,7 +239,7 @@
6.32 PKG_LIBEXECDIR"/checkpassword-reply";
6.33
6.34 module->clients =
6.35 - hash_create(default_pool, default_pool, 0, NULL, NULL);
6.36 + hash_table_create(default_pool, default_pool, 0, NULL, NULL);
6.37
6.38 return &module->module;
6.39 }
6.40 @@ -250,13 +251,13 @@
6.41 struct hash_iterate_context *iter;
6.42 void *key, *value;
6.43
6.44 - iter = hash_iterate_init(module->clients);
6.45 - while (hash_iterate(iter, &key, &value)) {
6.46 + iter = hash_table_iterate_init(module->clients);
6.47 + while (hash_table_iterate(iter, &key, &value)) {
6.48 checkpassword_request_finish(value,
6.49 PASSDB_RESULT_INTERNAL_FAILURE);
6.50 }
6.51 - hash_iterate_deinit(&iter);
6.52 - hash_destroy(&module->clients);
6.53 + hash_table_iterate_deinit(&iter);
6.54 + hash_table_destroy(&module->clients);
6.55
6.56 if (checkpassword_passdb_children != NULL)
6.57 child_wait_free(&checkpassword_passdb_children);
7.1 --- a/src/auth/passdb-ldap.c Fri Dec 19 08:50:14 2008 +0200
7.2 +++ b/src/auth/passdb-ldap.c Fri Dec 19 09:06:38 2008 +0200
7.3 @@ -380,8 +380,8 @@
7.4 module = p_new(auth_passdb->auth->pool, struct ldap_passdb_module, 1);
7.5 module->conn = conn = db_ldap_init(args);
7.6 conn->pass_attr_map =
7.7 - hash_create(default_pool, conn->pool, 0, str_hash,
7.8 - (hash_cmp_callback_t *)strcmp);
7.9 + hash_table_create(default_pool, conn->pool, 0, str_hash,
7.10 + (hash_cmp_callback_t *)strcmp);
7.11
7.12 db_ldap_set_attrs(conn, conn->set.pass_attrs, &conn->pass_attr_names,
7.13 conn->pass_attr_map,
8.1 --- a/src/auth/userdb-checkpassword.c Fri Dec 19 08:50:14 2008 +0200
8.2 +++ b/src/auth/userdb-checkpassword.c Fri Dec 19 09:06:38 2008 +0200
8.3 @@ -25,7 +25,7 @@
8.4 userdb_callback_t *callback =
8.5 (userdb_callback_t *)request->callback;
8.6
8.7 - hash_remove(module->clients, POINTER_CAST(request->pid));
8.8 + hash_table_remove(module->clients, POINTER_CAST(request->pid));
8.9
8.10 if (result == USERDB_RESULT_OK) {
8.11 if (strchr(str_c(request->input_buf), '\n') != NULL) {
8.12 @@ -84,7 +84,7 @@
8.13 struct checkpassword_userdb_module *module)
8.14 {
8.15 struct chkpw_auth_request *request =
8.16 - hash_lookup(module->clients, POINTER_CAST(status->pid));
8.17 + hash_table_lookup(module->clients, POINTER_CAST(status->pid));
8.18
8.19 switch (checkpassword_sigchld_handler(status, request)) {
8.20 case SIGCHLD_RESULT_UNKNOWN_CHILD:
8.21 @@ -206,7 +206,8 @@
8.22 io_add(fd_out[1], IO_WRITE, checkpassword_child_output,
8.23 chkpw_auth_request);
8.24
8.25 - hash_insert(module->clients, POINTER_CAST(pid), chkpw_auth_request);
8.26 + hash_table_insert(module->clients, POINTER_CAST(pid),
8.27 + chkpw_auth_request);
8.28
8.29 if (checkpassword_userdb_children != NULL)
8.30 child_wait_add_pid(checkpassword_userdb_children, pid);
8.31 @@ -228,7 +229,7 @@
8.32 PKG_LIBEXECDIR"/checkpassword-reply";
8.33
8.34 module->clients =
8.35 - hash_create(default_pool, default_pool, 0, NULL, NULL);
8.36 + hash_table_create(default_pool, default_pool, 0, NULL, NULL);
8.37
8.38 return &module->module;
8.39 }
8.40 @@ -240,13 +241,13 @@
8.41 struct hash_iterate_context *iter;
8.42 void *key, *value;
8.43
8.44 - iter = hash_iterate_init(module->clients);
8.45 - while (hash_iterate(iter, &key, &value)) {
8.46 + iter = hash_table_iterate_init(module->clients);
8.47 + while (hash_table_iterate(iter, &key, &value)) {
8.48 checkpassword_request_finish(value,
8.49 USERDB_RESULT_INTERNAL_FAILURE);
8.50 }
8.51 - hash_iterate_deinit(&iter);
8.52 - hash_destroy(&module->clients);
8.53 + hash_table_iterate_deinit(&iter);
8.54 + hash_table_destroy(&module->clients);
8.55
8.56 if (checkpassword_userdb_children != NULL)
8.57 child_wait_free(&checkpassword_userdb_children);
9.1 --- a/src/auth/userdb-ldap.c Fri Dec 19 08:50:14 2008 +0200
9.2 +++ b/src/auth/userdb-ldap.c Fri Dec 19 09:06:38 2008 +0200
9.3 @@ -123,8 +123,8 @@
9.4 module = p_new(auth_userdb->auth->pool, struct ldap_userdb_module, 1);
9.5 module->conn = conn = db_ldap_init(args);
9.6 conn->user_attr_map =
9.7 - hash_create(default_pool, conn->pool, 0, str_hash,
9.8 - (hash_cmp_callback_t *)strcmp);
9.9 + hash_table_create(default_pool, conn->pool, 0, str_hash,
9.10 + (hash_cmp_callback_t *)strcmp);
9.11
9.12 db_ldap_set_attrs(conn, conn->set.user_attrs, &conn->user_attr_names,
9.13 conn->user_attr_map, NULL);
10.1 --- a/src/deliver/duplicate.c Fri Dec 19 08:50:14 2008 +0200
10.2 +++ b/src/deliver/duplicate.c Fri Dec 19 09:06:38 2008 +0200
10.3 @@ -144,14 +144,15 @@
10.4 d->user = p_strndup(file->pool,
10.5 data + hdr.id_size, hdr.user_size);
10.6 d->time = hdr.stamp;
10.7 - hash_insert(file->hash, d, d);
10.8 + hash_table_insert(file->hash, d, d);
10.9 } else {
10.10 change_count++;
10.11 }
10.12 i_stream_skip(input, hdr.id_size + hdr.user_size);
10.13 }
10.14
10.15 - if (hash_count(file->hash) * COMPRESS_PERCENTAGE / 100 > change_count)
10.16 + if (hash_table_count(file->hash) *
10.17 + COMPRESS_PERCENTAGE / 100 > change_count)
10.18 file->changed = TRUE;
10.19 return 0;
10.20 }
10.21 @@ -212,8 +213,8 @@
10.22 &file->dotlock);
10.23 if (file->new_fd == -1)
10.24 i_error("file_dotlock_create(%s) failed: %m", path);
10.25 - file->hash = hash_create(default_pool, pool, 0,
10.26 - duplicate_hash, duplicate_cmp);
10.27 + file->hash = hash_table_create(default_pool, pool, 0,
10.28 + duplicate_hash, duplicate_cmp);
10.29 (void)duplicate_read(file);
10.30 return file;
10.31 }
10.32 @@ -226,7 +227,7 @@
10.33 if (file->dotlock != NULL)
10.34 file_dotlock_delete(&file->dotlock);
10.35
10.36 - hash_destroy(&file->hash);
10.37 + hash_table_destroy(&file->hash);
10.38 pool_unref(&file->pool);
10.39 }
10.40
10.41 @@ -241,7 +242,7 @@
10.42 d.id_size = id_size;
10.43 d.user = user;
10.44
10.45 - return hash_lookup(duplicate_file->hash, &d) != NULL;
10.46 + return hash_table_lookup(duplicate_file->hash, &d) != NULL;
10.47 }
10.48
10.49 void duplicate_mark(const void *id, size_t id_size,
10.50 @@ -263,7 +264,7 @@
10.51 d->time = timestamp;
10.52
10.53 duplicate_file->changed = TRUE;
10.54 - hash_insert(duplicate_file->hash, d, d);
10.55 + hash_table_insert(duplicate_file->hash, d, d);
10.56 }
10.57
10.58 void duplicate_flush(void)
10.59 @@ -285,8 +286,8 @@
10.60 o_stream_send(output, &hdr, sizeof(hdr));
10.61
10.62 memset(&rec, 0, sizeof(rec));
10.63 - iter = hash_iterate_init(file->hash);
10.64 - while (hash_iterate(iter, &key, &value)) {
10.65 + iter = hash_table_iterate_init(file->hash);
10.66 + while (hash_table_iterate(iter, &key, &value)) {
10.67 struct duplicate *d = value;
10.68
10.69 rec.stamp = d->time;
10.70 @@ -297,7 +298,7 @@
10.71 o_stream_send(output, d->id, rec.id_size);
10.72 o_stream_send(output, d->user, rec.user_size);
10.73 }
10.74 - hash_iterate_deinit(&iter);
10.75 + hash_table_iterate_deinit(&iter);
10.76 o_stream_unref(&output);
10.77
10.78 file->changed = FALSE;
11.1 --- a/src/lib-auth/auth-server-connection.c Fri Dec 19 08:50:14 2008 +0200
11.2 +++ b/src/lib-auth/auth-server-connection.c Fri Dec 19 09:06:38 2008 +0200
11.3 @@ -248,7 +248,7 @@
11.4 conn->input = i_stream_create_fd(fd, AUTH_CLIENT_MAX_LINE_LENGTH,
11.5 FALSE);
11.6 conn->output = o_stream_create_fd(fd, (size_t)-1, FALSE);
11.7 - conn->requests = hash_create(default_pool, pool, 100, NULL, NULL);
11.8 + conn->requests = hash_table_create(default_pool, pool, 100, NULL, NULL);
11.9 conn->auth_mechs_buf = buffer_create_dynamic(default_pool, 256);
11.10
11.11 conn->to = timeout_add(AUTH_HANDSHAKE_TIMEOUT,
11.12 @@ -324,7 +324,7 @@
11.13 return;
11.14 i_assert(conn->refcount == 0);
11.15
11.16 - hash_destroy(&conn->requests);
11.17 + hash_table_destroy(&conn->requests);
11.18 buffer_free(&conn->auth_mechs_buf);
11.19
11.20 i_stream_unref(&conn->input);
12.1 --- a/src/lib-auth/auth-server-request.c Fri Dec 19 08:50:14 2008 +0200
12.2 +++ b/src/lib-auth/auth-server-request.c Fri Dec 19 09:06:38 2008 +0200
12.3 @@ -62,8 +62,8 @@
12.4 try it for the next */
12.5 request->plaintext_data = i_strdup(data);
12.6
12.7 - hash_insert(request->next_conn->requests,
12.8 - POINTER_CAST(request->id), request);
12.9 + hash_table_insert(request->next_conn->requests,
12.10 + POINTER_CAST(request->id), request);
12.11 if (auth_server_send_new_request(request->next_conn,
12.12 request, &error) == 0)
12.13 request->retrying = TRUE;
12.14 @@ -171,15 +171,17 @@
12.15
12.16 id = (unsigned int)strtoul(list[0], NULL, 10);
12.17
12.18 - request = hash_lookup(conn->requests, POINTER_CAST(id));
12.19 + request = hash_table_lookup(conn->requests, POINTER_CAST(id));
12.20 if (request == NULL) {
12.21 /* We've already destroyed the request */
12.22 return TRUE;
12.23 }
12.24
12.25 - hash_remove(request->conn->requests, POINTER_CAST(id));
12.26 - if (request->next_conn != NULL)
12.27 - hash_remove(request->next_conn->requests, POINTER_CAST(id));
12.28 + hash_table_remove(request->conn->requests, POINTER_CAST(id));
12.29 + if (request->next_conn != NULL) {
12.30 + hash_table_remove(request->next_conn->requests,
12.31 + POINTER_CAST(id));
12.32 + }
12.33 request->conn = conn;
12.34 request->next_conn = NULL;
12.35
12.36 @@ -212,7 +214,7 @@
12.37
12.38 id = (unsigned int)strtoul(args, NULL, 10);
12.39
12.40 - request = hash_lookup(conn->requests, POINTER_CAST(id));
12.41 + request = hash_table_lookup(conn->requests, POINTER_CAST(id));
12.42 if (request == NULL) {
12.43 /* We've already destroyed the request */
12.44 return TRUE;
12.45 @@ -243,13 +245,13 @@
12.46
12.47 id = (unsigned int)strtoul(list[0], NULL, 10);
12.48
12.49 - request = hash_lookup(conn->requests, POINTER_CAST(id));
12.50 + request = hash_table_lookup(conn->requests, POINTER_CAST(id));
12.51 if (request == NULL) {
12.52 /* We've already destroyed the request */
12.53 return TRUE;
12.54 }
12.55
12.56 - hash_remove(conn->requests, POINTER_CAST(request->id));
12.57 + hash_table_remove(conn->requests, POINTER_CAST(request->id));
12.58 if (request->retrying) {
12.59 next = request->next_conn == NULL ? NULL :
12.60 get_next_plain_server(request->next_conn);
12.61 @@ -265,8 +267,8 @@
12.62 }
12.63 request->conn = conn;
12.64 } else {
12.65 - hash_insert(next->requests, POINTER_CAST(request->id),
12.66 - request);
12.67 + hash_table_insert(next->requests,
12.68 + POINTER_CAST(request->id), request);
12.69 request->next_conn = next;
12.70
12.71 T_BEGIN {
12.72 @@ -307,10 +309,10 @@
12.73 struct hash_iterate_context *iter;
12.74 void *key, *value;
12.75
12.76 - iter = hash_iterate_init(conn->requests);
12.77 - while (hash_iterate(iter, &key, &value))
12.78 + iter = hash_table_iterate_init(conn->requests);
12.79 + while (hash_table_iterate(iter, &key, &value))
12.80 request_hash_remove(conn, value);
12.81 - hash_iterate_deinit(&iter);
12.82 + hash_table_iterate_deinit(&iter);
12.83 }
12.84
12.85 struct auth_request *
12.86 @@ -367,8 +369,8 @@
12.87
12.88 T_BEGIN {
12.89 if (auth_server_send_new_request(conn, request, error_r) == 0) {
12.90 - hash_insert(conn->requests, POINTER_CAST(request->id),
12.91 - request);
12.92 + hash_table_insert(conn->requests,
12.93 + POINTER_CAST(request->id), request);
12.94 } else {
12.95 auth_client_request_free(request);
12.96 request = NULL;
12.97 @@ -398,9 +400,9 @@
12.98 {
12.99 void *id = POINTER_CAST(request->id);
12.100
12.101 - hash_remove(request->conn->requests, id);
12.102 + hash_table_remove(request->conn->requests, id);
12.103 if (request->next_conn != NULL)
12.104 - hash_remove(request->next_conn->requests, id);
12.105 + hash_table_remove(request->next_conn->requests, id);
12.106
12.107 request->callback(request, -1, NULL, NULL, request->context);
12.108 auth_client_request_free(request);
13.1 --- a/src/lib-dict/dict-file.c Fri Dec 19 08:50:14 2008 +0200
13.2 +++ b/src/lib-dict/dict-file.c Fri Dec 19 09:06:38 2008 +0200
13.3 @@ -74,8 +74,8 @@
13.4 dict->dict = *driver;
13.5 dict->path = i_strdup(uri);
13.6 dict->hash_pool = pool_alloconly_create("file dict", 1024);
13.7 - dict->hash = hash_create(default_pool, dict->hash_pool, 0, str_hash,
13.8 - (hash_cmp_callback_t *)strcmp);
13.9 + dict->hash = hash_table_create(default_pool, dict->hash_pool, 0,
13.10 + str_hash, (hash_cmp_callback_t *)strcmp);
13.11 dict->fd = -1;
13.12 return &dict->dict;
13.13 }
13.14 @@ -84,7 +84,7 @@
13.15 {
13.16 struct file_dict *dict = (struct file_dict *)_dict;
13.17
13.18 - hash_destroy(&dict->hash);
13.19 + hash_table_destroy(&dict->hash);
13.20 pool_unref(&dict->hash_pool);
13.21 i_free(dict->path);
13.22 i_free(dict);
13.23 @@ -136,7 +136,7 @@
13.24 return -1;
13.25 }
13.26
13.27 - hash_clear(dict->hash, TRUE);
13.28 + hash_table_clear(dict->hash, TRUE);
13.29 p_clear(dict->hash_pool);
13.30
13.31 input = i_stream_create_fd(dict->fd, (size_t)-1, FALSE);
13.32 @@ -144,7 +144,7 @@
13.33 (value = i_stream_read_next_line(input)) != NULL) {
13.34 key = p_strdup(dict->hash_pool, key);
13.35 value = p_strdup(dict->hash_pool, value);
13.36 - hash_insert(dict->hash, key, value);
13.37 + hash_table_insert(dict->hash, key, value);
13.38 }
13.39 i_stream_destroy(&input);
13.40 return 0;
13.41 @@ -158,7 +158,7 @@
13.42 if (file_dict_refresh(dict) < 0)
13.43 return -1;
13.44
13.45 - *value_r = p_strdup(pool, hash_lookup(dict->hash, key));
13.46 + *value_r = p_strdup(pool, hash_table_lookup(dict->hash, key));
13.47 return *value_r == NULL ? 0 : 1;
13.48 }
13.49
13.50 @@ -174,7 +174,7 @@
13.51 ctx->path = i_strdup(path);
13.52 ctx->path_len = strlen(path);
13.53 ctx->flags = flags;
13.54 - ctx->iter = hash_iterate_init(dict->hash);
13.55 + ctx->iter = hash_table_iterate_init(dict->hash);
13.56
13.57 if (file_dict_refresh(dict) < 0)
13.58 ctx->failed = TRUE;
13.59 @@ -188,7 +188,7 @@
13.60 (struct file_dict_iterate_context *)_ctx;
13.61 void *key, *value;
13.62
13.63 - while (hash_iterate(ctx->iter, &key, &value)) {
13.64 + while (hash_table_iterate(ctx->iter, &key, &value)) {
13.65 if (strncmp(ctx->path, key, ctx->path_len) != 0)
13.66 continue;
13.67
13.68 @@ -208,7 +208,7 @@
13.69 struct file_dict_iterate_context *ctx =
13.70 (struct file_dict_iterate_context *)_ctx;
13.71
13.72 - hash_iterate_deinit(&ctx->iter);
13.73 + hash_table_iterate_deinit(&ctx->iter);
13.74 i_free(ctx->path);
13.75 i_free(ctx);
13.76 }
13.77 @@ -239,8 +239,8 @@
13.78
13.79 changes = array_get(&ctx->changes, &count);
13.80 for (i = 0; i < count; i++) {
13.81 - if (hash_lookup_full(dict->hash, changes[i].key,
13.82 - &orig_key, &orig_value)) {
13.83 + if (hash_table_lookup_full(dict->hash, changes[i].key,
13.84 + &orig_key, &orig_value)) {
13.85 key = orig_key;
13.86 old_value = orig_value;
13.87 } else {
13.88 @@ -270,11 +270,11 @@
13.89 value = p_strdup(dict->hash_pool,
13.90 changes[i].value.str);
13.91 }
13.92 - hash_update(dict->hash, key, value);
13.93 + hash_table_update(dict->hash, key, value);
13.94 break;
13.95 case FILE_DICT_CHANGE_TYPE_UNSET:
13.96 if (old_value != NULL)
13.97 - hash_remove(dict->hash, key);
13.98 + hash_table_remove(dict->hash, key);
13.99 break;
13.100 }
13.101 }
13.102 @@ -304,14 +304,14 @@
13.103
13.104 output = o_stream_create_fd(fd, 0, FALSE);
13.105 o_stream_cork(output);
13.106 - iter = hash_iterate_init(dict->hash);
13.107 - while (hash_iterate(iter, &key, &value)) {
13.108 + iter = hash_table_iterate_init(dict->hash);
13.109 + while (hash_table_iterate(iter, &key, &value)) {
13.110 o_stream_send_str(output, key);
13.111 o_stream_send(output, "\n", 1);
13.112 o_stream_send_str(output, value);
13.113 o_stream_send(output, "\n", 1);
13.114 }
13.115 - hash_iterate_deinit(&iter);
13.116 + hash_table_iterate_deinit(&iter);
13.117 o_stream_destroy(&output);
13.118
13.119 if (file_dotlock_replace(&dotlock,
14.1 --- a/src/lib-index/mail-cache-fields.c Fri Dec 19 08:50:14 2008 +0200
14.2 +++ b/src/lib-index/mail-cache-fields.c Fri Dec 19 09:06:38 2008 +0200
14.3 @@ -76,8 +76,9 @@
14.4
14.5 new_idx = cache->fields_count;
14.6 for (i = 0; i < fields_count; i++) {
14.7 - if (hash_lookup_full(cache->field_name_hash, fields[i].name,
14.8 - &orig_key, &orig_value)) {
14.9 + if (hash_table_lookup_full(cache->field_name_hash,
14.10 + fields[i].name,
14.11 + &orig_key, &orig_value)) {
14.12 i_assert(fields[i].type < MAIL_CACHE_FIELD_COUNT);
14.13
14.14 fields[i].idx =
14.15 @@ -128,7 +129,8 @@
14.16 if (!field_has_fixed_size(cache->fields[idx].field.type))
14.17 cache->fields[idx].field.field_size = (unsigned int)-1;
14.18
14.19 - hash_insert(cache->field_name_hash, name, POINTER_CAST(idx));
14.20 + hash_table_insert(cache->field_name_hash,
14.21 + name, POINTER_CAST(idx));
14.22 }
14.23 cache->fields_count = new_idx;
14.24 }
14.25 @@ -138,8 +140,8 @@
14.26 {
14.27 void *orig_key, *orig_value;
14.28
14.29 - if (hash_lookup_full(cache->field_name_hash, name,
14.30 - &orig_key, &orig_value))
14.31 + if (hash_table_lookup_full(cache->field_name_hash, name,
14.32 + &orig_key, &orig_value))
14.33 return POINTER_CAST_TO(orig_value, unsigned int);
14.34 else
14.35 return (unsigned int)-1;
14.36 @@ -341,8 +343,8 @@
14.37 return -1;
14.38 }
14.39
14.40 - if (hash_lookup_full(cache->field_name_hash, names,
14.41 - &orig_key, &orig_value)) {
14.42 + if (hash_table_lookup_full(cache->field_name_hash, names,
14.43 + &orig_key, &orig_value)) {
14.44 /* already exists, see if decision can be updated */
14.45 fidx = POINTER_CAST_TO(orig_value, unsigned int);
14.46 if (!cache->fields[fidx].decision_dirty) {
15.1 --- a/src/lib-index/mail-cache.c Fri Dec 19 08:50:14 2008 +0200
15.2 +++ b/src/lib-index/mail-cache.c Fri Dec 19 09:06:38 2008 +0200
15.3 @@ -409,8 +409,8 @@
15.4 i_strconcat(index->filepath, MAIL_CACHE_FILE_SUFFIX, NULL);
15.5 cache->field_pool = pool_alloconly_create("Cache fields", 1024);
15.6 cache->field_name_hash =
15.7 - hash_create(default_pool, cache->field_pool, 0,
15.8 - strcase_hash, (hash_cmp_callback_t *)strcasecmp);
15.9 + hash_table_create(default_pool, cache->field_pool, 0,
15.10 + strcase_hash, (hash_cmp_callback_t *)strcasecmp);
15.11
15.12 cache->dotlock_settings.use_excl_lock = index->use_excl_dotlocks;
15.13 cache->dotlock_settings.nfs_flush = index->nfs_flush;
15.14 @@ -478,7 +478,7 @@
15.15
15.16 mail_cache_file_close(cache);
15.17
15.18 - hash_destroy(&cache->field_name_hash);
15.19 + hash_table_destroy(&cache->field_name_hash);
15.20 pool_unref(&cache->field_pool);
15.21 i_free(cache->field_file_map);
15.22 i_free(cache->file_field_map);
16.1 --- a/src/lib-index/mail-index.c Fri Dec 19 08:50:14 2008 +0200
16.2 +++ b/src/lib-index/mail-index.c Fri Dec 19 09:06:38 2008 +0200
16.3 @@ -49,8 +49,8 @@
16.4 index->keywords_pool = pool_alloconly_create("keywords", 512);
16.5 i_array_init(&index->keywords, 16);
16.6 index->keywords_hash =
16.7 - hash_create(default_pool, index->keywords_pool, 0,
16.8 - strcase_hash, (hash_cmp_callback_t *)strcasecmp);
16.9 + hash_table_create(default_pool, index->keywords_pool, 0,
16.10 + strcase_hash, (hash_cmp_callback_t *)strcasecmp);
16.11 index->log = mail_transaction_log_alloc(index);
16.12 mail_index_modseq_init(index);
16.13 return index;
16.14 @@ -64,7 +64,7 @@
16.15 mail_index_close(index);
16.16
16.17 mail_transaction_log_free(&index->log);
16.18 - hash_destroy(&index->keywords_hash);
16.19 + hash_table_destroy(&index->keywords_hash);
16.20 pool_unref(&index->extension_pool);
16.21 pool_unref(&index->keywords_pool);
16.22
16.23 @@ -219,7 +219,8 @@
16.24 /* keywords_hash keeps a name => index mapping of keywords.
16.25 Keywords are never removed from it, so the index values are valid
16.26 for the lifetime of the mail_index. */
16.27 - if (hash_lookup_full(index->keywords_hash, keyword, NULL, &value)) {
16.28 + if (hash_table_lookup_full(index->keywords_hash, keyword,
16.29 + NULL, &value)) {
16.30 *idx_r = POINTER_CAST_TO(value, unsigned int);
16.31 return TRUE;
16.32 }
16.33 @@ -242,7 +243,8 @@
16.34 keyword = keyword_dup = p_strdup(index->keywords_pool, keyword);
16.35 *idx_r = array_count(&index->keywords);
16.36
16.37 - hash_insert(index->keywords_hash, keyword_dup, POINTER_CAST(*idx_r));
16.38 + hash_table_insert(index->keywords_hash,
16.39 + keyword_dup, POINTER_CAST(*idx_r));
16.40 array_append(&index->keywords, &keyword, 1);
16.41 }
16.42
17.1 --- a/src/lib-sql/sql-pool.c Fri Dec 19 08:50:14 2008 +0200
17.2 +++ b/src/lib-sql/sql-pool.c Fri Dec 19 09:06:38 2008 +0200
17.3 @@ -90,7 +90,7 @@
17.4 char *key;
17.5
17.6 key = i_strdup_printf("%s\t%s", db_driver, connect_string);
17.7 - db = hash_lookup(pool->dbs, key);
17.8 + db = hash_table_lookup(pool->dbs, key);
17.9 if (db != NULL) {
17.10 ctx = SQL_POOL_CONTEXT(db);
17.11 if (ctx->refcount == 0) {
17.12 @@ -110,7 +110,7 @@
17.13 db->v.deinit = sql_pool_db_deinit;
17.14
17.15 MODULE_CONTEXT_SET(db, sql_pool_module, ctx);
17.16 - hash_insert(pool->dbs, ctx->key, db);
17.17 + hash_table_insert(pool->dbs, ctx->key, db);
17.18 }
17.19
17.20 ctx->refcount++;
17.21 @@ -122,8 +122,8 @@
17.22 struct sql_pool *pool;
17.23
17.24 pool = i_new(struct sql_pool, 1);
17.25 - pool->dbs = hash_create(default_pool, default_pool, 0, str_hash,
17.26 - (hash_cmp_callback_t *)strcmp);
17.27 + pool->dbs = hash_table_create(default_pool, default_pool, 0, str_hash,
17.28 + (hash_cmp_callback_t *)strcmp);
17.29 pool->max_unused_connections = max_unused_connections;
17.30 return pool;
17.31 }
17.32 @@ -133,6 +133,6 @@
17.33 struct sql_pool *pool = *_pool;
17.34
17.35 *_pool = NULL;
17.36 - hash_destroy(&pool->dbs);
17.37 + hash_table_destroy(&pool->dbs);
17.38 i_free(pool);
17.39 }
18.1 --- a/src/lib-storage/index/dbox/dbox-sync.c Fri Dec 19 08:50:14 2008 +0200
18.2 +++ b/src/lib-storage/index/dbox/dbox-sync.c Fri Dec 19 09:06:38 2008 +0200
18.3 @@ -29,7 +29,7 @@
18.4 &file_id, &offset))
18.5 return -1;
18.6
18.7 - entry = hash_lookup(ctx->syncs, POINTER_CAST(file_id));
18.8 + entry = hash_table_lookup(ctx->syncs, POINTER_CAST(file_id));
18.9 if (entry == NULL) {
18.10 if (sync_rec->type == MAIL_INDEX_SYNC_TYPE_EXPUNGE ||
18.11 ctx->flush_dirty_flags) {
18.12 @@ -54,7 +54,7 @@
18.13
18.14 entry = p_new(ctx->pool, struct dbox_sync_file_entry, 1);
18.15 entry->file_id = file_id;
18.16 - hash_insert(ctx->syncs, POINTER_CAST(file_id), entry);
18.17 + hash_table_insert(ctx->syncs, POINTER_CAST(file_id), entry);
18.18 }
18.19 uid_file = (file_id & DBOX_FILE_ID_FLAG_UID) != 0;
18.20
18.21 @@ -205,7 +205,7 @@
18.22
18.23 /* read all changes and sort them to file_id order */
18.24 ctx->pool = pool_alloconly_create("dbox sync pool", 1024*32);
18.25 - ctx->syncs = hash_create(default_pool, ctx->pool, 0, NULL, NULL);
18.26 + ctx->syncs = hash_table_create(default_pool, ctx->pool, 0, NULL, NULL);
18.27 i_array_init(&ctx->expunge_files, 32);
18.28 i_array_init(&ctx->locked_files, 32);
18.29
18.30 @@ -225,14 +225,14 @@
18.31
18.32 if (ret > 0) {
18.33 /* now sync each file separately */
18.34 - iter = hash_iterate_init(ctx->syncs);
18.35 - while (hash_iterate(iter, &key, &value)) {
18.36 + iter = hash_table_iterate_init(ctx->syncs);
18.37 + while (hash_table_iterate(iter, &key, &value)) {
18.38 const struct dbox_sync_file_entry *entry = value;
18.39
18.40 if ((ret = dbox_sync_file(ctx, entry)) <= 0)
18.41 break;
18.42 }
18.43 - hash_iterate_deinit(&iter);
18.44 + hash_table_iterate_deinit(&iter);
18.45 }
18.46
18.47 if (ret > 0)
18.48 @@ -243,7 +243,7 @@
18.49
18.50 dbox_sync_unlock_files(ctx);
18.51 array_free(&ctx->locked_files);
18.52 - hash_destroy(&ctx->syncs);
18.53 + hash_table_destroy(&ctx->syncs);
18.54 pool_unref(&ctx->pool);
18.55 return ret;
18.56 }
19.1 --- a/src/lib-storage/index/index-thread-finish.c Fri Dec 19 08:50:14 2008 +0200
19.2 +++ b/src/lib-storage/index/index-thread-finish.c Fri Dec 19 09:06:38 2008 +0200
19.3 @@ -79,12 +79,12 @@
19.4
19.5 /* (iii) Look up the message associated with the thread
19.6 subject in the subject table. */
19.7 - if (!hash_lookup_full(ctx->subject_hash, subject, &key, &value)) {
19.8 + if (!hash_table_lookup_full(ctx->subject_hash, subject, &key, &value)) {
19.9 /* (iv) If there is no message in the subject table with the
19.10 thread subject, add the current message and the thread
19.11 subject to the subject table. */
19.12 hash_subject = p_strdup(ctx->subject_pool, subject);
19.13 - hash_insert(ctx->subject_hash, hash_subject, node);
19.14 + hash_table_insert(ctx->subject_hash, hash_subject, node);
19.15 } else {
19.16 hash_subject = key;
19.17 hash_node = value;
19.18 @@ -103,7 +103,7 @@
19.19 (node->dummy ||
19.20 (hash_node->reply_or_forward && !is_reply_or_forward))) {
19.21 hash_node->parent_root_idx1 = node->root_idx1;
19.22 - hash_update(ctx->subject_hash, hash_subject, node);
19.23 + hash_table_update(ctx->subject_hash, hash_subject, node);
19.24 } else {
19.25 node->parent_root_idx1 = hash_node->root_idx1;
19.26 }
19.27 @@ -219,8 +219,9 @@
19.28 pool_alloconly_create(MEMPOOL_GROWING"base subjects",
19.29 nearest_power(count * 20));
19.30 gather_ctx.subject_hash =
19.31 - hash_create(default_pool, gather_ctx.subject_pool, count * 2,
19.32 - str_hash, (hash_cmp_callback_t *)strcmp);
19.33 + hash_table_create(default_pool, gather_ctx.subject_pool,
19.34 + count * 2, str_hash,
19.35 + (hash_cmp_callback_t *)strcmp);
19.36
19.37 i_array_init(&sorted_children, 64);
19.38 for (i = 0; i < count; i++) {
19.39 @@ -251,7 +252,7 @@
19.40 }
19.41 i_assert(roots[count-1].parent_root_idx1 <= count);
19.42 array_free(&sorted_children);
19.43 - hash_destroy(&gather_ctx.subject_hash);
19.44 + hash_table_destroy(&gather_ctx.subject_hash);
19.45 pool_unref(&gather_ctx.subject_pool);
19.46 }
19.47
20.1 --- a/src/lib-storage/index/maildir/maildir-keywords.c Fri Dec 19 08:50:14 2008 +0200
20.2 +++ b/src/lib-storage/index/maildir/maildir-keywords.c Fri Dec 19 09:06:38 2008 +0200
20.3 @@ -71,8 +71,8 @@
20.4 mk->path = i_strconcat(dir, "/" MAILDIR_KEYWORDS_NAME, NULL);
20.5 mk->pool = pool_alloconly_create("maildir keywords", 512);
20.6 i_array_init(&mk->list, MAILDIR_MAX_KEYWORDS);
20.7 - mk->hash = hash_create(default_pool, mk->pool, 0,
20.8 - strcase_hash, (hash_cmp_callback_t *)strcasecmp);
20.9 + mk->hash = hash_table_create(default_pool, mk->pool, 0,
20.10 + strcase_hash, (hash_cmp_callback_t *)strcasecmp);
20.11
20.12 mk->dotlock_settings.use_excl_lock =
20.13 (box->storage->flags & MAIL_STORAGE_FLAG_DOTLOCK_USE_EXCL) != 0;
20.14 @@ -91,7 +91,7 @@
20.15 struct maildir_keywords *mk = *_mk;
20.16
20.17 *_mk = NULL;
20.18 - hash_destroy(&mk->hash);
20.19 + hash_table_destroy(&mk->hash);
20.20 array_free(&mk->list);
20.21 pool_unref(&mk->pool);
20.22 i_free(mk->path);
20.23 @@ -101,7 +101,7 @@
20.24 static void maildir_keywords_clear(struct maildir_keywords *mk)
20.25 {
20.26 array_clear(&mk->list);
20.27 - hash_clear(mk->hash, FALSE);
20.28 + hash_table_clear(mk->hash, FALSE);
20.29 p_clear(mk->pool);
20.30 }
20.31
20.32 @@ -172,7 +172,7 @@
20.33
20.34 /* save it */
20.35 new_name = p_strdup(mk->pool, p);
20.36 - hash_insert(mk->hash, new_name, POINTER_CAST(idx + 1));
20.37 + hash_table_insert(mk->hash, new_name, POINTER_CAST(idx + 1));
20.38
20.39 strp = array_idx_modifiable(&mk->list, idx);
20.40 *strp = new_name;
20.41 @@ -194,7 +194,7 @@
20.42 {
20.43 void *p;
20.44
20.45 - p = hash_lookup(mk->hash, name);
20.46 + p = hash_table_lookup(mk->hash, name);
20.47 if (p == NULL) {
20.48 if (mk->synced)
20.49 return -1;
20.50 @@ -202,7 +202,7 @@
20.51 if (maildir_keywords_sync(mk) < 0)
20.52 return -1;
20.53
20.54 - p = hash_lookup(mk->hash, name);
20.55 + p = hash_table_lookup(mk->hash, name);
20.56 if (p == NULL)
20.57 return -1;
20.58 }
20.59 @@ -220,7 +220,7 @@
20.60 i_assert(chridx < MAILDIR_MAX_KEYWORDS);
20.61
20.62 new_name = p_strdup(mk->pool, name);
20.63 - hash_insert(mk->hash, new_name, POINTER_CAST(chridx + 1));
20.64 + hash_table_insert(mk->hash, new_name, POINTER_CAST(chridx + 1));
20.65
20.66 strp = array_idx_modifiable(&mk->list, chridx);
20.67 *strp = new_name;
21.1 --- a/src/lib-storage/index/maildir/maildir-uidlist.c Fri Dec 19 08:50:14 2008 +0200
21.2 +++ b/src/lib-storage/index/maildir/maildir-uidlist.c Fri Dec 19 09:06:38 2008 +0200
21.3 @@ -228,9 +228,9 @@
21.4 uidlist->ibox = ibox;
21.5 uidlist->path = i_strconcat(control_dir, "/"MAILDIR_UIDLIST_NAME, NULL);
21.6 i_array_init(&uidlist->records, 128);
21.7 - uidlist->files = hash_create(default_pool, default_pool, 4096,
21.8 - maildir_filename_base_hash,
21.9 - maildir_filename_base_cmp);
21.10 + uidlist->files = hash_table_create(default_pool, default_pool, 4096,
21.11 + maildir_filename_base_hash,
21.12 + maildir_filename_base_cmp);
21.13 uidlist->next_uid = 1;
21.14 uidlist->hdr_extensions = str_new(default_pool, 128);
21.15
21.16 @@ -284,7 +284,7 @@
21.17 maildir_uidlist_update(uidlist);
21.18 maildir_uidlist_close(uidlist);
21.19
21.20 - hash_destroy(&uidlist->files);
21.21 + hash_table_destroy(&uidlist->files);
21.22 if (uidlist->record_pool != NULL)
21.23 pool_unref(&uidlist->record_pool);
21.24
21.25 @@ -467,7 +467,7 @@
21.26 return FALSE;
21.27 }
21.28
21.29 - old_rec = hash_lookup(uidlist->files, line);
21.30 + old_rec = hash_table_lookup(uidlist->files, line);
21.31 if (old_rec != NULL) {
21.32 /* This can happen if expunged file is moved back and the file
21.33 was appended to uidlist. */
21.34 @@ -484,7 +484,7 @@
21.35 }
21.36
21.37 rec->filename = p_strdup(uidlist->record_pool, line);
21.38 - hash_insert(uidlist->files, rec->filename, rec);
21.39 + hash_table_insert(uidlist->files, rec->filename, rec);
21.40 array_append(&uidlist->records, &rec, 1);
21.41 return TRUE;
21.42 }
21.43 @@ -1353,9 +1353,9 @@
21.44
21.45 ctx->record_pool = pool_alloconly_create(MEMPOOL_GROWING
21.46 "maildir_uidlist_sync", 16384);
21.47 - ctx->files = hash_create(default_pool, ctx->record_pool, 4096,
21.48 - maildir_filename_base_hash,
21.49 - maildir_filename_base_cmp);
21.50 + ctx->files = hash_table_create(default_pool, ctx->record_pool, 4096,
21.51 + maildir_filename_base_hash,
21.52 + maildir_filename_base_cmp);
21.53
21.54 i_array_init(&ctx->records, array_count(&uidlist->records));
21.55 return 1;
21.56 @@ -1370,7 +1370,7 @@
21.57 struct maildir_uidlist_rec *rec;
21.58
21.59 /* we'll update uidlist directly */
21.60 - rec = hash_lookup(uidlist->files, filename);
21.61 + rec = hash_table_lookup(uidlist->files, filename);
21.62 if (rec == NULL) {
21.63 /* doesn't exist in uidlist */
21.64 if (!ctx->locked) {
21.65 @@ -1398,7 +1398,7 @@
21.66
21.67 rec->flags = (rec->flags | flags) & ~MAILDIR_UIDLIST_REC_FLAG_NONSYNCED;
21.68 rec->filename = p_strdup(uidlist->record_pool, filename);
21.69 - hash_insert(uidlist->files, rec->filename, rec);
21.70 + hash_table_insert(uidlist->files, rec->filename, rec);
21.71
21.72 ctx->finished = FALSE;
21.73 }
21.74 @@ -1446,7 +1446,7 @@
21.75 return 1;
21.76 }
21.77
21.78 - rec = hash_lookup(ctx->files, filename);
21.79 + rec = hash_table_lookup(ctx->files, filename);
21.80 if (rec != NULL) {
21.81 if ((rec->flags & (MAILDIR_UIDLIST_REC_FLAG_NEW_DIR |
21.82 MAILDIR_UIDLIST_REC_FLAG_MOVED)) == 0) {
21.83 @@ -1460,7 +1460,7 @@
21.84 rec->flags &= ~(MAILDIR_UIDLIST_REC_FLAG_NEW_DIR |
21.85 MAILDIR_UIDLIST_REC_FLAG_MOVED);
21.86 } else {
21.87 - old_rec = hash_lookup(uidlist->files, filename);
21.88 + old_rec = hash_table_lookup(uidlist->files, filename);
21.89 i_assert(old_rec != NULL || UIDLIST_IS_LOCKED(uidlist));
21.90
21.91 rec = p_new(ctx->record_pool, struct maildir_uidlist_rec, 1);
21.92 @@ -1482,7 +1482,7 @@
21.93
21.94 rec->flags = (rec->flags | flags) & ~MAILDIR_UIDLIST_REC_FLAG_NONSYNCED;
21.95 rec->filename = p_strdup(ctx->record_pool, filename);
21.96 - hash_insert(ctx->files, rec->filename, rec);
21.97 + hash_table_insert(ctx->files, rec->filename, rec);
21.98 return 1;
21.99 }
21.100
21.101 @@ -1494,11 +1494,11 @@
21.102
21.103 i_assert(ctx->partial);
21.104
21.105 - rec = hash_lookup(ctx->uidlist->files, filename);
21.106 + rec = hash_table_lookup(ctx->uidlist->files, filename);
21.107 i_assert(rec != NULL);
21.108 i_assert(rec->uid != (uint32_t)-1);
21.109
21.110 - hash_remove(ctx->uidlist->files, filename);
21.111 + hash_table_remove(ctx->uidlist->files, filename);
21.112 idx = maildir_uidlist_records_array_delete(ctx->uidlist, rec);
21.113
21.114 if (ctx->first_unwritten_pos != (unsigned int)-1) {
21.115 @@ -1520,7 +1520,7 @@
21.116 {
21.117 struct maildir_uidlist_rec *rec;
21.118
21.119 - rec = hash_lookup(ctx->files, filename);
21.120 + rec = hash_table_lookup(ctx->files, filename);
21.121 return rec == NULL ? NULL : rec->filename;
21.122 }
21.123
21.124 @@ -1529,7 +1529,7 @@
21.125 {
21.126 struct maildir_uidlist_rec *rec;
21.127
21.128 - rec = hash_lookup(uidlist->files, filename);
21.129 + rec = hash_table_lookup(uidlist->files, filename);
21.130 if (rec == NULL)
21.131 return FALSE;
21.132
21.133 @@ -1543,7 +1543,7 @@
21.134 {
21.135 struct maildir_uidlist_rec *rec;
21.136
21.137 - rec = hash_lookup(uidlist->files, filename);
21.138 + rec = hash_table_lookup(uidlist->files, filename);
21.139 return rec == NULL ? NULL : rec->filename;
21.140 }
21.141
21.142 @@ -1598,7 +1598,7 @@
21.143 uidlist->records = ctx->records;
21.144 ctx->records.arr.buffer = NULL;
21.145
21.146 - hash_destroy(&uidlist->files);
21.147 + hash_table_destroy(&uidlist->files);
21.148 uidlist->files = ctx->files;
21.149 ctx->files = NULL;
21.150
21.151 @@ -1652,7 +1652,7 @@
21.152 maildir_uidlist_unlock(ctx->uidlist);
21.153
21.154 if (ctx->files != NULL)
21.155 - hash_destroy(&ctx->files);
21.156 + hash_table_destroy(&ctx->files);
21.157 if (ctx->record_pool != NULL)
21.158 pool_unref(&ctx->record_pool);
21.159 if (array_is_created(&ctx->records))
21.160 @@ -1667,7 +1667,7 @@
21.161 {
21.162 struct maildir_uidlist_rec *rec;
21.163
21.164 - rec = hash_lookup(uidlist->files, filename);
21.165 + rec = hash_table_lookup(uidlist->files, filename);
21.166 i_assert(rec != NULL);
21.167
21.168 rec->flags |= flags;
22.1 --- a/src/lib/child-wait.c Fri Dec 19 08:50:14 2008 +0200
22.2 +++ b/src/lib/child-wait.c Fri Dec 19 09:06:38 2008 +0200
22.3 @@ -42,15 +42,15 @@
22.4
22.5 if (wait->pid_count > 0) {
22.6 /* this should be rare, so iterating hash is fast enough */
22.7 - iter = hash_iterate_init(child_pids);
22.8 - while (hash_iterate(iter, &key, &value)) {
22.9 + iter = hash_table_iterate_init(child_pids);
22.10 + while (hash_table_iterate(iter, &key, &value)) {
22.11 if (value == wait) {
22.12 - hash_remove(child_pids, key);
22.13 + hash_table_remove(child_pids, key);
22.14 if (--wait->pid_count == 0)
22.15 break;
22.16 }
22.17 }
22.18 - hash_iterate_deinit(&iter);
22.19 + hash_table_iterate_deinit(&iter);
22.20 }
22.21
22.22 i_free(wait);
22.23 @@ -59,13 +59,13 @@
22.24 void child_wait_add_pid(struct child_wait *wait, pid_t pid)
22.25 {
22.26 wait->pid_count++;
22.27 - hash_insert(child_pids, POINTER_CAST(pid), wait);
22.28 + hash_table_insert(child_pids, POINTER_CAST(pid), wait);
22.29 }
22.30
22.31 void child_wait_remove_pid(struct child_wait *wait, pid_t pid)
22.32 {
22.33 wait->pid_count--;
22.34 - hash_remove(child_pids, POINTER_CAST(pid));
22.35 + hash_table_remove(child_pids, POINTER_CAST(pid));
22.36 }
22.37
22.38 static void
22.39 @@ -74,7 +74,8 @@
22.40 struct child_wait_status status;
22.41
22.42 while ((status.pid = waitpid(-1, &status.status, WNOHANG)) > 0) {
22.43 - status.wait = hash_lookup(child_pids, POINTER_CAST(status.pid));
22.44 + status.wait = hash_table_lookup(child_pids,
22.45 + POINTER_CAST(status.pid));
22.46 if (status.wait != NULL) {
22.47 child_wait_remove_pid(status.wait, status.pid);
22.48 status.wait->callback(&status, status.wait->context);
22.49 @@ -87,7 +88,8 @@
22.50
22.51 void child_wait_init(void)
22.52 {
22.53 - child_pids = hash_create(default_pool, default_pool, 0, NULL, NULL);
22.54 + child_pids = hash_table_create(default_pool, default_pool, 0,
22.55 + NULL, NULL);
22.56
22.57 lib_signals_set_handler(SIGCHLD, TRUE, sigchld_handler, NULL);
22.58 }
22.59 @@ -99,10 +101,10 @@
22.60
22.61 lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
22.62
22.63 - iter = hash_iterate_init(child_pids);
22.64 - while (hash_iterate(iter, &key, &value))
22.65 + iter = hash_table_iterate_init(child_pids);
22.66 + while (hash_table_iterate(iter, &key, &value))
22.67 i_free(value);
22.68 - hash_iterate_deinit(&iter);
22.69 + hash_table_iterate_deinit(&iter);
22.70
22.71 - hash_destroy(&child_pids);
22.72 + hash_table_destroy(&child_pids);
22.73 }
23.1 --- a/src/lib/hash.c Fri Dec 19 08:50:14 2008 +0200
23.2 +++ b/src/lib/hash.c Fri Dec 19 09:06:38 2008 +0200
23.3 @@ -36,7 +36,7 @@
23.4 unsigned int pos;
23.5 };
23.6
23.7 -static bool hash_resize(struct hash_table *table, bool grow);
23.8 +static bool hash_table_resize(struct hash_table *table, bool grow);
23.9
23.10 static int direct_cmp(const void *p1, const void *p2)
23.11 {
23.12 @@ -50,8 +50,8 @@
23.13 }
23.14
23.15 struct hash_table *
23.16 -hash_create(pool_t table_pool, pool_t node_pool, unsigned int initial_size,
23.17 - hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb)
23.18 +hash_table_create(pool_t table_pool, pool_t node_pool, unsigned int initial_size,
23.19 + hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb)
23.20 {
23.21 struct hash_table *table;
23.22
23.23 @@ -91,7 +91,7 @@
23.24 }
23.25 }
23.26
23.27 -static void hash_destroy_nodes(struct hash_table *table)
23.28 +static void hash_table_destroy_nodes(struct hash_table *table)
23.29 {
23.30 unsigned int i;
23.31
23.32 @@ -101,14 +101,14 @@
23.33 }
23.34 }
23.35
23.36 -void hash_destroy(struct hash_table **_table)
23.37 +void hash_table_destroy(struct hash_table **_table)
23.38 {
23.39 struct hash_table *table = *_table;
23.40
23.41 *_table = NULL;
23.42
23.43 if (!table->node_pool->alloconly_pool) {
23.44 - hash_destroy_nodes(table);
23.45 + hash_table_destroy_nodes(table);
23.46 destroy_node_list(table, table->free_nodes);
23.47 }
23.48
23.49 @@ -116,10 +116,10 @@
23.50 p_free(table->table_pool, table);
23.51 }
23.52
23.53 -void hash_clear(struct hash_table *table, bool free_nodes)
23.54 +void hash_table_clear(struct hash_table *table, bool free_nodes)
23.55 {
23.56 if (!table->node_pool->alloconly_pool)
23.57 - hash_destroy_nodes(table);
23.58 + hash_table_destroy_nodes(table);
23.59
23.60 if (free_nodes) {
23.61 if (!table->node_pool->alloconly_pool)
23.62 @@ -134,8 +134,8 @@
23.63 }
23.64
23.65 static struct hash_node *
23.66 -hash_lookup_node(const struct hash_table *table,
23.67 - const void *key, unsigned int hash)
23.68 +hash_table_lookup_node(const struct hash_table *table,
23.69 + const void *key, unsigned int hash)
23.70 {
23.71 struct hash_node *node;
23.72
23.73 @@ -152,21 +152,22 @@
23.74 return NULL;
23.75 }
23.76
23.77 -void *hash_lookup(const struct hash_table *table, const void *key)
23.78 +void *hash_table_lookup(const struct hash_table *table, const void *key)
23.79 {
23.80 struct hash_node *node;
23.81
23.82 - node = hash_lookup_node(table, key, table->hash_cb(key));
23.83 + node = hash_table_lookup_node(table, key, table->hash_cb(key));
23.84 return node != NULL ? node->value : NULL;
23.85 }
23.86
23.87 -bool hash_lookup_full(const struct hash_table *table, const void *lookup_key,
23.88 - void **orig_key, void **value)
23.89 +bool hash_table_lookup_full(const struct hash_table *table,
23.90 + const void *lookup_key,
23.91 + void **orig_key, void **value)
23.92 {
23.93 struct hash_node *node;
23.94
23.95 - node = hash_lookup_node(table, lookup_key,
23.96 - table->hash_cb(lookup_key));
23.97 + node = hash_table_lookup_node(table, lookup_key,
23.98 + table->hash_cb(lookup_key));
23.99 if (node == NULL)
23.100 return FALSE;
23.101
23.102 @@ -178,8 +179,8 @@
23.103 }
23.104
23.105 static struct hash_node *
23.106 -hash_insert_node(struct hash_table *table, void *key, void *value,
23.107 - bool check_existing)
23.108 +hash_table_insert_node(struct hash_table *table, void *key, void *value,
23.109 + bool check_existing)
23.110 {
23.111 struct hash_node *node, *prev;
23.112 unsigned int hash;
23.113 @@ -190,7 +191,7 @@
23.114
23.115 if (check_existing && table->removed_count > 0) {
23.116 /* there may be holes, have to check everything */
23.117 - node = hash_lookup_node(table, key, hash);
23.118 + node = hash_table_lookup_node(table, key, hash);
23.119 if (node != NULL) {
23.120 node->value = value;
23.121 return node;
23.122 @@ -234,9 +235,9 @@
23.123 }
23.124
23.125 if (node == NULL) {
23.126 - if (table->frozen == 0 && hash_resize(table, TRUE)) {
23.127 + if (table->frozen == 0 && hash_table_resize(table, TRUE)) {
23.128 /* resized table, try again */
23.129 - return hash_insert_node(table, key, value, FALSE);
23.130 + return hash_table_insert_node(table, key, value, FALSE);
23.131 }
23.132
23.133 if (table->free_nodes == NULL)
23.134 @@ -256,20 +257,21 @@
23.135 return node;
23.136 }
23.137
23.138 -void hash_insert(struct hash_table *table, void *key, void *value)
23.139 +void hash_table_insert(struct hash_table *table, void *key, void *value)
23.140 {
23.141 struct hash_node *node;
23.142
23.143 - node = hash_insert_node(table, key, value, TRUE);
23.144 + node = hash_table_insert_node(table, key, value, TRUE);
23.145 node->key = key;
23.146 }
23.147
23.148 -void hash_update(struct hash_table *table, void *key, void *value)
23.149 +void hash_table_update(struct hash_table *table, void *key, void *value)
23.150 {
23.151 - (void)hash_insert_node(table, key, value, TRUE);
23.152 + (void)hash_table_insert_node(table, key, value, TRUE);
23.153 }
23.154
23.155 -static void hash_compress(struct hash_table *table, struct hash_node *root)
23.156 +static void
23.157 +hash_table_compress(struct hash_table *table, struct hash_node *root)
23.158 {
23.159 struct hash_node *node, *next;
23.160
23.161 @@ -293,24 +295,24 @@
23.162 }
23.163 }
23.164
23.165 -static void hash_compress_removed(struct hash_table *table)
23.166 +static void hash_table_compress_removed(struct hash_table *table)
23.167 {
23.168 unsigned int i;
23.169
23.170 for (i = 0; i < table->size; i++)
23.171 - hash_compress(table, &table->nodes[i]);
23.172 + hash_table_compress(table, &table->nodes[i]);
23.173
23.174 table->removed_count = 0;
23.175 }
23.176
23.177 -void hash_remove(struct hash_table *table, const void *key)
23.178 +void hash_table_remove(struct hash_table *table, const void *key)
23.179 {
23.180 struct hash_node *node;
23.181 unsigned int hash;
23.182
23.183 hash = table->hash_cb(key);
23.184
23.185 - node = hash_lookup_node(table, key, hash);
23.186 + node = hash_table_lookup_node(table, key, hash);
23.187 if (unlikely(node == NULL))
23.188 i_panic("key not found from hash");
23.189
23.190 @@ -319,20 +321,20 @@
23.191
23.192 if (table->frozen != 0)
23.193 table->removed_count++;
23.194 - else if (!hash_resize(table, FALSE))
23.195 - hash_compress(table, &table->nodes[hash % table->size]);
23.196 + else if (!hash_table_resize(table, FALSE))
23.197 + hash_table_compress(table, &table->nodes[hash % table->size]);
23.198 }
23.199
23.200 -unsigned int hash_count(const struct hash_table *table)
23.201 +unsigned int hash_table_count(const struct hash_table *table)
23.202 {
23.203 return table->nodes_count;
23.204 }
23.205
23.206 -struct hash_iterate_context *hash_iterate_init(struct hash_table *table)
23.207 +struct hash_iterate_context *hash_table_iterate_init(struct hash_table *table)
23.208 {
23.209 struct hash_iterate_context *ctx;
23.210
23.211 - hash_freeze(table);
23.212 + hash_table_freeze(table);
23.213
23.214 ctx = i_new(struct hash_iterate_context, 1);
23.215 ctx->table = table;
23.216 @@ -340,8 +342,9 @@
23.217 return ctx;
23.218 }
23.219
23.220 -static struct hash_node *hash_iterate_next(struct hash_iterate_context *ctx,
23.221 - struct hash_node *node)
23.222 +static struct hash_node *
23.223 +hash_table_iterate_next(struct hash_iterate_context *ctx,
23.224 + struct hash_node *node)
23.225 {
23.226 do {
23.227 node = node->next;
23.228 @@ -357,14 +360,14 @@
23.229 return node;
23.230 }
23.231
23.232 -bool hash_iterate(struct hash_iterate_context *ctx,
23.233 - void **key_r, void **value_r)
23.234 +bool hash_table_iterate(struct hash_iterate_context *ctx,
23.235 + void **key_r, void **value_r)
23.236 {
23.237 struct hash_node *node;
23.238
23.239 node = ctx->next;
23.240 if (node != NULL && node->key == NULL)
23.241 - node = hash_iterate_next(ctx, node);
23.242 + node = hash_table_iterate_next(ctx, node);
23.243 if (node == NULL) {
23.244 *key_r = *value_r = NULL;
23.245 return FALSE;
23.246 @@ -372,25 +375,25 @@
23.247 *key_r = node->key;
23.248 *value_r = node->value;
23.249
23.250 - ctx->next = hash_iterate_next(ctx, node);
23.251 + ctx->next = hash_table_iterate_next(ctx, node);
23.252 return TRUE;
23.253 }
23.254
23.255 -void hash_iterate_deinit(struct hash_iterate_context **_ctx)
23.256 +void hash_table_iterate_deinit(struct hash_iterate_context **_ctx)
23.257 {
23.258 struct hash_iterate_context *ctx = *_ctx;
23.259
23.260 *_ctx = NULL;
23.261 - hash_thaw(ctx->table);
23.262 + hash_table_thaw(ctx->table);
23.263 i_free(ctx);
23.264 }
23.265
23.266 -void hash_freeze(struct hash_table *table)
23.267 +void hash_table_freeze(struct hash_table *table)
23.268 {
23.269 table->frozen++;
23.270 }
23.271
23.272 -void hash_thaw(struct hash_table *table)
23.273 +void hash_table_thaw(struct hash_table *table)
23.274 {
23.275 i_assert(table->frozen > 0);
23.276
23.277 @@ -398,12 +401,12 @@
23.278 return;
23.279
23.280 if (table->removed_count > 0) {
23.281 - if (!hash_resize(table, FALSE))
23.282 - hash_compress_removed(table);
23.283 + if (!hash_table_resize(table, FALSE))
23.284 + hash_table_compress_removed(table);
23.285 }
23.286 }
23.287
23.288 -static bool hash_resize(struct hash_table *table, bool grow)
23.289 +static bool hash_table_resize(struct hash_table *table, bool grow)
23.290 {
23.291 struct hash_node *old_nodes, *node, *next;
23.292 unsigned int next_size, old_size, i;
23.293 @@ -436,15 +439,17 @@
23.294 /* move the data */
23.295 for (i = 0; i < old_size; i++) {
23.296 node = &old_nodes[i];
23.297 - if (node->key != NULL)
23.298 - hash_insert_node(table, node->key, node->value, FALSE);
23.299 + if (node->key != NULL) {
23.300 + hash_table_insert_node(table, node->key,
23.301 + node->value, FALSE);
23.302 + }
23.303
23.304 for (node = node->next; node != NULL; node = next) {
23.305 next = node->next;
23.306
23.307 if (node->key != NULL) {
23.308 - hash_insert_node(table, node->key,
23.309 - node->value, FALSE);
23.310 + hash_table_insert_node(table, node->key,
23.311 + node->value, FALSE);
23.312 }
23.313 free_node(table, node);
23.314 }
23.315 @@ -456,19 +461,19 @@
23.316 return TRUE;
23.317 }
23.318
23.319 -void hash_copy(struct hash_table *dest, struct hash_table *src)
23.320 +void hash_table_copy(struct hash_table *dest, struct hash_table *src)
23.321 {
23.322 struct hash_iterate_context *iter;
23.323 void *key, *value;
23.324
23.325 - hash_freeze(dest);
23.326 + hash_table_freeze(dest);
23.327
23.328 - iter = hash_iterate_init(src);
23.329 - while (hash_iterate(iter, &key, &value))
23.330 - hash_insert(dest, key, value);
23.331 - hash_iterate_deinit(&iter);
23.332 + iter = hash_table_iterate_init(src);
23.333 + while (hash_table_iterate(iter, &key, &value))
23.334 + hash_table_insert(dest, key, value);
23.335 + hash_table_iterate_deinit(&iter);
23.336
23.337 - hash_thaw(dest);
23.338 + hash_table_thaw(dest);
23.339 }
23.340
23.341 /* a char* hash function from ASU -- from glib */
24.1 --- a/src/lib/hash.h Fri Dec 19 08:50:14 2008 +0200
24.2 +++ b/src/lib/hash.h Fri Dec 19 09:06:38 2008 +0200
24.3 @@ -11,43 +11,45 @@
24.4
24.5 table_pool is used to allocate/free large hash tables, node_pool is used
24.6 for smaller allocations and can also be alloconly pool. The pools must not
24.7 - be free'd before hash_destroy() is called. */
24.8 + be free'd before hash_table_destroy() is called. */
24.9 +/* APPLE - renamed from hash_create/hash_destroy to avoid libc conflict */
24.10 struct hash_table *
24.11 -hash_create(pool_t table_pool, pool_t node_pool, unsigned int initial_size,
24.12 - hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb);
24.13 -void hash_destroy(struct hash_table **table);
24.14 +hash_table_create(pool_t table_pool, pool_t node_pool, unsigned int initial_size,
24.15 + hash_callback_t *hash_cb, hash_cmp_callback_t *key_compare_cb);
24.16 +void hash_table_destroy(struct hash_table **table);
24.17 /* Remove all nodes from hash table. If free_collisions is TRUE, the
24.18 memory allocated from node_pool is freed, or discarded with
24.19 alloconly pools. */
24.20 -void hash_clear(struct hash_table *table, bool free_collisions);
24.21 +void hash_table_clear(struct hash_table *table, bool free_collisions);
24.22
24.23 -void *hash_lookup(const struct hash_table *table, const void *key) ATTR_PURE;
24.24 -bool hash_lookup_full(const struct hash_table *table, const void *lookup_key,
24.25 - void **orig_key, void **value);
24.26 +void *hash_table_lookup(const struct hash_table *table, const void *key) ATTR_PURE;
24.27 +bool hash_table_lookup_full(const struct hash_table *table,
24.28 + const void *lookup_key,
24.29 + void **orig_key, void **value);
24.30
24.31 -/* Insert/update node in hash table. The difference is that hash_insert()
24.32 - replaces the key in table to given one, while hash_update() doesnt. */
24.33 -void hash_insert(struct hash_table *table, void *key, void *value);
24.34 -void hash_update(struct hash_table *table, void *key, void *value);
24.35 +/* Insert/update node in hash table. The difference is that hash_table_insert()
24.36 + replaces the key in table to given one, while hash_table_update() doesnt. */
24.37 +void hash_table_insert(struct hash_table *table, void *key, void *value);
24.38 +void hash_table_update(struct hash_table *table, void *key, void *value);
24.39
24.40 -void hash_remove(struct hash_table *table, const void *key);
24.41 -unsigned int hash_count(const struct hash_table *table) ATTR_PURE;
24.42 +void hash_table_remove(struct hash_table *table, const void *key);
24.43 +unsigned int hash_table_count(const struct hash_table *table) ATTR_PURE;
24.44
24.45 -/* Iterates through all nodes in hash table. You may safely call hash_*()
24.46 +/* Iterates through all nodes in hash table. You may safely call hash_table_*()
24.47 functions while iterating, but if you add any new nodes, they may or may
24.48 not be called for in this iteration. */
24.49 -struct hash_iterate_context *hash_iterate_init(struct hash_table *table);
24.50 -bool hash_iterate(struct hash_iterate_context *ctx,
24.51 - void **key_r, void **value_r);
24.52 -void hash_iterate_deinit(struct hash_iterate_context **ctx);
24.53 +struct hash_iterate_context *hash_table_iterate_init(struct hash_table *table);
24.54 +bool hash_table_iterate(struct hash_iterate_context *ctx,
24.55 + void **key_r, void **value_r);
24.56 +void hash_table_iterate_deinit(struct hash_iterate_context **ctx);
24.57
24.58 /* Hash table isn't resized, and removed nodes aren't removed from
24.59 the list while hash table is freezed. Supports nesting. */
24.60 -void hash_freeze(struct hash_table *table);
24.61 -void hash_thaw(struct hash_table *table);
24.62 +void hash_table_freeze(struct hash_table *table);
24.63 +void hash_table_thaw(struct hash_table *table);
24.64
24.65 /* Copy all nodes from one hash table to another */
24.66 -void hash_copy(struct hash_table *dest, struct hash_table *src);
24.67 +void hash_table_copy(struct hash_table *dest, struct hash_table *src);
24.68
24.69 /* hash function for strings */
24.70 unsigned int str_hash(const void *p) ATTR_PURE;
25.1 --- a/src/login-common/master.c Fri Dec 19 08:50:14 2008 +0200
25.2 +++ b/src/login-common/master.c Fri Dec 19 09:06:38 2008 +0200
25.3 @@ -46,11 +46,11 @@
25.4 return;
25.5 }
25.6
25.7 - client = hash_lookup(master_requests, POINTER_CAST(reply->tag));
25.8 + client = hash_table_lookup(master_requests, POINTER_CAST(reply->tag));
25.9 if (client == NULL)
25.10 i_fatal("Master sent reply with unknown tag %u", reply->tag);
25.11
25.12 - hash_remove(master_requests, POINTER_CAST(reply->tag));
25.13 + hash_table_remove(master_requests, POINTER_CAST(reply->tag));
25.14 if (client != &destroyed_client) {
25.15 client_call_master_callback(client, reply);
25.16 /* NOTE: client may be destroyed now */
25.17 @@ -119,7 +119,7 @@
25.18 client->master_tag = req->tag;
25.19 client->master_callback = callback;
25.20
25.21 - hash_insert(master_requests, POINTER_CAST(req->tag), client);
25.22 + hash_table_insert(master_requests, POINTER_CAST(req->tag), client);
25.23 }
25.24
25.25 void master_request_abort(struct client *client)
25.26 @@ -128,8 +128,8 @@
25.27
25.28 /* we're still going to get the reply from the master, so just
25.29 remember that we want to ignore it */
25.30 - hash_update(master_requests, POINTER_CAST(client->master_tag),
25.31 - &destroyed_client);
25.32 + hash_table_update(master_requests, POINTER_CAST(client->master_tag),
25.33 + &destroyed_client);
25.34
25.35 memset(&reply, 0, sizeof(reply));
25.36 reply.status = MASTER_LOGIN_STATUS_INTERNAL_ERROR;
25.37 @@ -295,8 +295,8 @@
25.38 main_ref();
25.39
25.40 master_fd = fd;
25.41 - master_requests = hash_create(system_pool, system_pool,
25.42 - 0, NULL, NULL);
25.43 + master_requests = hash_table_create(system_pool, system_pool,
25.44 + 0, NULL, NULL);
25.45
25.46 master_pos = 0;
25.47 io_master = io_add(master_fd, IO_READ, master_input, NULL);
25.48 @@ -304,7 +304,7 @@
25.49
25.50 void master_deinit(void)
25.51 {
25.52 - hash_destroy(&master_requests);
25.53 + hash_table_destroy(&master_requests);
25.54
25.55 if (io_master != NULL)
25.56 io_remove(&io_master);
26.1 --- a/src/login-common/ssl-proxy-gnutls.c Fri Dec 19 08:50:14 2008 +0200
26.2 +++ b/src/login-common/ssl-proxy-gnutls.c Fri Dec 19 09:06:38 2008 +0200
26.3 @@ -140,7 +140,7 @@
26.4 if (--proxy->refcount > 0)
26.5 return TRUE;
26.6
26.7 - hash_remove(ssl_proxies, proxy);
26.8 + hash_table_remove(ssl_proxies, proxy);
26.9
26.10 gnutls_deinit(proxy->session);
26.11
26.12 @@ -332,7 +332,7 @@
26.13 proxy->fd_plain = sfd[0];
26.14 proxy->ip = *ip;
26.15
26.16 - hash_insert(ssl_proxies, proxy, proxy);
26.17 + hash_table_insert(ssl_proxies, proxy, proxy);
26.18
26.19 proxy->refcount++;
26.20 ssl_handshake(proxy);
26.21 @@ -519,7 +519,8 @@
26.22 gnutls_certificate_set_dh_params(x509_cred, dh_params);
26.23 gnutls_certificate_set_rsa_export_params(x509_cred, rsa_params);
26.24
26.25 - ssl_proxies = hash_create(system_pool, system_pool, 0, NULL, NULL);
26.26 + ssl_proxies = hash_table_create(system_pool, system_pool, 0,
26.27 + NULL, NULL);
26.28 ssl_initialized = TRUE;
26.29 }
26.30
26.31 @@ -531,11 +532,11 @@
26.32 if (!ssl_initialized)
26.33 return;
26.34
26.35 - iter = hash_iterate_init(ssl_proxies);
26.36 - while (hash_iterate(iter, &key, &value))
26.37 + iter = hash_table_iterate_init(ssl_proxies);
26.38 + while (hash_table_iterate(iter, &key, &value))
26.39 ssl_proxy_destroy(value);
26.40 - hash_iterate_deinit(iter);
26.41 - hash_destroy(ssl_proxies);
26.42 + hash_table_iterate_deinit(iter);
26.43 + hash_table_destroy(ssl_proxies);
26.44
26.45 gnutls_certificate_free_credentials(x509_cred);
26.46 gnutls_global_deinit();
27.1 --- a/src/master/auth-process.c Fri Dec 19 08:50:14 2008 +0200
27.2 +++ b/src/master/auth-process.c Fri Dec 19 09:06:38 2008 +0200
27.3 @@ -98,7 +98,8 @@
27.4 }
27.5 auth_process_destroy(process);
27.6 } else {
27.7 - hash_insert(process->requests, POINTER_CAST(auth_tag), request);
27.8 + hash_table_insert(process->requests,
27.9 + POINTER_CAST(auth_tag), request);
27.10 }
27.11 }
27.12
27.13 @@ -119,7 +120,7 @@
27.14 }
27.15 id = (unsigned int)strtoul(list[0], NULL, 10);
27.16
27.17 - request = hash_lookup(process->requests, POINTER_CAST(id));
27.18 + request = hash_table_lookup(process->requests, POINTER_CAST(id));
27.19 if (request == NULL) {
27.20 i_error("BUG: Auth process %s sent unrequested reply with ID "
27.21 "%u", dec2str(process->pid), id);
27.22 @@ -138,7 +139,7 @@
27.23 }
27.24
27.25 auth_master_callback(list[1], list + 2, request);
27.26 - hash_remove(process->requests, POINTER_CAST(id));
27.27 + hash_table_remove(process->requests, POINTER_CAST(id));
27.28 return TRUE;
27.29 }
27.30
27.31 @@ -150,7 +151,7 @@
27.32
27.33 id = (unsigned int)strtoul(args, NULL, 10);
27.34
27.35 - request = hash_lookup(process->requests, POINTER_CAST(id));
27.36 + request = hash_table_lookup(process->requests, POINTER_CAST(id));
27.37 if (request == NULL) {
27.38 i_error("BUG: Auth process %s sent unrequested reply with ID "
27.39 "%u", dec2str(process->pid), id);
27.40 @@ -158,7 +159,7 @@
27.41 }
27.42
27.43 auth_master_callback(NULL, NULL, request);
27.44 - hash_remove(process->requests, POINTER_CAST(id));
27.45 + hash_table_remove(process->requests, POINTER_CAST(id));
27.46 return TRUE;
27.47 }
27.48
27.49 @@ -204,7 +205,7 @@
27.50
27.51 id = (unsigned int)strtoul(args, NULL, 10);
27.52
27.53 - request = hash_lookup(process->requests, POINTER_CAST(id));
27.54 + request = hash_table_lookup(process->requests, POINTER_CAST(id));
27.55 if (request == NULL) {
27.56 i_error("BUG: Auth process %s sent unrequested reply with ID "
27.57 "%u", dec2str(process->pid), id);
27.58 @@ -212,7 +213,7 @@
27.59 }
27.60
27.61 auth_master_callback(NULL, NULL, request);
27.62 - hash_remove(process->requests, POINTER_CAST(id));
27.63 + hash_table_remove(process->requests, POINTER_CAST(id));
27.64 return TRUE;
27.65 }
27.66
27.67 @@ -314,7 +315,8 @@
27.68 p->io = io_add(fd, IO_READ, auth_process_input, p);
27.69 p->input = i_stream_create_fd(fd, MAX_INBUF_SIZE, FALSE);
27.70 p->output = o_stream_create_fd(fd, MAX_OUTBUF_SIZE, FALSE);
27.71 - p->requests = hash_create(default_pool, default_pool, 0, NULL, NULL);
27.72 + p->requests = hash_table_create(default_pool, default_pool, 0,
27.73 + NULL, NULL);
27.74
27.75 group->process_count++;
27.76
27.77 @@ -377,11 +379,11 @@
27.78 if (close(p->worker_listen_fd) < 0)
27.79 i_error("close(worker_listen) failed: %m");
27.80
27.81 - iter = hash_iterate_init(p->requests);
27.82 - while (hash_iterate(iter, &key, &value))
27.83 + iter = hash_table_iterate_init(p->requests);
27.84 + while (hash_table_iterate(iter, &key, &value))
27.85 auth_master_callback(NULL, NULL, value);
27.86 - hash_iterate_deinit(&iter);
27.87 - hash_destroy(&p->requests);
27.88 + hash_table_iterate_deinit(&iter);
27.89 + hash_table_destroy(&p->requests);
27.90
27.91 i_stream_destroy(&p->input);
27.92 o_stream_destroy(&p->output);
28.1 --- a/src/master/child-process.c Fri Dec 19 08:50:14 2008 +0200
28.2 +++ b/src/master/child-process.c Fri Dec 19 09:06:38 2008 +0200
28.3 @@ -27,17 +27,17 @@
28.4
28.5 struct child_process *child_process_lookup(pid_t pid)
28.6 {
28.7 - return hash_lookup(processes, POINTER_CAST(pid));
28.8 + return hash_table_lookup(processes, POINTER_CAST(pid));
28.9 }
28.10
28.11 void child_process_add(pid_t pid, struct child_process *process)
28.12 {
28.13 - hash_insert(processes, POINTER_CAST(pid), process);
28.14 + hash_table_insert(processes, POINTER_CAST(pid), process);
28.15 }
28.16
28.17 void child_process_remove(pid_t pid)
28.18 {
28.19 - hash_remove(processes, POINTER_CAST(pid));
28.20 + hash_table_remove(processes, POINTER_CAST(pid));
28.21 }
28.22
28.23 void child_process_init_env(void)
28.24 @@ -198,7 +198,7 @@
28.25
28.26 void child_processes_init(void)
28.27 {
28.28 - processes = hash_create(default_pool, default_pool, 128, NULL, NULL);
28.29 + processes = hash_table_create(default_pool, default_pool, 128, NULL, NULL);
28.30 lib_signals_set_handler(SIGCHLD, TRUE, sigchld_handler, NULL);
28.31 }
28.32
28.33 @@ -207,5 +207,5 @@
28.34 /* make sure we log if child processes died unexpectedly */
28.35 sigchld_handler(SIGCHLD, NULL);
28.36 lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
28.37 - hash_destroy(&processes);
28.38 + hash_table_destroy(&processes);
28.39 }
29.1 --- a/src/master/login-process.c Fri Dec 19 08:50:14 2008 +0200
29.2 +++ b/src/master/login-process.c Fri Dec 19 09:06:38 2008 +0200
29.3 @@ -757,14 +757,14 @@
29.4 struct hash_iterate_context *iter;
29.5 void *key, *value;
29.6
29.7 - iter = hash_iterate_init(processes);
29.8 - while (hash_iterate(iter, &key, &value)) {
29.9 + iter = hash_table_iterate_init(processes);
29.10 + while (hash_table_iterate(iter, &key, &value)) {
29.11 struct login_process *p = value;
29.12
29.13 if (p->process.type == PROCESS_TYPE_LOGIN)
29.14 login_process_destroy(p);
29.15 }
29.16 - hash_iterate_deinit(&iter);
29.17 + hash_table_iterate_deinit(&iter);
29.18
29.19 while (login_groups != NULL) {
29.20 struct login_group *group = login_groups;
29.21 @@ -782,14 +782,14 @@
29.22
29.23 memset(&reply, 0, sizeof(reply));
29.24
29.25 - iter = hash_iterate_init(processes);
29.26 - while (hash_iterate(iter, &key, &value)) {
29.27 + iter = hash_table_iterate_init(processes);
29.28 + while (hash_table_iterate(iter, &key, &value)) {
29.29 struct login_process *p = value;
29.30
29.31 if (p->process.type == PROCESS_TYPE_LOGIN && p->group == group)
29.32 (void)o_stream_send(p->output, &reply, sizeof(reply));
29.33 }
29.34 - hash_iterate_deinit(&iter);
29.35 + hash_table_iterate_deinit(&iter);
29.36 }
29.37
29.38 static int login_group_start_missings(struct login_group *group)
30.1 --- a/src/master/mail-process.c Fri Dec 19 08:50:14 2008 +0200
30.2 +++ b/src/master/mail-process.c Fri Dec 19 09:06:38 2008 +0200
30.3 @@ -78,7 +78,7 @@
30.4 lookup_group.user = t_strdup_noconst(user);
30.5 lookup_group.remote_ip = *ip;
30.6
30.7 - return hash_lookup(mail_process_groups, &lookup_group);
30.8 + return hash_table_lookup(mail_process_groups, &lookup_group);
30.9 }
30.10
30.11 static struct mail_process_group *
30.12 @@ -93,7 +93,7 @@
30.13 group->remote_ip = *ip;
30.14
30.15 i_array_init(&group->processes, 10);
30.16 - hash_insert(mail_process_groups, group, group);
30.17 + hash_table_insert(mail_process_groups, group, group);
30.18 return group;
30.19 }
30.20
30.21 @@ -922,7 +922,7 @@
30.22 if (count == 1) {
30.23 /* last process in this group */
30.24 i_assert(pids[0] == pid);
30.25 - hash_remove(mail_process_groups, group);
30.26 + hash_table_remove(mail_process_groups, group);
30.27 mail_process_group_free(group);
30.28 } else {
30.29 for (i = 0; i < count; i++) {
30.30 @@ -938,9 +938,9 @@
30.31
30.32 void mail_processes_init(void)
30.33 {
30.34 - mail_process_groups = hash_create(default_pool, default_pool, 0,
30.35 - mail_process_group_hash,
30.36 - mail_process_group_cmp);
30.37 + mail_process_groups = hash_table_create(default_pool, default_pool, 0,
30.38 + mail_process_group_hash,
30.39 + mail_process_group_cmp);
30.40
30.41 child_process_set_destroy_callback(PROCESS_TYPE_IMAP,
30.42 mail_process_destroyed);
30.43 @@ -953,12 +953,12 @@
30.44 struct hash_iterate_context *iter;
30.45 void *key, *value;
30.46
30.47 - iter = hash_iterate_init(mail_process_groups);
30.48 - while (hash_iterate(iter, &key, &value)) {
30.49 + iter = hash_table_iterate_init(mail_process_groups);
30.50 + while (hash_table_iterate(iter, &key, &value)) {
30.51 struct mail_process_group *group = value;
30.52 mail_process_group_free(group);
30.53 }
30.54 - hash_iterate_deinit(&iter);
30.55 + hash_table_iterate_deinit(&iter);
30.56
30.57 - hash_destroy(&mail_process_groups);
30.58 + hash_table_destroy(&mail_process_groups);
30.59 }
31.1 --- a/src/plugins/acl/acl-cache.c Fri Dec 19 08:50:14 2008 +0200
31.2 +++ b/src/plugins/acl/acl-cache.c Fri Dec 19 09:06:38 2008 +0200
31.3 @@ -47,11 +47,11 @@
31.4 cache->validity_rec_size = validity_rec_size;
31.5 cache->right_names_pool =
31.6 pool_alloconly_create("ACL right names", 1024);
31.7 - cache->objects = hash_create(default_pool, default_pool, 0,
31.8 - str_hash, (hash_cmp_callback_t *)strcmp);
31.9 + cache->objects = hash_table_create(default_pool, default_pool, 0,
31.10 + str_hash, (hash_cmp_callback_t *)strcmp);
31.11 cache->right_name_idx_map =
31.12 - hash_create(default_pool, cache->right_names_pool, 0,
31.13 - str_hash, (hash_cmp_callback_t *)strcmp);
31.14 + hash_table_create(default_pool, cache->right_names_pool, 0,
31.15 + str_hash, (hash_cmp_callback_t *)strcmp);
31.16 i_array_init(&cache->right_idx_name_map, DEFAULT_ACL_RIGHTS_COUNT);
31.17 return cache;
31.18 }
31.19 @@ -64,8 +64,8 @@
31.20
31.21 acl_cache_flush_all(cache);
31.22 array_free(&cache->right_idx_name_map);
31.23 - hash_destroy(&cache->right_name_idx_map);
31.24 - hash_destroy(&cache->objects);
31.25 + hash_table_destroy(&cache->right_name_idx_map);
31.26 + hash_table_destroy(&cache->objects);
31.27 pool_unref(&cache->right_names_pool);
31.28 i_free(cache);
31.29 }
31.30 @@ -145,15 +145,15 @@
31.31
31.32 /* use +1 for right_name_idx_map values because we can't add NULL
31.33 values. */
31.34 - idx_p = hash_lookup(cache->right_name_idx_map, right);
31.35 + idx_p = hash_table_lookup(cache->right_name_idx_map, right);
31.36 if (idx_p == NULL) {
31.37 /* new right name, add it */
31.38 const_name = name = p_strdup(cache->right_names_pool, right);
31.39
31.40 idx = array_count(&cache->right_idx_name_map);
31.41 array_append(&cache->right_idx_name_map, &const_name, 1);
31.42 - hash_insert(cache->right_name_idx_map, name,
31.43 - POINTER_CAST(idx + 1));
31.44 + hash_table_insert(cache->right_name_idx_map, name,
31.45 + POINTER_CAST(idx + 1));
31.46 } else {
31.47 idx = POINTER_CAST_TO(idx_p, unsigned int)-1;
31.48 }
31.49 @@ -164,9 +164,9 @@
31.50 {
31.51 struct acl_object_cache *obj_cache;
31.52
31.53 - obj_cache = hash_lookup(cache->objects, objname);
31.54 + obj_cache = hash_table_lookup(cache->objects, objname);
31.55 if (obj_cache != NULL) {
31.56 - hash_remove(cache->objects, objname);
31.57 + hash_table_remove(cache->objects, objname);
31.58 acl_cache_free_object_cache(obj_cache);
31.59 }
31.60 }
31.61 @@ -176,15 +176,15 @@
31.62 struct hash_iterate_context *iter;
31.63 void *key, *value;
31.64
31.65 - iter = hash_iterate_init(cache->objects);
31.66 - while (hash_iterate(iter, &key, &value)) {
31.67 + iter = hash_table_iterate_init(cache->objects);
31.68 + while (hash_table_iterate(iter, &key, &value)) {
31.69 struct acl_object_cache *obj_cache = value;
31.70
31.71 acl_cache_free_object_cache(obj_cache);
31.72 }
31.73 - hash_iterate_deinit(&iter);
31.74 + hash_table_iterate_deinit(&iter);
31.75
31.76 - hash_clear(cache->objects, FALSE);
31.77 + hash_table_clear(cache->objects, FALSE);
31.78 }
31.79
31.80 static void
31.81 @@ -271,12 +271,12 @@
31.82 {
31.83 struct acl_object_cache *obj_cache;
31.84
31.85 - obj_cache = hash_lookup(cache->objects, objname);
31.86 + obj_cache = hash_table_lookup(cache->objects, objname);
31.87 if (obj_cache == NULL) {
31.88 obj_cache = i_malloc(sizeof(struct acl_object_cache) +
31.89 cache->validity_rec_size);
31.90 obj_cache->name = i_strdup(objname);
31.91 - hash_insert(cache->objects, obj_cache->name, obj_cache);
31.92 + hash_table_insert(cache->objects, obj_cache->name, obj_cache);
31.93 *created_r = TRUE;
31.94 } else {
31.95 *created_r = FALSE;
31.96 @@ -362,7 +362,7 @@
31.97 {
31.98 struct acl_object_cache *obj_cache;
31.99
31.100 - obj_cache = hash_lookup(cache->objects, objname);
31.101 + obj_cache = hash_table_lookup(cache->objects, objname);
31.102 return obj_cache == NULL ? NULL : (obj_cache + 1);
31.103 }
31.104
31.105 @@ -404,7 +404,7 @@
31.106 {
31.107 struct acl_object_cache *obj_cache;
31.108
31.109 - obj_cache = hash_lookup(cache->objects, objname);
31.110 + obj_cache = hash_table_lookup(cache->objects, objname);
31.111 if (obj_cache == NULL ||
31.112 obj_cache->my_current_rights == &negative_cache_entry)
31.113 return NULL;