55 #if !defined(__AMXP_CRON_H__)
56 #define __AMXP_CRON_H__
65 #include <amxc/amxc_timestamp.h>
278 const char* days_of_week);
int amxp_cron_build_weekly(amxp_cron_expr_t *target, const char *time, const char *days_of_week)
Builds a weekly cron expression that is triggered at a certain time on certain days of the week.
int amxp_cron_init(amxp_cron_expr_t *cron_expr)
Initializes an amxp_cron_expr_t structures to every second.
int64_t amxp_cron_time_until_next(const amxp_cron_expr_t *expr, bool local)
Calculates the time in seconds until next trigger of a parsed cron expression occurs.
int amxp_cron_new(amxp_cron_expr_t **cron_expr)
Allocates an amxp_cron_expr_t structures and initializes it to every second.
int amxp_cron_parse_expr(amxp_cron_expr_t *target, const char *expression, const char **error)
Allocates and initializes an amxp_cron_expr_t structures and parses the given cron expression.
void amxp_cron_clean(amxp_cron_expr_t *cron_expr)
Resets the amxp_cron_expr_t structure to the initialized state.
struct _cron_expr amxp_cron_expr_t
Structure containing parsed cron expression.
int amxp_cron_prev(const amxp_cron_expr_t *expr, const amxc_ts_t *ref, amxc_ts_t *next)
Calculates the previous trigger time for a parsed cron expression.
void amxp_cron_delete(amxp_cron_expr_t **cron_expr)
Frees the previously allocated amxp_cron_expr_t structure.
int amxp_cron_next(const amxp_cron_expr_t *expr, const amxc_ts_t *ref, amxc_ts_t *next)
Calculates the next trigger time for a parsed cron expression.
Structure containing parsed cron expression.