Refactor out todo item serialization
Add a todo_write() function that allows one to serialize todo items and write serialized data to an output stream in a fashion similar to apoint_write() and event_write(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
5
src/io.c
5
src/io.c
@@ -1023,10 +1023,7 @@ io_save_todo (void)
|
||||
LLIST_FOREACH (&todolist, i)
|
||||
{
|
||||
struct todo *todo = LLIST_TS_GET_DATA (i);
|
||||
if (todo->note)
|
||||
(void)fprintf (fp, "[%d]>%s %s\n", todo->id, todo->note, todo->mesg);
|
||||
else
|
||||
(void)fprintf (fp, "[%d] %s\n", todo->id, todo->mesg);
|
||||
todo_write (todo, fp);
|
||||
}
|
||||
file_close (fp, __FILE_POS__);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user