diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-10-10 10:33:57 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-10-10 10:47:44 +0200 |
| commit | fc85c33601ccfc4acaa571148b4e974686783f86 (patch) | |
| tree | aaf4a8721a692cf2a09e97eeff6b793d7b002cc7 /text.c | |
| parent | bbe81dff8c0241bdb51b746f42ce91ff795b9737 (diff) | |
| download | vis-fc85c33601ccfc4acaa571148b4e974686783f86.tar.gz vis-fc85c33601ccfc4acaa571148b4e974686783f86.tar.xz | |
text: rename internal text_iterator_init
This is in preparation for a public function of the same name.
Diffstat (limited to 'text.c')
| -rw-r--r-- | text.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1391,7 +1391,7 @@ bool text_mmaped(const Text *txt, const char *ptr) { return false; } -static bool text_iterator_init(Iterator *it, size_t pos, Piece *p, size_t off) { +static bool iterator_init(Iterator *it, size_t pos, Piece *p, size_t off) { Iterator iter = (Iterator){ .pos = pos, .piece = p, @@ -1406,7 +1406,7 @@ static bool text_iterator_init(Iterator *it, size_t pos, Piece *p, size_t off) { Iterator text_iterator_get(const Text *txt, size_t pos) { Iterator it; Location loc = piece_get_extern(txt, pos); - text_iterator_init(&it, pos, loc.piece, loc.off); + iterator_init(&it, pos, loc.piece, loc.off); return it; } @@ -1426,13 +1426,13 @@ bool text_iterator_byte_get(const Iterator *it, char *b) { bool text_iterator_next(Iterator *it) { size_t rem = it->end - it->text; - return text_iterator_init(it, it->pos+rem, it->piece ? it->piece->next : NULL, 0); + return iterator_init(it, it->pos+rem, it->piece ? it->piece->next : NULL, 0); } bool text_iterator_prev(Iterator *it) { size_t off = it->text - it->start; size_t len = it->piece && it->piece->prev ? it->piece->prev->len : 0; - return text_iterator_init(it, it->pos-off, it->piece ? it->piece->prev : NULL, len); + return iterator_init(it, it->pos-off, it->piece ? it->piece->prev : NULL, len); } const Text *text_iterator_text(const Iterator *it) { |
