summaryrefslogtreecommitdiff
path: root/src/dged/text.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2025-11-05 23:17:10 +0100
committerAlbert Cervin <albert@acervin.com>2025-11-05 23:17:10 +0100
commitd131f7964b04ad71b2bda397beee2aba63a43332 (patch)
tree22003b212e33333d5ef05557eb159166a97c0e3c /src/dged/text.h
parent7f0bd82cfaff98072bd49db6e6308579d013f523 (diff)
downloaddged-d131f7964b04ad71b2bda397beee2aba63a43332.tar.gz
dged-d131f7964b04ad71b2bda397beee2aba63a43332.tar.xz
dged-d131f7964b04ad71b2bda397beee2aba63a43332.zip
Support CRLF line endings
It now detects and saves properly.
Diffstat (limited to 'src/dged/text.h')
-rw-r--r--src/dged/text.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dged/text.h b/src/dged/text.h
index ec14650..108ded8 100644
--- a/src/dged/text.h
+++ b/src/dged/text.h
@@ -10,6 +10,11 @@
struct text;
+enum line_endings {
+ LineEnding_LF,
+ LineEnding_CRLF,
+};
+
struct text_chunk {
uint8_t *text;
uint32_t nbytes;
@@ -34,6 +39,8 @@ void text_append(struct text *text, uint8_t *bytes, uint32_t nbytes,
void text_delete(struct text *text, uint32_t start_line, uint32_t start_offset,
uint32_t end_line, uint32_t end_offset);
+enum line_endings text_get_line_ending(const struct text *);
+
uint32_t text_num_lines(const struct text *text);
uint32_t text_line_size(const struct text *text, uint32_t lineidx);
struct utf8_codepoint_iterator