From e98426e5c53d4e62e02f851027dba42a77b6c656 Mon Sep 17 00:00:00 2001 From: Teufelchen1 Date: Fri, 23 May 2025 14:35:25 +0200 Subject: [PATCH] sys/shell: rename shell_readline() --- sys/include/shell.h | 2 +- sys/shell/cmds/udptty.c | 4 +--- sys/shell/shell.c | 4 ++-- sys/shell_lock/shell_lock.c | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/include/shell.h b/sys/include/shell.h index d33eb9fe18..2230fe7c94 100644 --- a/sys/include/shell.h +++ b/sys/include/shell.h @@ -293,7 +293,7 @@ int shell_parse_file(const shell_command_t *commands, * @return EOF, if the end of the input stream was reached. * @return -ENOBUFS if the buffer size was exceeded. */ -int readline(char *buf, size_t size); +int shell_readline(char *buf, size_t size); #ifndef __cplusplus /** diff --git a/sys/shell/cmds/udptty.c b/sys/shell/cmds/udptty.c index 84898dcd43..ca2e5a194d 100644 --- a/sys/shell/cmds/udptty.c +++ b/sys/shell/cmds/udptty.c @@ -32,8 +32,6 @@ #define EOT 0x4 #endif -extern int readline(char *buf, size_t size); - static void _sock_cb(sock_udp_t *sock, sock_async_flags_t flags, void *arg) { (void)arg; @@ -90,7 +88,7 @@ static int _udptty_cmd(int argc, char **argv) do { char buf[64]; - res = readline(buf, sizeof(buf)); + res = shell_readline(buf, sizeof(buf)); if (res > 0) { buf[res] = '\n'; diff --git a/sys/shell/shell.c b/sys/shell/shell.c index 621322aca2..d055f60306 100644 --- a/sys/shell/shell.c +++ b/sys/shell/shell.c @@ -439,7 +439,7 @@ static inline void new_line(void) } } -int readline(char *buf, size_t size) +int shell_readline(char *buf, size_t size) { int curr_pos = 0; bool length_exceeded = false; @@ -513,7 +513,7 @@ void shell_run_once(const shell_command_t *shell_commands, print_prompt(); while (1) { - int res = readline(line_buf, len); + int res = shell_readline(line_buf, len); if (IS_USED(MODULE_SHELL_LOCK)) { if (shell_lock_is_locked()) { diff --git a/sys/shell_lock/shell_lock.c b/sys/shell_lock/shell_lock.c index 36bee52f7f..6b1d7d5f70 100644 --- a/sys/shell_lock/shell_lock.c +++ b/sys/shell_lock/shell_lock.c @@ -105,7 +105,7 @@ static bool _login(char *line_buf, size_t buf_size) while (1) { memset(line_buf, 0, buf_size); - while (readline(line_buf, buf_size) > 0) { + while (shell_readline(line_buf, buf_size) > 0) { return _safe_strcmp(line_buf, CONFIG_SHELL_LOCK_PASSWORD); } }