summaryrefslogtreecommitdiff
path: root/txt.h
diff options
context:
space:
mode:
Diffstat (limited to 'txt.h')
-rw-r--r--txt.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/txt.h b/txt.h
index 21712af..54b2146 100644
--- a/txt.h
+++ b/txt.h
@@ -28,16 +28,26 @@ typedef struct {
u32 len;
} Txt;
-TxtLoc txt_at(Txt *b, u32 cur);
-
u32 txt_split_piece(Txt *b, u32 pi, u32 i);
void txt_remove_piece(Txt *b, u32 pi);
void txt_insert_piece(Txt *b, u32 pi, TxtBufIdx buf, u32 ofs, u32 n);
-void txt_buf_append(Txt *b, TxtBufIdx bi, const char *s, u32 n);
u32 txt_insert(Txt *b, u32 cur, const char *s, u32 n);
-u32 txt_insert_c(Txt *b, u32 cur, char ch);
u32 txt_delete(Txt *b, u32 cur, u32 n);
-int txt_open(Txt *b, const char *path);
+u32 txt_insert_c(Txt *b, u32 cur, u32 ch);
+u32 txt_delete_c(Txt *b, u32 cur);
+int txt_load(Txt *b, const char *path);
+int txt_save(Txt *b, const char *path);
+void txt_free(Txt *b);
+
+TxtLoc txt_at(Txt *b, u32 cur);
+u32 txt_ofs(Txt *b, TxtLoc l);
+TxtLoc txt_next(Txt *b, TxtLoc l);
+TxtLoc txt_prev(Txt *b, TxtLoc l);
+int txt_at_start(Txt *b, TxtLoc l);
+int txt_at_end(Txt *b, TxtLoc l);
+
+u32 txt_chr(Txt *b, TxtLoc l);
+u8 txt_byte(Txt *b, TxtLoc l);
#endif