Migrated ocsp_response_wrapper to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2011-09-29 21:48:31 +02:00
parent 4a679468a5
commit c9698de891
@@ -94,12 +94,9 @@ static void enumerator_destroy(wrapper_enumerator_t *this)
free(this); free(this);
} }
/** METHOD(credential_set_t, create_enumerator, enumerator_t*,
* implementation of ocsp_response_wrapper_t.set.create_cert_enumerator private_ocsp_response_wrapper_t *this,certificate_type_t cert,
*/ key_type_t key, identification_t *id, bool trusted)
static enumerator_t *create_enumerator(private_ocsp_response_wrapper_t *this,
certificate_type_t cert, key_type_t key,
identification_t *id, bool trusted)
{ {
wrapper_enumerator_t *enumerator; wrapper_enumerator_t *enumerator;
@@ -118,10 +115,8 @@ static enumerator_t *create_enumerator(private_ocsp_response_wrapper_t *this,
return &enumerator->public; return &enumerator->public;
} }
/** METHOD(ocsp_response_wrapper_t, destroy, void,
* Implementation of ocsp_response_wrapper_t.destroy private_ocsp_response_wrapper_t *this)
*/
static void destroy(private_ocsp_response_wrapper_t *this)
{ {
free(this); free(this);
} }
@@ -131,16 +126,21 @@ static void destroy(private_ocsp_response_wrapper_t *this)
*/ */
ocsp_response_wrapper_t *ocsp_response_wrapper_create(ocsp_response_t *response) ocsp_response_wrapper_t *ocsp_response_wrapper_create(ocsp_response_t *response)
{ {
private_ocsp_response_wrapper_t *this = malloc_thing(private_ocsp_response_wrapper_t); private_ocsp_response_wrapper_t *this;
this->public.set.create_private_enumerator = (void*)return_null; INIT(this,
this->public.set.create_cert_enumerator = (void*)create_enumerator; .public = {
this->public.set.create_shared_enumerator = (void*)return_null; .set = {
this->public.set.create_cdp_enumerator = (void*)return_null; .create_cert_enumerator = _create_enumerator,
this->public.set.cache_cert = (void*)nop; .create_private_enumerator = (void*)return_null,
this->public.destroy = (void(*)(ocsp_response_wrapper_t*))destroy; .create_shared_enumerator = (void*)return_null,
.create_cdp_enumerator = (void*)return_null,
this->response = response; .cache_cert = (void*)nop,
},
.destroy = _destroy,
},
.response = response,
);
return &this->public; return &this->public;
} }