source: ogServer-Git/sources/schedule.h @ 8fa9ec6

Last change on this file since 8fa9ec6 was 85b345d, checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago

#942 Add tasks to queue

  • Property mode set to 100644
File size: 919 bytes
Line 
1#ifndef _OG_SCHEDULE_H_
2#define _OG_SCHEDULE_H_
3
4#include <stdint.h>
5#include "dbi.h"
6#include "list.h"
7#include <ev.h>
8
9struct og_schedule_time {
10        uint32_t        years;
11        uint32_t        months;
12        uint32_t        weeks;
13        uint32_t        week_days;
14        uint32_t        days;
15        uint32_t        hours;
16        uint32_t        am_pm;
17        uint32_t        minutes;
18};
19
20struct og_schedule {
21        struct list_head        list;
22        struct ev_timer         timer;
23        time_t                  seconds;
24        unsigned int            task_id;
25        unsigned int            schedule_id;
26};
27
28void og_schedule_create(unsigned int schedule_id, unsigned int task_id,
29                        struct og_schedule_time *time);
30void og_schedule_update(struct ev_loop *loop, unsigned int schedule_id,
31                        unsigned int task_id, struct og_schedule_time *time);
32void og_schedule_delete(struct ev_loop *loop, uint32_t schedule_id);
33void og_schedule_next(struct ev_loop *loop);
34void og_schedule_refresh(struct ev_loop *loop);
35void og_dbi_schedule_task(unsigned int task_id, unsigned int schedule_id);
36
37#endif
Note: See TracBrowser for help on using the repository browser.