From 9965062fe2792db6f8329dcdee0a647b9c39060d Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sun, 24 Jun 2018 07:00:17 -0700 Subject: [PATCH] Clarify the input/output variable names (No-op change) --- src/tty.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tty.c b/src/tty.c index 6a0c5ec..4754e57 100644 --- a/src/tty.c +++ b/src/tty.c @@ -54,10 +54,10 @@ static bool print_mode = NORMAL; static bool standard_baudrate = true; static void (*print)(char c); static int fd; -static bool map_inlcrnl = false; -static bool map_ocrnl = false; -static bool map_onlcrnl = false; -static bool map_odelbs = false; +static bool map_i_nl_crnl = false; +static bool map_o_cr_nl = false; +static bool map_o_nl_crnl = false; +static bool map_o_del_bs = false; #define tio_printf(format, args...) \ { \ @@ -416,13 +416,13 @@ void tty_configure(void) else if (strcmp(token,"ICRNL") == 0) tio.c_iflag |= ICRNL; else if (strcmp(token,"OCRNL") == 0) - map_ocrnl = true; + map_o_cr_nl = true; else if (strcmp(token,"ODELBS") == 0) - map_odelbs = true; + map_o_del_bs = true; else if (strcmp(token,"INLCRNL") == 0) - map_inlcrnl = true; + map_i_nl_crnl = true; else if (strcmp(token, "ONLCRNL") == 0) - map_onlcrnl = true; + map_o_nl_crnl = true; else { printf("Error: Unknown mapping flag %s\n", token); @@ -604,7 +604,7 @@ int tty_connect(void) rx_total++; /* Map input character */ - if ((input_char == '\n') && (map_inlcrnl)) + if ((input_char == '\n') && (map_i_nl_crnl)) { print('\r'); print('\n'); @@ -651,13 +651,13 @@ int tty_connect(void) if (forward) { /* Map output character */ - if ((output_char == 127) && (map_odelbs)) + if ((output_char == 127) && (map_o_del_bs)) output_char = '\b'; - if ((output_char == '\r') && (map_ocrnl)) + if ((output_char == '\r') && (map_o_cr_nl)) output_char = '\n'; /* Map newline character */ - if ((output_char == '\n') && (map_onlcrnl)) { + if ((output_char == '\n') && (map_o_nl_crnl)) { char r = '\r'; status = write(fd, &r, 1);