summaryrefslogtreecommitdiff
path: root/src/dged/buffer.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-05-01 23:35:16 +0200
committerAlbert Cervin <albert@acervin.com>2023-05-01 23:35:16 +0200
commit8d73eace6806bd67852189b1a16de5895c565688 (patch)
treed3071f31f535189adeb768cf742ec68f017ae9d9 /src/dged/buffer.h
parenta123725a12e948d78badb2cb686d38548f1c633b (diff)
downloaddged-8d73eace6806bd67852189b1a16de5895c565688.tar.gz
dged-8d73eace6806bd67852189b1a16de5895c565688.tar.xz
dged-8d73eace6806bd67852189b1a16de5895c565688.zip
Implement buffer reload
Currently only implemented on the buffer itself, and will discard any pending changes to the buffer. Idea is to use a command to detect that state and warn the user.
Diffstat (limited to 'src/dged/buffer.h')
-rw-r--r--src/dged/buffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dged/buffer.h b/src/dged/buffer.h
index 539c427..b9edf4a 100644
--- a/src/dged/buffer.h
+++ b/src/dged/buffer.h
@@ -1,6 +1,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#include <time.h>
#include "bits/stdint-uintn.h"
#include "command.h"
@@ -138,6 +139,8 @@ struct buffer {
/** Associated filename, this is where the buffer will be saved to */
char *filename;
+ struct timespec last_write;
+
/** Text data structure */
struct text *text;
@@ -213,6 +216,7 @@ uint32_t buffer_add_create_hook(create_hook_cb hook, void *userdata);
struct buffer buffer_from_file(char *filename);
void buffer_to_file(struct buffer *buffer);
void buffer_write_to(struct buffer *buffer, const char *filename);
+void buffer_reload(struct buffer *buffer);
void buffer_update(struct buffer_view *view, uint32_t width, uint32_t height,
struct command_list *commands, uint64_t frame_time,