You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
770 B
C
42 lines
770 B
C
/*
|
|
* task.h: declares functions for manipulation with tasks
|
|
*/
|
|
|
|
#ifndef TASK_H
|
|
#define TASK_H
|
|
|
|
#include <stdbool.h>
|
|
#include <time.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
struct task {
|
|
// Time info
|
|
struct itimerspec times;
|
|
timer_t timerid;
|
|
|
|
// Command to run
|
|
char **argv; //NULL terminated list of NUL terminated strings
|
|
|
|
// Formula to be checked when running
|
|
char *formula; // in RPN, NUL terminated
|
|
bool run; // dynamic programming
|
|
|
|
// Disabling/enabling
|
|
bool enabled;
|
|
};
|
|
|
|
bool task_add(struct task t);
|
|
bool task_disable(uint64_t id);
|
|
bool task_enable(uint64_t id);
|
|
bool task_delete(uint64_t id);
|
|
|
|
struct grow *task_list(void);
|
|
struct task task_details(uint64_t id);
|
|
void task_recalc(uint64_t id);
|
|
|
|
bool task_load(void);
|
|
bool task_save(void);
|
|
|
|
#endif
|