From 1566b6faa8534118c3566188181367cd0868468f Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 9 Nov 2023 23:19:53 +0100 Subject: Added partial matching and introduced threads --- examples/dte/file-history.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/dte/file-history.h (limited to 'examples/dte/file-history.h') diff --git a/examples/dte/file-history.h b/examples/dte/file-history.h new file mode 100644 index 0000000..0a51891 --- /dev/null +++ b/examples/dte/file-history.h @@ -0,0 +1,29 @@ +#ifndef FILE_HISTORY_H +#define FILE_HISTORY_H + +#include +#include "util/hashmap.h" +#include "util/macros.h" + +typedef struct FileHistoryEntry { + struct FileHistoryEntry *next; + struct FileHistoryEntry *prev; + char *filename; + unsigned long row; + unsigned long col; +} FileHistoryEntry; + +typedef struct { + char *filename; + HashMap entries; + FileHistoryEntry *first; + FileHistoryEntry *last; +} FileHistory; + +void file_history_add(FileHistory *hist, unsigned long row, unsigned long col, const char *filename); +void file_history_load(FileHistory *hist, char *filename); +void file_history_save(const FileHistory *hist); +bool file_history_find(const FileHistory *hist, const char *filename, unsigned long *row, unsigned long *col) WARN_UNUSED_RESULT; +void file_history_free(FileHistory *history); + +#endif -- cgit v1.2.3