source: admin/Sources/Services/ogAdmServer/sources/schedule.h @ 1de0d12d

Last change on this file since 1de0d12d was 3b6c2d8, checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago

#942 Fix immediate procedures

New versions of ogAdmServer handle pending commands in a different way.
Instant procedures uses the old way, now unsupported, so we need to
adapt instant procedures.

This commit adapts instant procedures to work with the new pending
commands implementation.

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[d327da6]1#ifndef _OG_SCHEDULE_H_
2#define _OG_SCHEDULE_H_
3
4#include <stdint.h>
[23dc851]5#include <stdbool.h>
[d327da6]6#include "dbi.h"
7#include "list.h"
8#include <ev.h>
9
10struct og_schedule_time {
11        uint32_t        years;
12        uint32_t        months;
13        uint32_t        weeks;
14        uint32_t        week_days;
15        uint32_t        days;
16        uint32_t        hours;
17        uint32_t        am_pm;
18        uint32_t        minutes;
[23dc851]19        bool            on_start;
[d327da6]20};
21
[6b58007]22enum og_schedule_type {
23        OG_SCHEDULE_TASK,
[3b6c2d8]24        OG_SCHEDULE_PROCEDURE,
[58fc387]25        OG_SCHEDULE_COMMAND,
[6b58007]26};
27
[d327da6]28struct og_schedule {
29        struct list_head        list;
30        struct ev_timer         timer;
31        time_t                  seconds;
32        unsigned int            task_id;
33        unsigned int            schedule_id;
[6b58007]34        enum og_schedule_type   type;
[d327da6]35};
36
37void og_schedule_create(unsigned int schedule_id, unsigned int task_id,
[6b58007]38                        enum og_schedule_type type,
[d327da6]39                        struct og_schedule_time *time);
40void og_schedule_update(struct ev_loop *loop, unsigned int schedule_id,
41                        unsigned int task_id, struct og_schedule_time *time);
42void og_schedule_delete(struct ev_loop *loop, uint32_t schedule_id);
43void og_schedule_next(struct ev_loop *loop);
44void og_schedule_refresh(struct ev_loop *loop);
[58fc387]45void og_schedule_run(unsigned int task_id, unsigned int schedule_id,
46                     enum og_schedule_type type);
[d327da6]47
48#endif
Note: See TracBrowser for help on using the repository browser.