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

Diff of /lbbs/include/io.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.16 by sysadm, Sun May 11 14:52:26 2025 UTC Revision 1.24 by sysadm, Sun Oct 19 01:30:38 2025 UTC
# Line 17  Line 17 
17  #ifndef _IO_H_  #ifndef _IO_H_
18  #define _IO_H_  #define _IO_H_
19    
20    #include <iconv.h>
21  #include <stdio.h>  #include <stdio.h>
22    
 #define ESC_KEY '\033'  
23  #define CR '\r'  #define CR '\r'
24  #define LF '\n'  #define LF '\n'
25  #define BACKSPACE '\b'  #define BACKSPACE '\b'
26  #define BELL '\b'  #define BELL '\b'
27    #define KEY_TAB 9
28    #define KEY_ESC 27
29  #define KEY_SPACE '\040'  #define KEY_SPACE '\040'
30    
31  #ifndef EXTEND_KEY  #ifndef EXTEND_KEY
32  #define EXTEND_KEY  #define EXTEND_KEY
33    
34  #define KEY_NULL 0xffff  #define KEY_NULL 0xffff
35  #define KEY_TIMEOUT 0xfffe  #define KEY_TIMEOUT 0xfffe
36  #define KEY_CONTROL 0xff  #define KEY_CONTROL 0xff
 #define KEY_TAB 9  
 #define KEY_ESC 27  
37  #define KEY_UP 0x0101  #define KEY_UP 0x0101
38  #define KEY_DOWN 0x0102  #define KEY_DOWN 0x0102
39  #define KEY_RIGHT 0x0103  #define KEY_RIGHT 0x0103
40  #define KEY_LEFT 0x0104  #define KEY_LEFT 0x0104
41    #define KEY_CSI 0x011b // ESC ESC
42  #define KEY_HOME 0x0201  #define KEY_HOME 0x0201
43  #define KEY_INS 0x0202  #define KEY_INS 0x0202
44  #define KEY_DEL 0x0203  #define KEY_DEL 0x0203
45  #define KEY_END 0x0204  #define KEY_END 0x0204
46  #define KEY_PGUP 0x0205  #define KEY_PGUP 0x0205
47  #define KEY_PGDN 0x0206  #define KEY_PGDN 0x0206
48    
49  #define KEY_F1 0x0207  #define KEY_F1 0x0207
50  #define KEY_F2 0x0208  #define KEY_F2 0x0208
51  #define KEY_F3 0x0209  #define KEY_F3 0x0209
# Line 53  Line 56 
56  #define KEY_F8 0x020e  #define KEY_F8 0x020e
57  #define KEY_F9 0x020f  #define KEY_F9 0x020f
58  #define KEY_F10 0x0210  #define KEY_F10 0x0210
59  #endif  #define KEY_F11 0x0211
60    #define KEY_F12 0x0212
61    
62    #define KEY_SHIFT_F1 0x0213
63    #define KEY_SHIFT_F2 0x0214
64    #define KEY_SHIFT_F3 0x0215
65    #define KEY_SHIFT_F4 0x0216
66    #define KEY_SHIFT_F5 0x0217
67    #define KEY_SHIFT_F6 0x0218
68    #define KEY_SHIFT_F7 0x0219
69    #define KEY_SHIFT_F8 0x021a
70    #define KEY_SHIFT_F9 0x021b
71    #define KEY_SHIFT_F10 0x021c
72    #define KEY_SHIFT_F11 0x021d
73    #define KEY_SHIFT_F12 0x021e
74    
75    #define KEY_CTRL_F1 0x021f
76    #define KEY_CTRL_F2 0x0220
77    #define KEY_CTRL_F3 0x0221
78    #define KEY_CTRL_F4 0x0222
79    #define KEY_CTRL_F5 0x0223
80    #define KEY_CTRL_F6 0x0224
81    #define KEY_CTRL_F7 0x0225
82    #define KEY_CTRL_F8 0x0226
83    #define KEY_CTRL_F9 0x0227
84    #define KEY_CTRL_F10 0x0228
85    #define KEY_CTRL_F11 0x0229
86    #define KEY_CTRL_F12 0x022a
87    
88    #define KEY_CTRL_UP 0x0230
89    #define KEY_CTRL_DOWN 0x0231
90    #define KEY_CTRL_RIGHT 0x0232
91    #define KEY_CTRL_LEFT 0x0233
92    #define KEY_CTRL_HOME 0x0234
93    #define KEY_CTRL_END 0x0235
94    
95    #endif // EXPAND_KEY
96    
97  #define Ctrl(C) ((C) - 'A' + 1)  #define Ctrl(C) ((C) - 'A' + 1)
98    
99  #define DOECHO (1)  #define DOECHO (1)
100  #define NOECHO (0)  #define NOECHO (0)
101    
102  extern int prints(const char *format, ...);  #define BBS_DEFAULT_CHARSET "UTF-8"
103    
104  extern int iflush();  extern char stdio_charset[32];
105    
106  extern int igetch(int clear_buf);  extern int prints(const char *format, ...);
107    extern int outc(char c);
108  extern int igetch_t(long int sec);  extern int iflush(void);
109    
110  inline int outc(char c)  extern int igetch(int timeout);
111  {  extern int igetch_t(int sec);
112          return prints("%c", c);  extern void igetch_reset(void);
113  }  
114    extern int io_buf_conv(iconv_t cd, char *p_buf, int *p_buf_len, int *p_buf_offset, char *p_conv, size_t conv_size, int *p_conv_len);
115    extern int io_conv_init(const char *charset);
116    extern int io_conv_cleanup(void);
117    
118  #endif //_IO_H_  #endif //_IO_H_


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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