From 4c5442ccd9428c4bb4e73939d3eff50911b574c0 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Mon, 29 Dec 2025 02:29:53 -0500 Subject: various asserts --- txt.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'txt.h') 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); -- cgit v1.2.3