diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-07-22 15:52:37 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-07-22 15:52:37 +0200 |
| commit | f0c769757486154e661d4457bb9c62c6fe2cf523 (patch) | |
| tree | 75884a220e91d4707cea3f036fd35935e206aa85 | |
| parent | 15e497645f71c66ae27bd0ed81f0d7815a0da382 (diff) | |
| download | vis-f0c769757486154e661d4457bb9c62c6fe2cf523.tar.gz vis-f0c769757486154e661d4457bb9c62c6fe2cf523.tar.xz | |
Add prototypes
| -rw-r--r-- | editor.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -93,17 +93,31 @@ struct Editor { int fd; /* the file descriptor of the original mmap-ed data */ }; -/* prototypes */ +/* buffer management */ static Buffer *buffer_alloc(Editor *ed, size_t size); static void buffer_free(Buffer *buf); +static bool buffer_capacity(Buffer *buf, size_t len); +static char *buffer_append(Buffer *buf, char *content, size_t len); +static bool buffer_insert(Buffer *buf, size_t pos, char *content, size_t len); +static bool buffer_delete(Buffer *buf, size_t pos, size_t len); static char *buffer_store(Editor *ed, char *content, size_t len); +/* cache layer */ +static void cache_piece(Editor *ed, Piece *p); +static bool cache_contains(Editor *ed, Piece *p); +static bool cache_insert(Editor *ed, Piece *p, size_t off, char *text, size_t len); +static bool cache_delete(Editor *ed, Piece *p, size_t off, size_t len); +/* piece management */ static Piece *piece_alloc(Editor *ed); static void piece_free(Piece *p); static void piece_init(Piece *p, Piece *prev, Piece *next, char *content, size_t len); +static Location piece_get(Editor *ed, size_t pos); +/* span management */ static void span_init(Span *span, Piece *start, Piece *end); static void span_swap(Editor *ed, Span *old, Span *new); +/* change management */ static Change *change_alloc(Editor *ed); static void change_free(Change *c); +/* action management */ static Action *action_alloc(Editor *ed); static void action_free(Action *a); static void action_push(Action **stack, Action *action); |
