From: Karel Zak Date: Wed, 3 Apr 2019 14:32:41 +0000 (+0200) Subject: script: log file usage refactoring X-Git-Tag: v2.35-rc1~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=596f42027d7e9ff7486abe90cf38e3f6cbd6f44c;p=thirdparty%2Futil-linux.git script: log file usage refactoring This commit does not add any new feature. It just prepare code for future extensions only. * introduce two new structs: script_stream and script_log * define two streams: 'stdout' and 'stdin' * allow associate log files (type script or timing file) with the stream * support more log file formats Signed-off-by: Karel Zak --- diff --git a/term-utils/script.c b/term-utils/script.c index c7bc1d6f27..7bf4a5e46a 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -72,6 +72,7 @@ #include "monotonic.h" #include "timeutils.h" #include "strutils.h" +#include "xalloc.h" #include "debug.h" @@ -98,18 +99,36 @@ UL_DEBUG_DEFINE_MASKNAMES(script) = UL_DEBUG_EMPTY_MASKNAMES; #define DEFAULT_TYPESCRIPT_FILENAME "typescript" +enum { + SCRIPT_FMT_RAW = 1, /* raw slave/master data */ + SCRIPT_FMT_TIMING_SIMPLE, /* timing info in classic "