summaryrefslogtreecommitdiffstats
path: root/tasklst.h
blob: c4be946561a7dd5bd4e1d7b9d83dfa559e0cb6c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* See LICENSE file for copyright and license details. */

#define TASK_LST_MAX_NUM 11
#define TASK_LST_DESC_MAX_SIZE 64

enum {
	TASK_VOID,
	TASK_TODO,
	TASK_DONE
};

typedef struct {
	int64_t expiry;
	int status[TASK_LST_MAX_NUM];
	char tdesc[TASK_LST_MAX_NUM][TASK_LST_DESC_MAX_SIZE];
} TaskLst;

void tasklst_init(TaskLst *tasks);
void tasklst_set_expiration(TaskLst *tasks, int64_t delta);
int tasklst_expired(TaskLst tasks);
int tasklst_tasks_total(TaskLst tasks);
int tasklst_tasks_todo(TaskLst tasks);
int tasklst_tasks_done(TaskLst tasks);
int tasklst_add_task(TaskLst *tasks, int status, const char *str);
int tasklst_read_from_file(TaskLst *tasks, FILE *fp);
void tasklst_write_to_file(FILE *fp, TaskLst tasks);