diff options
Diffstat (limited to 'editor.h')
| -rw-r--r-- | editor.h | 25 |
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); |
