-void
-winch_handler(int sig)
-{
- endwin();
- refresh();
-}
-
-char**
-read_todo(FILE* file, int* length)
-{ // apparently getline isn't rly that portable, so consider other options
- char** out_arr;
- int out_len;
- char* lineptr;
- size_t len;
- ssize_t nread;
-
- out_arr = NULL;
- out_len = 0;
- lineptr = NULL;
- len = 0;
-
- while ((nread = getline(&lineptr, &len, file)) != -1) {
- out_len++;
- out_arr = realloc(out_arr, (sizeof(char*))*out_len); // bad to keep resizing?
- out_arr[out_len-1] = lineptr;
-
- lineptr = NULL;
- len = 0;
- }
-
- *length = out_len;
- return out_arr;
-}
-
-WINDOW*
-create_list_win(int height, int width, int y, int x)
-{
- WINDOW* new_win = newwin(height, width, y, x);
- wrefresh(new_win);
- return new_win;
-}
-
-void
-draw_todo(WINDOW* todo_win, char** todo_list, int todo_length) {
- for (int i = 0; i < todo_length; i++) {
- mvwprintw(todo_win, i+1, 2, todo_list[i]);
- }
- box(todo_win, 0, 0);
- wrefresh(todo_win);
-}