From 8d73eace6806bd67852189b1a16de5895c565688 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Mon, 1 May 2023 23:35:16 +0200 Subject: 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. --- src/dged/buffer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/dged/buffer.h') 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 #include #include +#include #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, -- cgit v1.2.3