From 3076670a76652d538f8b3d0d925197ec2ce32dd9 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 1 Jul 2011 14:26:43 +0200 Subject: 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 --- src/io.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index f82de50..2588a29 100644 --- a/src/io.c +++ b/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__); -- cgit v1.2.3-54-g00ecf