diff options
author | Ariadna Vigo <arivigodr@gmail.com> | 2020-06-19 16:03:23 +0200 |
---|---|---|
committer | Ariadna Vigo <arivigodr@gmail.com> | 2020-06-19 16:03:23 +0200 |
commit | 68a2b8706a41273b27dc3cfefbafd2c19dba7645 (patch) | |
tree | d632a5e09b8b0f360d478e46c46fb194995f9d6c /tasklst.h |
Initial commit
Diffstat (limited to 'tasklst.h')
-rw-r--r-- | tasklst.h | 26 |
1 files changed, 26 insertions, 0 deletions
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 |