From afc9e3be5b787787e99966a6d21485ce0930ceba Mon Sep 17 00:00:00 2001 From: Braden Young Date: Fri, 14 Apr 2023 15:00:03 -0700 Subject: [PATCH] Move map variables to tty to keep them all in one spot --- src/socket.c | 4 +--- src/socket.h | 4 ---- src/tty.c | 3 +++ src/tty.h | 3 +++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/socket.c b/src/socket.c index 1d7d15d..23b1249 100644 --- a/src/socket.c +++ b/src/socket.c @@ -33,6 +33,7 @@ #include "socket.h" #include "options.h" #include "print.h" +#include "tty.h" #define MAX_SOCKET_CLIENTS 16 #define SOCKET_PORT_DEFAULT 3333 @@ -41,9 +42,6 @@ static int sockfd; static int clientfds[MAX_SOCKET_CLIENTS]; static int socket_family = AF_UNSPEC; static int port_number = SOCKET_PORT_DEFAULT; -bool map_i_nl_cr = false; -bool map_i_cr_nl = false; -bool map_ign_cr = false; static const char *socket_filename(void) { diff --git a/src/socket.h b/src/socket.h index 53c343e..2caffaf 100644 --- a/src/socket.h +++ b/src/socket.h @@ -25,10 +25,6 @@ #include #include -extern bool map_i_nl_cr; -extern bool map_i_cr_nl; -extern bool map_ign_cr; - void socket_configure(void); void socket_write(char input_char); int socket_add_fds(fd_set *fds, bool connected); diff --git a/src/tty.c b/src/tty.c index 9c4c8c1..54ea980 100644 --- a/src/tty.c +++ b/src/tty.c @@ -129,6 +129,9 @@ const char random_array[] = }; bool interactive_mode = true; +bool map_i_nl_cr = false; +bool map_i_cr_nl = false; +bool map_ign_cr = false; static struct termios tio, tio_old, stdout_new, stdout_old, stdin_new, stdin_old; static unsigned long rx_total = 0, tx_total = 0; diff --git a/src/tty.h b/src/tty.h index c4b6797..add8bf1 100644 --- a/src/tty.h +++ b/src/tty.h @@ -24,6 +24,9 @@ #include extern bool interactive_mode; +extern bool map_i_nl_cr; +extern bool map_i_cr_nl; +extern bool map_ign_cr; void stdout_configure(void); void stdin_configure(void);