CE Implement line editing
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m8s

This commit is contained in:
2026-03-04 02:02:05 +01:00
parent 95ea80cee9
commit 81704d7df8
20 changed files with 464 additions and 229 deletions

31
ce/gapbuffer.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef _GAPBUFFER_H
#define _GAPBUFFER_H
#include <stddef.h>
struct gapbuffer {
char* buffer;
size_t size;
size_t gap_start;
size_t gap_end;
};
void gapbuffer_init (struct gapbuffer* gb, size_t capacity);
void gapbuffer_fini (struct gapbuffer* gb);
void gapbuffer_move (struct gapbuffer* gb, size_t pos);
void gapbuffer_insert (struct gapbuffer* gb, char c);
void gapbuffer_backspace (struct gapbuffer* gb);
void gapbuffer_grow (struct gapbuffer* gb);
char* gapbuffer_get_string (struct gapbuffer* gb);
size_t gapbuffer_length (struct gapbuffer* gb);
char* gapbuffer_string_at (struct gapbuffer* gb, size_t pos);
#endif // _GAPBUFFER_H