diff options
Diffstat (limited to 'page.c')
-rw-r--r-- | page.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -65,3 +65,16 @@ void move_gap_backward(struct page *page) { page->gap_start--; page->elements[page->gap_end] = page->elements[page->gap_start]; } + +void insert_at_gap(struct page *page, uint8_t c) { + page->elements[page->gap_start] = c; + page->gap_start++; + page->element_count++; +} + +void delete_at_gap(struct page *page) { + if (page->gap_start) { + page->gap_start--; + page->element_count--; + } +} |