~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-sql/sql-db-cache.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2004-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2004-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "array.h"
20
20
};
21
21
 
22
22
struct sql_db_cache {
23
 
        struct hash_table *dbs;
 
23
        HASH_TABLE(char *, struct sql_db *) dbs;
24
24
        unsigned int unused_count, max_unused_connections;
25
25
        struct sql_db *unused_tail, *unused_head;
26
26
};
128
128
        struct sql_db_cache *cache;
129
129
 
130
130
        cache = i_new(struct sql_db_cache, 1);
131
 
        cache->dbs = hash_table_create(default_pool, default_pool, 0, str_hash,
132
 
                                       (hash_cmp_callback_t *)strcmp);
 
131
        hash_table_create(&cache->dbs, default_pool, 0, str_hash, strcmp);
133
132
        cache->max_unused_connections = max_unused_connections;
134
133
        return cache;
135
134
}