aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2008-01-13 12:40:45 +0000
committerFrederic Culot <calcurse@culot.org>2008-01-13 12:40:45 +0000
commit738a3a417071bfaed53297cbefad39b996e55dfb (patch)
tree006b954aa80383c18ed030d1be3f08855d54a2f8 /src/utils.c
parentb7115fbcf2a3a53d52f73ce0693075ab50de96f5 (diff)
downloadcalcurse-738a3a417071bfaed53297cbefad39b996e55dfb.tar.gz
calcurse-738a3a417071bfaed53297cbefad39b996e55dfb.zip
Ability to attach notes to appointments and events added
Diffstat (limited to 'src/utils.c')
-rwxr-xr-xsrc/utils.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c
index d2963a5..22cda23 100755
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,8 +1,8 @@
-/* $calcurse: utils.c,v 1.38 2007/12/30 16:27:59 culot Exp $ */
+/* $calcurse: utils.c,v 1.39 2008/01/13 12:40:45 culot Exp $ */
/*
* Calcurse - text-based organizer
- * Copyright (c) 2004-2007 Frederic Culot
+ * Copyright (c) 2004-2008 Frederic Culot
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -900,3 +900,20 @@ new_tempfile(const char *prefix, int trailing_len)
return (strdup(fullname + prefix_len));
}
+
+/* Erase a note previously attached to a todo, event or appointment. */
+void
+erase_note(char **note)
+{
+ char fullname[BUFSIZ];
+
+ if (*note == NULL)
+ ierror(_("FATAL ERROR in erase_note: null pointer!\n"),
+ IERROR_FATAL);
+ snprintf(fullname, BUFSIZ, "%s%s", path_notes, *note);
+ if (unlink(fullname) != 0)
+ ierror(_("FATAL ERROR in erase_note: could not remove note\n"),
+ IERROR_FATAL);
+ free(*note);
+ *note = NULL;
+}