aboutsummaryrefslogtreecommitdiffstats
path: root/src/calcurse.h
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-09-01 15:29:19 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-10-05 12:25:47 +0200
commit8d71923d4f498c8d2fcb22a72346e3e77a7c4a5b (patch)
treefa1566974b5bb8afc8d9f5c3da5427b7856434f2 /src/calcurse.h
parent6c7edfbb862b1598b74e4413121dfa42e3a79211 (diff)
downloadcalcurse-8d71923d4f498c8d2fcb22a72346e3e77a7c4a5b.tar.gz
calcurse-8d71923d4f498c8d2fcb22a72346e3e77a7c4a5b.zip
Add a garbage collector for note files
Now that we use hashes to identify notes, a garbage collector comes in handy. We search for note files that aren't referenced anywhere. Such files might come up if a note, that isn't connected with any other item, is edited. Huge parts of this code are very hackish due to our data structure layout and the way our hash table implementation works. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.h')
-rw-r--r--src/calcurse.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index adf9d2d..956010d 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -145,6 +145,9 @@
#define KEYS_LABELEN 8 /* length of command description */
#define KEYS_CMDS_PER_LINE 6 /* max number of commands per line */
+/* Size of the hash table the note garbage collector uses. */
+#define NOTE_GC_HSIZE 1024
+
#define ERROR_MSG(...) do { \
char msg[BUFSIZ]; \
int len; \
@@ -754,6 +757,7 @@ void edit_note (char **, char *);
void view_note (char *, char *);
void erase_note (char **);
void note_read (char *, FILE *);
+void note_gc (void);
/* notify.c */
int notify_time_left (void);