aboutsummaryrefslogtreecommitdiffstats
path: root/src/note.c
diff options
context:
space:
mode:
authorAmbika Eshwar <cepheac@protonmail.ch>2020-09-29 02:16:25 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2020-10-11 09:59:37 -0400
commitb144b19964fcd5cfb99526641751823dea9bee9d (patch)
treef22109a0609be2868090c94efa24ed61a14745b9 /src/note.c
parent1b40844aa3b7a94fd84533ed6ef78a5c5cbac5f1 (diff)
downloadcalcurse-b144b19964fcd5cfb99526641751823dea9bee9d.tar.gz
calcurse-b144b19964fcd5cfb99526641751823dea9bee9d.zip
Implemented rendering of notes in todo view
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/note.c')
-rw-r--r--src/note.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/note.c b/src/note.c
index 92c1ecf..40e0882 100644
--- a/src/note.c
+++ b/src/note.c
@@ -155,6 +155,17 @@ void note_read(char *buffer, FILE * fp)
buffer[MAX_NOTESIZ] = '\0';
}
+/* Read the contents of a note file */
+void note_read_contents(char *buffer, size_t buffer_len, FILE * fp)
+{
+ size_t read_count = fread(buffer, 1, buffer_len, fp);
+ if (read_count != buffer_len)
+ buffer[read_count] = '\0';
+ else
+ memcpy(&buffer[buffer_len - 4], "...\0", 4);
+}
+
+
static void
note_gc_extract_key(struct note_gc_hash *data, const char **key, int *len)
{