diff options
| author | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-02-10 08:09:36 +0100 |
|---|---|---|
| committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-02-10 08:09:36 +0100 |
| commit | 76331a6493712754c757554f080a2e1be39a5ad4 (patch) | |
| tree | 3e363c76cc7d9cda46b4b6d7a2667878e87f2bcd /src/libcharon/processing | |
| parent | 8125dcca59748c93a5e0020f3c118f0807d1bf95 (diff) | |
| download | strongswan-76331a6493712754c757554f080a2e1be39a5ad4.tar.bz2 strongswan-76331a6493712754c757554f080a2e1be39a5ad4.tar.xz | |
Migrated process_message_job_t to INIT/METHOD macros
Diffstat (limited to 'src/libcharon/processing')
| -rw-r--r-- | src/libcharon/processing/jobs/process_message_job.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/libcharon/processing/jobs/process_message_job.c b/src/libcharon/processing/jobs/process_message_job.c index a47d48e38..b6de4fc0f 100644 --- a/src/libcharon/processing/jobs/process_message_job.c +++ b/src/libcharon/processing/jobs/process_message_job.c @@ -35,19 +35,15 @@ struct private_process_message_job_t { message_t *message; }; -/** - * Implements job_t.destroy. - */ -static void destroy(private_process_message_job_t *this) +METHOD(job_t, destroy, void, + private_process_message_job_t *this) { this->message->destroy(this->message); free(this); } -/** - * Implementation of job_t.execute. - */ -static void execute(private_process_message_job_t *this) +METHOD(job_t, execute, void, + private_process_message_job_t *this) { ike_sa_t *ike_sa; @@ -93,14 +89,17 @@ static void execute(private_process_message_job_t *this) */ process_message_job_t *process_message_job_create(message_t *message) { - private_process_message_job_t *this = malloc_thing(private_process_message_job_t); - - /* interface functions */ - this->public.job_interface.execute = (void (*) (job_t *)) execute; - this->public.job_interface.destroy = (void(*)(job_t*))destroy; + private_process_message_job_t *this; - /* private variables */ - this->message = message; + INIT(this, + .public = { + .job_interface = { + .execute = _execute, + .destroy = _destroy, + }, + }, + .message = message, + ); return &(this->public); } |
