5 typedef struct TodoItem {
12 void parse(FILE* file, int* length);
15 static char task_md[] = "###";
18 main(int argc, char** argv)
23 input_file = fopen("test_board.md", "r");
25 printf("Something went wrong opening file");
29 parse(input_file, &todo_length);
36 parse(FILE* file, int* length)
49 while ((nread = getline(&lineptr, &len, file)) != -1) {
51 lineptr[strcspn(lineptr, "\n")] = 0; // remove newline
53 if (strcmp(lineptr, "") == 0) {
54 printf("found empty line\n");
60 if (strlen(lineptr) > 3 && strncmp(lineptr, task_md, 3) == 0) {
61 printf("found_task\n");
69 /* out_arr = realloc(out_arr, (sizeof(char*))*out_len); // bad to keep resizing? */
71 /* out_arr[out_len-1] = lineptr; */