Last change
on this file since 63c4ea5 was
63c4ea5,
checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago
|
#942 add enum og_schedule_type
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
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 | |
---|
[63c4ea5] | 20 | enum og_schedule_type { |
---|
| 21 | OG_SCHEDULE_TASK, |
---|
| 22 | }; |
---|
| 23 | |
---|
[83b242c] | 24 | struct og_schedule { |
---|
| 25 | struct list_head list; |
---|
| 26 | struct ev_timer timer; |
---|
| 27 | time_t seconds; |
---|
| 28 | unsigned int task_id; |
---|
| 29 | unsigned int schedule_id; |
---|
[63c4ea5] | 30 | enum og_schedule_type type; |
---|
[83b242c] | 31 | }; |
---|
| 32 | |
---|
| 33 | void og_schedule_create(unsigned int schedule_id, unsigned int task_id, |
---|
[63c4ea5] | 34 | enum og_schedule_type type, |
---|
[83b242c] | 35 | struct og_schedule_time *time); |
---|
| 36 | void og_schedule_update(struct ev_loop *loop, unsigned int schedule_id, |
---|
| 37 | unsigned int task_id, struct og_schedule_time *time); |
---|
| 38 | void og_schedule_delete(struct ev_loop *loop, uint32_t schedule_id); |
---|
| 39 | void og_schedule_next(struct ev_loop *loop); |
---|
| 40 | void og_schedule_refresh(struct ev_loop *loop); |
---|
[85b345d] | 41 | void og_dbi_schedule_task(unsigned int task_id, unsigned int schedule_id); |
---|
[83b242c] | 42 | |
---|
| 43 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.