From 3795ff735a780a9c5028e03c175518a4fd103de1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 16 Oct 2015 01:33:17 +0100 Subject: 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. --- src/buffer_utils.hh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/buffer_utils.hh') 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); -- cgit v1.2.3