aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-07-15 01:23:52 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-07-15 01:24:07 +0200
commite28c4da2fc3cf0564d1bb9eb7a6e372a577535a5 (patch)
tree721ed11b3c4c064b3d2075670528a3f25864dd41 /editor.h
downloadvis-e28c4da2fc3cf0564d1bb9eb7a6e372a577535a5.tar.gz
vis-e28c4da2fc3cf0564d1bb9eb7a6e372a577535a5.tar.xz
Inital import
Still far from useable
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h25
1 files changed, 25 insertions, 0 deletions
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 <stdbool.h>
+
+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);