]> git.ipfire.org Git - thirdparty/util-linux.git/blame_incremental - term-utils/script-playutils.h
taskset: Accept 0 pid for current process
[thirdparty/util-linux.git] / term-utils / script-playutils.h
... / ...
CommitLineData
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
15UL_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 */
21enum {
22 REPLAY_CRMODE_AUTO = 0,
23 REPLAY_CRMODE_NEVER,
24 REPLAY_CRMODE_ALWAYS
25};
26
27struct replay_setup;
28struct replay_step;
29
30void replay_init_debug(void);
31struct replay_setup *replay_new_setup(void);
32void replay_free_setup(struct replay_setup *stp);
33
34int replay_set_default_type(struct replay_setup *stp, char type);
35int replay_set_crmode(struct replay_setup *stp, int mode);
36int replay_set_timing_file(struct replay_setup *stp, const char *filename);
37const char *replay_get_timing_file(struct replay_setup *setup);
38int replay_get_timing_line(struct replay_setup *setup);
39int replay_associate_log(struct replay_setup *stp, const char *streams, const char *filename);
40
41int replay_set_delay_min(struct replay_setup *stp, const struct timeval *tv);
42int replay_set_delay_max(struct replay_setup *stp, const struct timeval *tv);
43int replay_set_delay_div(struct replay_setup *stp, const double divi);
44
45struct timeval *replay_step_get_delay(struct replay_step *step);
46const char *replay_step_get_filename(struct replay_step *step);
47int replay_step_is_empty(struct replay_step *step);
48int replay_get_next_step(struct replay_setup *stp, char *streams, struct replay_step **xstep);
49
50int replay_emit_step_data(struct replay_setup *stp, struct replay_step *step, int fd);
51
52bool replay_get_is_paused(struct replay_setup *setup);
53void replay_toggle_pause(struct replay_setup *setup);
54
55#endif /* UTIL_LINUX_SCRIPT_PLAYUTILS_H */