changes in popup menu is now preserved
[taskasaur.git] / headers / parser.h
1
2 #ifndef __PARSER_H__
3 #define __PARSER_H__
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <assert.h>
9 #include <md4c.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 typedef enum SubTaskState {
16     SubTaskState_todo,
17     SubTaskState_done
18 } SubTaskState;
19
20 typedef struct SubTask {
21     char* subtask_name;
22     SubTaskState done;
23 } SubTask;
24
25 typedef struct TodoItem {
26     char* item_name;
27     char* description;
28     char* due;
29     SubTask** subtask_list;
30     int subtask_count;
31 } TodoItem;
32
33 typedef struct TodoList {
34     char* list_name;
35     TodoItem** item_list;
36     int item_count;
37 } TodoList;
38
39 typedef struct Board {
40     char* board_name;
41     TodoList** todolist_list;
42     int todolist_count;
43 } Board;
44
45 extern Board* begin_parse(char* board_path);
46 extern int begin_write(char* board_path, Board* board);
47 extern void log_todo(Board* board);
48 extern int free_board(Board* board);
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif