- job_t is now defined in its own files job.h and job.c
[strongswan.git] / Source / charon / job.c
1 /**
2 * @file job.c
3 *
4 * @brief Job-Class representing a job e.g. in job_queue
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #include <stdlib.h>
24 #include <freeswan.h>
25 #include <pluto/constants.h>
26 #include <pluto/defs.h>
27
28 #include "job.h"
29
30 /**
31 * @brief implements function destroy of job_t
32 */
33 static status_t job_destroy(job_t *job)
34 {
35 pfree(job);
36 return SUCCESS;
37 }
38
39 /*
40 * Creates a job (documented in header-file)
41 */
42 job_t *job_create(job_type_t type, void *assigned_data)
43 {
44 job_t *this = alloc_thing(job_t, "job_t");
45
46 this->destroy = job_destroy;
47
48 this->type = type;
49 this->assigned_data = assigned_data;
50
51 return this;
52 }