+ //Not implemented yet...
+ return false;
+ (void)t;
+}
+
+struct task *task_head(void)
+{
+ return mem_task == mem_bottom ? NULL : (struct task *)mem_bottom;
+}
+
+struct task *task_next(struct task *t)
+{
+ uint8_t *next = (uint8_t *)t + sizeof(struct task) + t->tasklength;
+ return next >= mem_task ? NULL : (struct task *)next;
+}
+
+void task_delete(uint8_t c)
+{
+ debug("Going to delete task: %i", c);
+ struct task *t = task_head();
+ while(t != NULL){
+ if(t->taskid == c){
+ break;
+ }
+ t = task_next(t);
+ }
+ //Write deletion spec
+ write_byte('d');
+ write16(c);
+ write_byte('\n');
+
+ if(t != NULL){
+ //We found the task, now we move everything from the end of the task up
+ //to the spacepointer right
+ uint8_t *start = (uint8_t *)t;
+ uint8_t *end = start + sizeof(struct task) + t->tasklength;
+ debug("Moving %lu bytes\n", mem_task-end);
+ for(int i = 0; i<mem_task-end; i++){
+ start[i] = end[i];
+ }
+
+ //Decrement the spacepointer
+ mem_task -= end-start;
+ }