diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-07-01 14:26:43 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-07-02 10:15:35 +0200 |
commit | 3076670a76652d538f8b3d0d925197ec2ce32dd9 (patch) | |
tree | 80a90e859b8a7e7c41e7966c21eecefaac82266c /src/io.c | |
parent | 29d71935afdfb18391cd2450814ba53f1739518e (diff) | |
download | calcurse-3076670a76652d538f8b3d0d925197ec2ce32dd9.zip |
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>
Diffstat (limited to 'src/io.c')
-rw-r--r-- | src/io.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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__); |