dte test coverage


Directory: ./
File: src/command/macro.h
Date: 2025-02-14 16:55: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 } MacroRecorder;
17
18 10 static inline bool macro_is_recording(const MacroRecorder *m)
19 {
20 10 return m->recording;
21 }
22
23 bool macro_record(MacroRecorder *m) WARN_UNUSED_RESULT NONNULL_ARGS;
24 bool macro_stop(MacroRecorder *m) WARN_UNUSED_RESULT NONNULL_ARGS;
25 bool macro_cancel(MacroRecorder *m) WARN_UNUSED_RESULT NONNULL_ARGS;
26 void macro_command_hook(MacroRecorder *m, const char *cmd_name, char **args) NONNULL_ARGS;
27 void macro_search_hook(MacroRecorder *m, const char *pattern, bool reverse, bool add_to_history) NONNULL_ARG(1);
28 void macro_insert_char_hook(MacroRecorder *m, CodePoint c) NONNULL_ARGS;
29 void macro_insert_text_hook(MacroRecorder *m, const char *text, size_t size) NONNULL_ARG(1) NONNULL_ARG_IF_NONZERO_LENGTH(2, 3);
30 String dump_macro(const MacroRecorder *m) WARN_UNUSED_RESULT NONNULL_ARGS;
31 void free_macro(MacroRecorder *m) NONNULL_ARGS;
32
33 #endif
34