From f0c769757486154e661d4457bb9c62c6fe2cf523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 22 Jul 2014 15:52:37 +0200 Subject: Add prototypes --- editor.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'editor.c') diff --git a/editor.c b/editor.c index 0962089..38ee9d7 100644 --- a/editor.c +++ b/editor.c @@ -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); -- cgit v1.2.3