From e28c4da2fc3cf0564d1bb9eb7a6e372a577535a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 15 Jul 2014 01:23:52 +0200 Subject: Inital import Still far from useable --- editor.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 editor.h (limited to 'editor.h') diff --git a/editor.h b/editor.h new file mode 100644 index 0000000..6620fce --- /dev/null +++ b/editor.h @@ -0,0 +1,25 @@ +#include + +typedef struct Editor Editor; + +typedef enum { + CONTINUE, + BREAK, +} Iterate; + +typedef Iterate (*iterator_callback_t)(void *, size_t pos, const char *content, size_t len); + + +void editor_insert(Editor*, size_t pos, char *c); +void editor_delete(Editor*, size_t start, size_t end); +bool editor_undo(Editor*); +bool editor_redo(Editor*); +void editor_snapshot(Editor*); +int editor_save(Editor*, const char *file); +Editor *editor_load(const char *file); +char *editor_get(Editor*, size_t pos, size_t len); +void editor_iterate(Editor *ed, void *, size_t pos, iterator_callback_t); + + +// TMP +void editor_debug(Editor *ed); -- cgit v1.2.3