summaryrefslogtreecommitdiff
path: root/examples/dte/bind.h
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2023-11-09 23:19:53 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2023-11-09 23:19:53 +0100
commit1566b6faa8534118c3566188181367cd0868468f (patch)
tree1de8d4b369efb5e592685a31088f798a6b63ffa1 /examples/dte/bind.h
parent349991bf6efe473ab9a5cbdae0a8114d72b997e3 (diff)
downloadcrep-1566b6faa8534118c3566188181367cd0868468f.tar.gz
Added partial matching and introduced threads
Diffstat (limited to 'examples/dte/bind.h')
-rw-r--r--examples/dte/bind.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/dte/bind.h b/examples/dte/bind.h
new file mode 100644
index 0000000..22d89bd
--- /dev/null
+++ b/examples/dte/bind.h
@@ -0,0 +1,20 @@
+#ifndef BIND_H
+#define BIND_H
+
+#include <stdbool.h>
+#include "command/cache.h"
+#include "editor.h"
+#include "terminal/key.h"
+#include "util/intmap.h"
+#include "util/macros.h"
+#include "util/string.h"
+
+void add_binding(IntMap *bindings, KeyCode key, CachedCommand *cc) NONNULL_ARGS;
+void remove_binding(IntMap *bindings, KeyCode key) NONNULL_ARGS;
+const CachedCommand *lookup_binding(const IntMap *bindings, KeyCode key) NONNULL_ARGS;
+bool handle_binding(EditorState *e, InputMode mode, KeyCode key) NONNULL_ARGS WARN_UNUSED_RESULT;
+void free_bindings(IntMap *bindings) NONNULL_ARGS;
+bool dump_bindings(const IntMap *bindings, const char *flag, String *buf) NONNULL_ARGS WARN_UNUSED_RESULT;
+
+#endif
+