summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriadna Vigo <arivigodr@gmail.com>2020-09-29 19:12:26 +0200
committerAriadna Vigo <arivigodr@gmail.com>2020-09-29 19:12:26 +0200
commit9400c00b9a7fb535b2a36edc5948bc3833cbc629 (patch)
tree6f3782ee7bc8c3f05db9c43284baf2c138d9434a
parent1330bcf4023df3b3c814a1d868456ddbb211a378 (diff)
Reordered code, so it matches with header
-rw-r--r--tasklst.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tasklst.c b/tasklst.c
index b64fa2d..a684b2e 100644
--- a/tasklst.c
+++ b/tasklst.c
@@ -98,6 +98,23 @@ task_lst_count_done(TaskLst list)
return task_lst_count_status(list, TASK_DONE);
}
+Task *
+task_lst_get_task(TaskLst list, int i)
+{
+ /* TODO: Maybe binary search? */
+
+ Task *ptr;
+
+ for (ptr = list.first; i > 0; ptr = ptr->next) {
+ if (ptr == NULL) /* We're out of bounds */
+ return NULL;
+
+ --i;
+ }
+
+ return ptr;
+}
+
int
task_lst_add_task(TaskLst *list, int status, const char *str)
{
@@ -147,23 +164,6 @@ task_lst_del_task(TaskLst *list, int i)
return 0;
}
-Task *
-task_lst_get_task(TaskLst list, int i) /* TODO: mv above task_lst_add_task() */
-{
- /* TODO: Maybe binary search? */
-
- Task *ptr;
-
- for (ptr = list.first; i > 0; ptr = ptr->next) {
- if (ptr == NULL) /* We're out of bounds */
- return NULL;
-
- --i;
- }
-
- return ptr;
-}
-
int
task_lst_read_from_file(TaskLst *list, FILE *fp)
{