summaryrefslogtreecommitdiff
path: root/src/buffer_utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-10-16 01:33:17 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-10-17 11:33:09 +0100
commit3795ff735a780a9c5028e03c175518a4fd103de1 (patch)
tree227cbd579aedfc819b3c926557fd1061b97657d2 /src/buffer_utils.hh
parent776059a4c3742c0208d8b90876ead95399ef7b13 (diff)
Refactor buffer creation and reloading to be more explicit
Reloading used to be implicit in the buffer creation function, which is not always nice, as code that explicitely wanted to reload a buffer could not say so.
Diffstat (limited to 'src/buffer_utils.hh')
-rw-r--r--src/buffer_utils.hh10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh
index ab02451f..e9262c06 100644
--- a/src/buffer_utils.hh
+++ b/src/buffer_utils.hh
@@ -30,11 +30,13 @@ CharCount get_column(const Buffer& buffer,
ByteCount get_byte_to_column(const Buffer& buffer, CharCount tabstop,
CharCoord coord);
-Buffer* create_fifo_buffer(String name, int fd, bool scroll = false);
+Buffer* create_buffer(StringView data, StringView name,
+ Buffer::Flags flags, timespec fs_timestamp);
+void reload_buffer(Buffer& buffer, StringView data, timespec fs_timestamp);
-Buffer* create_buffer_from_data(StringView data, StringView name,
- Buffer::Flags flags,
- timespec fs_timestamp = InvalidTime);
+Buffer* create_fifo_buffer(String name, int fd, bool scroll = false);
+Buffer* create_file_buffer(StringView filename);
+bool reload_file_buffer(Buffer& buffer);
void write_to_debug_buffer(StringView str);