aboutsummaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-06 21:49:19 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-06 21:49:19 +0200
commit22d843e6719c025bf6d711bfdd3644e442ee8966 (patch)
tree67a52cf274e92759696d99d1a1dd932e5e369394 /text.h
parent071b5f3c94c4b157a153586b087229f9e6b465d3 (diff)
downloadvis-22d843e6719c025bf6d711bfdd3644e442ee8966.tar.gz
vis-22d843e6719c025bf6d711bfdd3644e442ee8966.tar.xz
Warn when saving a file which has been changed outside the editor
Diffstat (limited to 'text.h')
-rw-r--r--text.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/text.h b/text.h
index 725fa26..16b4a45 100644
--- a/text.h
+++ b/text.h
@@ -3,7 +3,9 @@
#include <stdbool.h>
#include <time.h>
+#include <unistd.h>
#include <sys/types.h>
+#include <sys/stat.h>
#define EPOS ((size_t)-1) /* invalid position */
@@ -35,6 +37,8 @@ typedef struct {
text_iterator_next(&it))
Text *text_load(const char *file);
+/* file information at time of load or last save */
+struct stat text_stat(Text*);
bool text_insert(Text*, size_t pos, const char *data, size_t len);
bool text_delete(Text*, size_t pos, size_t len);
void text_snapshot(Text*);