- int flag;
- FILE* board_file;
- int height, width;
- int x, y;
- int ch;
- WINDOW* todo_win;
-
- signal(SIGWINCH, winch_handler);
-
- // read command line args
- flag = getopt(argc, argv, "o:n:");
- switch (flag) {
- case 'o':
-
- // read from task file (might need to check for read and write permissions)
- board_file = fopen(optarg, "r");
- if (!board_file) {
- printf("%s does not exist\n", optarg);
- return 1;
- }
-
- char** todos = read_todo(board_file);
- printf(todos[0]);
- fclose(board_file);
-
- break;
-
- case 'n':
-
- // make sure file does not exist
- // however, it maybe be possible that an different error has occured (besides the file not existing)
- if (access(optarg, F_OK) == 0) {
- printf("%s already exists\n", optarg);
- return 1;
+ Board* board;
+
+ board = begin_parse("test_board.md");
+
+ for (int i = 0; i < board->todolist_count; i++) {
+ TodoList* todolist;
+ printf("List =-=-=-=-=-==-=-=-=-=-=-\n");
+ todolist = board->todolist_list[i];
+ printf("List name: %s\n", todolist->list_name);
+ printf("Num of items: %d\n", todolist->item_count);
+
+ for (int j = 0; j < todolist->item_count; j++) {
+ TodoItem* todoitem;
+ printf("Item =-=-=-=-=-\n");
+ todoitem = todolist->item_list[j];
+ printf("Item name: %s\n", todoitem->item_name);
+ printf("Description: %s\n", todoitem->description);
+ printf("Num of subtasks: %d\n", todoitem->subtask_count);
+
+ for (int k = 0; k < todoitem->subtask_count; k++) {
+ SubTask* subtask;
+ int done;
+
+ subtask = todoitem->subtask_list[k];
+ printf("Subtask: %s, %d\n", subtask->subtask_name, subtask->done);