gpg: Store the Tofu meta handle for databases in CTRL.
authorWerner Koch <wk@gnupg.org>
Sat, 21 May 2016 10:26:44 +0000 (12:26 +0200)
committerWerner Koch <wk@gnupg.org>
Sat, 21 May 2016 10:26:44 +0000 (12:26 +0200)
commit754b1c463034a634a678d8efc76c27fd46aad9b9
treef83aa8b328058ebc57a016f0a854009f5cffc2cf
parent027c4e55522b8e18711a3331932a9869ab89ca26
gpg: Store the Tofu meta handle for databases in CTRL.

* g10/gpg.h (struct tofu_dbs_s, tofu_dbs_t): New declarations.
(struct server_control_s): Add field tofu.dbs.
* g10/tofu.c (struct dbs): Rename to tofu_dbs_s.  Replace all users by
by tofu_dbs_t.
(opendbs):  Add arg CTRL.  Cache the DBS in CTRL.
(closedbs): Rename to tofu_closedbs and make global.  Add arg CTRL.
(tofu_register): Add arg CTRL.  Change all callers.  Do not call
closedbs.
(tofu_get_validity): Ditto.
(tofu_set_policy): Ditto.
(tofu_get_policy): Ditto.
(tofu_set_policy_by_keyid): Add arg CTRL.
* g10/gpg.c (gpg_deinit_default_ctrl): Call tofu_closedbs.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/gpg.c
g10/gpg.h
g10/gpgv.c
g10/keyedit.c
g10/keylist.c
g10/test-stubs.c
g10/tofu.c
g10/tofu.h
g10/trustdb.c