1
0
Fork 0
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.

48 lines
925 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>
enum task_check { // whether to check formula in signal handler or when variable changes
SIGNAL, VARCHG
};
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
enum task_check when;
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);
void task_flush(void);
#endif