+ Add system timestamps to lua read() and new lua read_line() per global options

+ Add missing timestamp-format epoch
+ Update send_ to use fsync and tcdrain like normal tty_sync does
+ Rework read_line to save partial line at timeout
+ Simplified read_line to reduce cyclomatic complexity

+ renamed example files read.lua and read_line.lua
+ moved #define READ_LINE_SIZE to top of file
+ renamed g_linebuf to linebuf, and moved it into read_line as a static variable
This commit is contained in:
Keith Hill 2024-10-25 11:22:56 -05:00 committed by Martin Lund
parent db3f109c7d
commit afd82f7ac4
12 changed files with 171 additions and 24 deletions

View file

@ -209,7 +209,7 @@ static void config_parse_keys(GKeyFile *key_file, char *group)
{
option.timestamp = TIMESTAMP_24HOUR;
}
config_get_string(key_file, group, "timestamp-format", &string, "24hour", "24hour-start", "24hour-delta", "iso8601", NULL);
config_get_string(key_file, group, "timestamp-format", &string, "24hour", "24hour-start", "24hour-delta", "iso8601", "epoch", NULL);
if (string != NULL)
{
option_parse_timestamp(string, &option.timestamp);