diff options
| author | WormHeamer | 2025-12-29 02:29:53 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-12-29 02:29:53 -0500 |
| commit | 4c5442ccd9428c4bb4e73939d3eff50911b574c0 (patch) | |
| tree | 0b632c7786507178a48d62d0dcd090ae34d88c63 /txt.h | |
| parent | e40c14f15bc8607717bd1955dc8df5180f36c90b (diff) | |
various asserts
Diffstat (limited to 'txt.h')
| -rw-r--r-- | txt.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |
