2 * Copyright (C) 2011 Martin Willi
3 * Copyright (C) 2011 revosec AG
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup certexpire_cron certexpire_cron
18 * @{ @ingroup certexpire
21 #ifndef CERTEXPIRE_CRON_H_
22 #define CERTEXPIRE_CRON_H_
24 typedef struct certexpire_cron_t certexpire_cron_t
;
27 * Callback function invoked by cron.
29 * @param data user specified callback data
31 typedef void (*certexpire_cron_job_t
)(void *data
);
34 * Cron style job scheduling.
36 struct certexpire_cron_t
{
39 * Destroy a certexpire_cron_t.
41 * It currently is not possible to savely cancel a cron job. Make sure
42 * any scheduled jobs have been canceled before cleaning up.
44 void (*destroy
)(certexpire_cron_t
*this);
48 * Create a certexpire_cron instance.
50 * The cron string takes numeric arguments only, but supports ranges (1-5)
51 * and selections (1,3,5), or a combination, space separated:
52 * minute hour day month weekday
57 * weekday, 0-7 (0 == 7 == sunday)
58 * man crontab(5) for details.
60 * @param cron cron style scheduling string
61 * @param job callback function to invoke
62 * @param data user data to pass to job
64 certexpire_cron_t
*certexpire_cron_create(char *cron
, certexpire_cron_job_t job
,
67 #endif /** CERTEXPIRE_CRON_H_ @}*/