/[LeafOK_CVS]/lbbs/include/screen.h
ViewVC logotype

Contents of /lbbs/include/screen.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (show annotations)
Tue Nov 4 14:58:55 2025 UTC (4 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.20: +1 -1 lines
Content type: text/x-chdr
Refine file header information comments

1 /* SPDX-License-Identifier: GPL-3.0-or-later */
2 /*
3 * screen
4 * - advanced telnet-based user interactive input / output features
5 *
6 * Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com>
7 */
8
9 #ifndef _SCREEN_H_
10 #define _SCREEN_H_
11
12 #include <stddef.h>
13
14 #define CTRL_SEQ_CLR_LINE "\033[K"
15 #define MSG_EXT_MAX_LEN 400
16
17 struct display_ctx_t
18 {
19 int reach_begin;
20 int reach_end;
21 long line_top;
22 long line_bottom;
23 char msg[MSG_EXT_MAX_LEN];
24 };
25 typedef struct display_ctx_t DISPLAY_CTX;
26
27 typedef int (*display_data_key_handler)(int *p_key, DISPLAY_CTX *p_ctx);
28
29 extern void moveto(int row, int col);
30 extern void clrtoeol();
31 extern void clrline(int line_begin, int line_end);
32 extern void clrtobot(int line_begin);
33 extern void clearscr();
34
35 extern int press_any_key();
36 extern int press_any_key_ex(const char *msg, int sec);
37
38 extern void set_input_echo(int echo);
39
40 extern int str_input(char *buffer, int buffer_length, int echo_mode);
41 extern int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int max_display_len);
42
43 // eof_exit = 0 : Do not exit at EOF
44 // 1 : Prompt for any key at EOF, then exit
45 // 2 : Exit at EOF without prompt
46 extern int display_data(const void *p_data, long display_line_total, const long *p_line_offsets, int eof_exit,
47 display_data_key_handler key_handler, const char *help_filename);
48 extern int display_file(const char *filename, int eof_exit);
49
50 extern int show_top(const char *str_left, const char *str_center, const char *str_right);
51 extern int show_bottom(const char *msg);
52
53 extern int show_active_board();
54
55 #endif //_SCREEN_H_

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1