aboutsummaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-04-22 21:20:59 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-04-22 21:34:40 +0200
commit287521cba09765d9d0901b79d8911a27de1af4e7 (patch)
tree8a505debc63763bca159ba0b6c60cae02d583d9e /text.h
parent6d7794c0356902bc816923f4409d9d39a62db171 (diff)
downloadvis-287521cba09765d9d0901b79d8911a27de1af4e7.tar.gz
vis-287521cba09765d9d0901b79d8911a27de1af4e7.tar.xz
Cleanup line ending type detection and insertion
Diffstat (limited to 'text.h')
-rw-r--r--text.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/text.h b/text.h
index 9f350f9..099cbe4 100644
--- a/text.h
+++ b/text.h
@@ -82,8 +82,15 @@ size_t text_history_get(Text*, size_t index);
size_t text_size(Text*);
bool text_modified(Text*);
-/* test whether the underlying file uses UNIX style \n or Windows style \r\n newlines */
-bool text_newlines_crnl(Text*);
+
+/* which type of new lines does the text use? */
+enum TextNewLine {
+ TEXT_NEWLINE_NL = 1,
+ TEXT_NEWLINE_CRNL,
+};
+
+enum TextNewLine text_newline_type(Text*);
+
bool text_save(Text*, const char *file);
bool text_range_save(Text*, Filerange*, const char *file);
ssize_t text_write(Text*, int fd);