Last change
on this file since b31e7dd 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
|
Rev | Line | |
---|
[83b242c] | 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 | |
---|
| 9 | struct 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 | |
---|
| 20 | struct 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 | |
---|
| 28 | void og_schedule_create(unsigned int schedule_id, unsigned int task_id, |
---|
| 29 | struct og_schedule_time *time); |
---|
| 30 | void og_schedule_update(struct ev_loop *loop, unsigned int schedule_id, |
---|
| 31 | unsigned int task_id, struct og_schedule_time *time); |
---|
| 32 | void og_schedule_delete(struct ev_loop *loop, uint32_t schedule_id); |
---|
| 33 | void og_schedule_next(struct ev_loop *loop); |
---|
| 34 | void og_schedule_refresh(struct ev_loop *loop); |
---|
[85b345d] | 35 | void og_dbi_schedule_task(unsigned int task_id, unsigned int schedule_id); |
---|
[83b242c] | 36 | |
---|
| 37 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.