summaryrefslogtreecommitdiff
path: root/examples/dte/exec.h
blob: e40a11fe8809796c15e1435c542656c4e6344fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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