From 8cfcfb6309c0399c3e5e491695086d4723bfbc72 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 27 Aug 2023 19:30:07 -0400 Subject: disambiguate between files with the same name --- ted.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ted.h') diff --git a/ted.h b/ted.h index 77f556b..d35fd74 100644 --- a/ted.h +++ b/ted.h @@ -386,8 +386,11 @@ u32 buffer_last_line_on_screen(TextBuffer *buffer); Rect buffer_rect(TextBuffer *buffer); /// is this buffer empty? bool buffer_empty(TextBuffer *buffer); -/// returns the buffer's filename (not full path), or "Untitled" if this buffer is untitled. -const char *buffer_display_filename(TextBuffer *buffer); +/// returns the buffer's display filename (not full path) into `filename` +/// +/// if the buffer is an untitled buffer, returns "Untitled". +/// `filename` is guaranteed to be null-terminated after calling this. +void buffer_display_filename(TextBuffer *buffer, char *filename, size_t filename_size); /// does this buffer contained a named file (i.e. not a line buffer, not the build buffer, not untitled) bool buffer_is_named_file(TextBuffer *buffer); /// does this buffer have unsaved changes? -- cgit v1.2.3