/[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.19 by sysadm, Tue May 20 05:11:05 2025 UTC Revision 1.26 by sysadm, Tue Nov 4 13:49:50 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                                          io.h  -  description  /*
3                                                           -------------------   * io
4          Copyright            : (C) 2004-2025 by Leaflet   *   - basic terminal-based user input / output features
5          Email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>
7     */
 /***************************************************************************  
  *                                                                         *  
  *   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.                                   *  
  *                                                                         *  
  ***************************************************************************/  
8    
9  #ifndef _IO_H_  #ifndef _IO_H_
10  #define _IO_H_  #define _IO_H_
11    
12    #include <iconv.h>
13  #include <stdio.h>  #include <stdio.h>
14    
 #define ESC_KEY '\033'  
15  #define CR '\r'  #define CR '\r'
16  #define LF '\n'  #define LF '\n'
17  #define BACKSPACE '\b'  #define BACKSPACE '\b'
18  #define BELL '\b'  #define BELL '\b'
19    #define KEY_TAB 9
20    #define KEY_ESC 27
21  #define KEY_SPACE '\040'  #define KEY_SPACE '\040'
22    
23  #ifndef EXTEND_KEY  #ifndef EXTEND_KEY
# Line 32  Line 26 
26  #define KEY_NULL 0xffff  #define KEY_NULL 0xffff
27  #define KEY_TIMEOUT 0xfffe  #define KEY_TIMEOUT 0xfffe
28  #define KEY_CONTROL 0xff  #define KEY_CONTROL 0xff
 #define KEY_TAB 9  
 #define KEY_ESC 27  
29  #define KEY_UP 0x0101  #define KEY_UP 0x0101
30  #define KEY_DOWN 0x0102  #define KEY_DOWN 0x0102
31  #define KEY_RIGHT 0x0103  #define KEY_RIGHT 0x0103
32  #define KEY_LEFT 0x0104  #define KEY_LEFT 0x0104
33    #define KEY_CSI 0x011b // ESC ESC
34  #define KEY_HOME 0x0201  #define KEY_HOME 0x0201
35  #define KEY_INS 0x0202  #define KEY_INS 0x0202
36  #define KEY_DEL 0x0203  #define KEY_DEL 0x0203
# Line 84  Line 77 
77  #define KEY_CTRL_F11 0x0229  #define KEY_CTRL_F11 0x0229
78  #define KEY_CTRL_F12 0x022a  #define KEY_CTRL_F12 0x022a
79    
80    #define KEY_CTRL_UP 0x0230
81    #define KEY_CTRL_DOWN 0x0231
82    #define KEY_CTRL_RIGHT 0x0232
83    #define KEY_CTRL_LEFT 0x0233
84    #define KEY_CTRL_HOME 0x0234
85    #define KEY_CTRL_END 0x0235
86    
87  #endif // EXPAND_KEY  #endif // EXPAND_KEY
88    
89  #define Ctrl(C) ((C) - 'A' + 1)  #define Ctrl(C) ((C) - 'A' + 1)
# Line 91  Line 91 
91  #define DOECHO (1)  #define DOECHO (1)
92  #define NOECHO (0)  #define NOECHO (0)
93    
94  extern int prints(const char *format, ...);  #define BBS_DEFAULT_CHARSET "UTF-8"
95    
96  extern int outc(char c);  extern char stdio_charset[20];
97    
98    extern int prints(const char *format, ...);
99    extern int outc(char c);
100  extern int iflush(void);  extern int iflush(void);
101    
102  extern int igetch(int timeout);  extern int igetch(int timeout);
   
103  extern int igetch_t(int sec);  extern int igetch_t(int sec);
   
104  extern void igetch_reset(void);  extern void igetch_reset(void);
105    
106    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);
107    extern int io_conv_init(const char *charset);
108    extern int io_conv_cleanup(void);
109    
110  #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