mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 10:03:50 +01:00
sys/shell: rename shell_readline()
This commit is contained in:
parent
584e14bfce
commit
e98426e5c5
@ -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 EOF, if the end of the input stream was reached.
|
||||||
* @return -ENOBUFS if the buffer size was exceeded.
|
* @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
|
#ifndef __cplusplus
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -32,8 +32,6 @@
|
|||||||
#define EOT 0x4
|
#define EOT 0x4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int readline(char *buf, size_t size);
|
|
||||||
|
|
||||||
static void _sock_cb(sock_udp_t *sock, sock_async_flags_t flags, void *arg)
|
static void _sock_cb(sock_udp_t *sock, sock_async_flags_t flags, void *arg)
|
||||||
{
|
{
|
||||||
(void)arg;
|
(void)arg;
|
||||||
@ -90,7 +88,7 @@ static int _udptty_cmd(int argc, char **argv)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
res = readline(buf, sizeof(buf));
|
res = shell_readline(buf, sizeof(buf));
|
||||||
|
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
buf[res] = '\n';
|
buf[res] = '\n';
|
||||||
|
|||||||
@ -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;
|
int curr_pos = 0;
|
||||||
bool length_exceeded = false;
|
bool length_exceeded = false;
|
||||||
@ -513,7 +513,7 @@ void shell_run_once(const shell_command_t *shell_commands,
|
|||||||
print_prompt();
|
print_prompt();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int res = readline(line_buf, len);
|
int res = shell_readline(line_buf, len);
|
||||||
|
|
||||||
if (IS_USED(MODULE_SHELL_LOCK)) {
|
if (IS_USED(MODULE_SHELL_LOCK)) {
|
||||||
if (shell_lock_is_locked()) {
|
if (shell_lock_is_locked()) {
|
||||||
|
|||||||
@ -105,7 +105,7 @@ static bool _login(char *line_buf, size_t buf_size)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
memset(line_buf, 0, buf_size);
|
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);
|
return _safe_strcmp(line_buf, CONFIG_SHELL_LOCK_PASSWORD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user