summaryrefslogtreecommitdiff
path: root/txt.h
diff options
context:
space:
mode:
authorWormHeamer2025-12-29 02:29:53 -0500
committerWormHeamer2025-12-29 02:29:53 -0500
commit4c5442ccd9428c4bb4e73939d3eff50911b574c0 (patch)
tree0b632c7786507178a48d62d0dcd090ae34d88c63 /txt.h
parente40c14f15bc8607717bd1955dc8df5180f36c90b (diff)
various asserts
Diffstat (limited to 'txt.h')
-rw-r--r--txt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/txt.h b/txt.h
index f1cf538..a7dd908 100644
--- a/txt.h
+++ b/txt.h
@@ -39,6 +39,8 @@ int txt_load(Txt *b, const char *path);
int txt_save(Txt *b, const char *path);
void txt_free(Txt *b);
+void txt_write_range(int fd, TxtLoc lo, TxtLoc hi);
+
/* insertion & deletion */
TxtLoc txt_insert(TxtLoc l, const char *s, u32 n);
@@ -46,13 +48,17 @@ TxtLoc txt_delete(TxtLoc l, u32 n);
TxtLoc txt_delete_range(TxtLoc lo, TxtLoc hi);
TxtLoc txt_insert_c(TxtLoc l, u32 ch);
TxtLoc txt_delete_c(TxtLoc l);
+u32 txt_range_len(TxtLoc lo, TxtLoc hi);
/* navigation */
+int txt_valid_loc(TxtLoc l);
TxtLoc txt_at(Txt *b, u32 ofs);
u32 txt_ofs(TxtLoc l);
int txt_before(TxtLoc a, TxtLoc b);
int txt_after(TxtLoc a, TxtLoc b);
+TxtLoc txt_start(Txt *t);
+TxtLoc txt_end(Txt *t);
TxtLoc bnext(TxtLoc l);
TxtLoc bprev(TxtLoc l);