dte test coverage


Directory: ./
File: src/command/macro.h
Date: 2024-12-21 16:03:22
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 #ifndef COMMAND_MACRO_H
2 #define COMMAND_MACRO_H
3
4 #include <stdbool.h>
5 #include <stddef.h>
6 #include "util/macros.h"
7 #include "util/ptr-array.h"
8 #include "util/string.h"
9 #include "util/unicode.h"
10
11 typedef struct {
12 PointerArray macro;
13 PointerArray prev_macro;
14 String insert_buffer;
15 bool recording;
16 } CommandMacroState;
17
18 10 static inline bool macro_is_recording(const CommandMacroState *m)
19 {
20 10 return m->recording;
21 }
22
23 bool macro_record(CommandMacroState *m) WARN_UNUSED_RESULT NONNULL_ARGS;
24 bool macro_stop(CommandMacroState *m) WARN_UNUSED_RESULT NONNULL_ARGS;
25 bool macro_cancel(CommandMacroState *m) WARN_UNUSED_RESULT NONNULL_ARGS;
26 void macro_command_hook(CommandMacroState *m, const char *cmd_name, char **args) NONNULL_ARGS;
27 void macro_search_hook(CommandMacroState *m, const char *pattern, bool reverse, bool add_to_history) NONNULL_ARG(1);
28 void macro_insert_char_hook(CommandMacroState *m, CodePoint c) NONNULL_ARGS;
29 void macro_insert_text_hook(CommandMacroState *m, const char *text, size_t size) NONNULL_ARG(1);
30 String dump_macro(const CommandMacroState *m) WARN_UNUSED_RESULT NONNULL_ARGS;
31 void free_macro(CommandMacroState *m) NONNULL_ARGS;
32
33 #endif
34