diff options
author | Martin Willi <martin@revosec.ch> | 2010-08-10 13:52:13 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2010-08-10 18:46:30 +0200 |
commit | 646babd3545f5fd0e17a1c50b2e874db7dc3cd11 (patch) | |
tree | 4dc90cb0852554e0bed51a15b878228480a66ac0 /src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | |
parent | 876b61e132977d64e24d1932d0c5cfd9649785c7 (diff) | |
download | strongswan-646babd3545f5fd0e17a1c50b2e874db7dc3cd11.tar.bz2 strongswan-646babd3545f5fd0e17a1c50b2e874db7dc3cd11.tar.xz |
Migraded gcrypt plugin to INIT/METHOD macros
Diffstat (limited to 'src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c')
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c index 039036b2c..99f9f2fe4 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c @@ -93,10 +93,8 @@ static struct gcry_thread_cbs thread_functions = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -/** - * Implementation of gcrypt_plugin_t.destroy - */ -static void destroy(private_gcrypt_plugin_t *this) +METHOD(plugin_t, destroy, void, + private_gcrypt_plugin_t *this) { lib->crypto->remove_hasher(lib->crypto, (hasher_constructor_t)gcrypt_hasher_create); @@ -139,9 +137,9 @@ plugin_t *gcrypt_plugin_create() } gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); - this = malloc_thing(private_gcrypt_plugin_t); - - this->public.plugin.destroy = (void(*)(plugin_t*))destroy; + INIT(this, + .public.plugin.destroy = _destroy, + ); /* hashers */ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, |