summaryrefslogtreecommitdiff
path: root/examples/dte/exec.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/exec.h
parent349991bf6efe473ab9a5cbdae0a8114d72b997e3 (diff)
downloadcrep-1566b6faa8534118c3566188181367cd0868468f.tar.gz
Added partial matching and introduced threads
Diffstat (limited to 'examples/dte/exec.h')
-rw-r--r--examples/dte/exec.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/examples/dte/exec.h b/examples/dte/exec.h
new file mode 100644
index 0000000..e40a11f
--- /dev/null
+++ b/examples/dte/exec.h
@@ -0,0 +1,37 @@
+#ifndef EXEC_H
+#define EXEC_H
+
+#include <stdbool.h>
+#include <sys/types.h>
+#include "editor.h"
+#include "spawn.h"
+#include "util/macros.h"
+
+typedef enum {
+ EXEC_INVALID = -1,
+ // Note: items below here need to be kept sorted
+ EXEC_BUFFER = 0,
+ EXEC_COMMAND,
+ EXEC_ERRMSG,
+ EXEC_EVAL,
+ EXEC_LINE,
+ EXEC_MSG,
+ EXEC_NULL,
+ EXEC_OPEN,
+ EXEC_SEARCH,
+ EXEC_TAG,
+ EXEC_TTY,
+ EXEC_WORD,
+} ExecAction;
+
+ssize_t handle_exec (
+ EditorState *e,
+ const char **argv,
+ ExecAction actions[3],
+ SpawnFlags spawn_flags,
+ bool strip_trailing_newline
+) NONNULL_ARGS;
+
+ExecAction lookup_exec_action(const char *name, int fd) NONNULL_ARGS;
+
+#endif