New API for relocating the buffer
This commit is contained in:
+8
-9
@@ -1,6 +1,3 @@
|
||||
#warning "temp"
|
||||
#include <stdint.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -11,7 +8,7 @@ typedef struct {
|
||||
bool crossed_gap;
|
||||
size_t cur;
|
||||
void *mem;
|
||||
char maybe[256];
|
||||
char maybe[512];
|
||||
} GapBufferIter;
|
||||
|
||||
typedef struct {
|
||||
@@ -19,10 +16,10 @@ typedef struct {
|
||||
size_t len;
|
||||
} GapBufferLine;
|
||||
|
||||
GapBuffer *GapBuffer_createUsingMemory(void *mem, size_t len);
|
||||
GapBuffer *GapBuffer_create(size_t capacity);
|
||||
GapBuffer *GapBuffer_createUsingMemory(void *mem, size_t len, void (*free)(void*));
|
||||
GapBuffer *GapBuffer_cloneUsingMemory(void *mem, size_t len, void (*free)(void*), const GapBuffer *src);
|
||||
void GapBuffer_destroy(GapBuffer *buff);
|
||||
bool GapBuffer_insertString(GapBuffer **buff, const char *str, size_t len);
|
||||
bool GapBuffer_insertString(GapBuffer *buff, const char *str, size_t len);
|
||||
void GapBuffer_moveRelative(GapBuffer *buff, int off);
|
||||
void GapBuffer_moveAbsolute(GapBuffer *buff, size_t num);
|
||||
void GapBuffer_removeForwards(GapBuffer *buff, size_t num);
|
||||
@@ -31,5 +28,7 @@ void GapBufferIter_init(GapBufferIter *iter, GapBuffer *buff);
|
||||
void GapBufferIter_free(GapBufferIter *iter);
|
||||
bool GapBufferIter_next(GapBufferIter *iter, GapBufferLine *line);
|
||||
|
||||
#warning "temporarily not static"
|
||||
int getSymbolRune(const char *sym, size_t symlen, uint32_t *rune);
|
||||
#ifndef GAPBUFFER_NOMALLOC
|
||||
GapBuffer *GapBuffer_create(size_t capacity);
|
||||
bool GapBuffer_insertStringMaybeRelocate(GapBuffer **buff, const char *str, size_t len);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user