From 68a2b8706a41273b27dc3cfefbafd2c19dba7645 Mon Sep 17 00:00:00 2001 From: Ariadna Vigo Date: Fri, 19 Jun 2020 16:03:23 +0200 Subject: Initial commit --- tasklst.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tasklst.h (limited to 'tasklst.h') diff --git a/tasklst.h b/tasklst.h new file mode 100644 index 0000000..4e75614 --- /dev/null +++ b/tasklst.h @@ -0,0 +1,26 @@ +/* See LICENSE file for copyright and license details. */ + +#define TASK_LST_MAX_NUM 11 +#define TASK_LST_DESC_MAX_SIZE 64 +#define TASK_LST_EXPIRY 86400 /* 86400 secs = 24 hrs */ + +enum { + TASK_VOID, + TASK_TODO, + TASK_DONE +}; + +typedef struct { + time_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); +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_read_from_file(TaskLst *tasks, FILE *fp); +void tasklst_write_to_file(FILE *fp, TaskLst tasks); \ No newline at end of file -- cgit v1.2.3