--- lbbs/include/screen.h 2025/10/18 05:02:15 1.19 +++ lbbs/include/screen.h 2026/01/03 10:27:14 1.24 @@ -1,26 +1,23 @@ -/*************************************************************************** - screen.h - description - ------------------- - copyright : (C) 2004-2025 by Leaflet - email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * screen + * - advanced telnet-based user interactive input / output features + * + * Copyright (C) 2004-2026 Leaflet + */ #ifndef _SCREEN_H_ #define _SCREEN_H_ +#include "io.h" #include -#define CTRL_SEQ_CLR_LINE "\033[K" -#define MSG_EXT_MAX_LEN 400 +extern const char CTRL_SEQ_CLR_LINE[]; + +enum display_constant_t +{ + MSG_EXT_MAX_LEN = 400, +}; struct display_ctx_t { @@ -45,7 +42,7 @@ extern int press_any_key_ex(const char * extern void set_input_echo(int echo); -extern int str_input(char *buffer, int buffer_length, int echo_mode); +extern int str_input(char *buffer, int buffer_length, enum io_echo_t echo_mode); extern int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int max_display_len); // eof_exit = 0 : Do not exit at EOF @@ -55,6 +52,8 @@ extern int display_data(const void *p_da display_data_key_handler key_handler, const char *help_filename); extern int display_file(const char *filename, int eof_exit); +extern int display_file_key_handler(int *p_key, DISPLAY_CTX *p_ctx); + extern int show_top(const char *str_left, const char *str_center, const char *str_right); extern int show_bottom(const char *msg);