]> git.ipfire.org Git - thirdparty/util-linux.git/blob - term-utils/script-playutils.h
f3bce5fe4ffe13a3c3674d8b493fa2ee0893b2ea
[thirdparty/util-linux.git] / term-utils / script-playutils.h
1 #ifndef UTIL_LINUX_SCRIPT_PLAYUTILS_H
2 #define UTIL_LINUX_SCRIPT_PLAYUTILS_H
3
4 #include <stdbool.h>
5
6 #include "c.h"
7 #include "debug.h"
8
9 #define SCRIPTREPLAY_DEBUG_INIT (1 << 1)
10 #define SCRIPTREPLAY_DEBUG_TIMING (1 << 2)
11 #define SCRIPTREPLAY_DEBUG_LOG (1 << 3)
12 #define SCRIPTREPLAY_DEBUG_MISC (1 << 4)
13 #define SCRIPTREPLAY_DEBUG_ALL 0xFFFF
14
15 UL_DEBUG_DECLARE_MASK(scriptreplay);
16
17 #define DBG(m, x) __UL_DBG(scriptreplay, SCRIPTREPLAY_DEBUG_, m, x)
18 #define ON_DBG(m, x) __UL_DBG_CALL(scriptreplay, SCRIPTREPLAY_DEBUG_, m, x)
19
20 /* CR to '\n' mode */
21 enum {
22 REPLAY_CRMODE_AUTO = 0,
23 REPLAY_CRMODE_NEVER,
24 REPLAY_CRMODE_ALWAYS
25 };
26
27 struct replay_setup;
28 struct replay_step;
29
30 void replay_init_debug(void);
31 struct replay_setup *replay_new_setup(void);
32 void replay_free_setup(struct replay_setup *stp);
33
34 int replay_set_default_type(struct replay_setup *stp, char type);
35 int replay_set_crmode(struct replay_setup *stp, int mode);
36 int replay_set_timing_file(struct replay_setup *stp, const char *filename);
37 const char *replay_get_timing_file(struct replay_setup *setup);
38 int replay_get_timing_line(struct replay_setup *setup);
39 int replay_associate_log(struct replay_setup *stp, const char *streams, const char *filename);
40
41 int replay_set_delay_min(struct replay_setup *stp, const struct timeval *tv);
42 int replay_set_delay_max(struct replay_setup *stp, const struct timeval *tv);
43 int replay_set_delay_div(struct replay_setup *stp, const double divi);
44
45 struct timeval *replay_step_get_delay(struct replay_step *step);
46 const char *replay_step_get_filename(struct replay_step *step);
47 int replay_step_is_empty(struct replay_step *step);
48 int replay_get_next_step(struct replay_setup *stp, char *streams, struct replay_step **xstep);
49
50 int replay_emit_step_data(struct replay_setup *stp, struct replay_step *step, int fd);
51
52 bool replay_get_is_paused(struct replay_setup *setup);
53 void replay_toggle_pause(struct replay_setup *setup);
54
55 #endif /* UTIL_LINUX_SCRIPT_PLAYUTILS_H */