/[LeafOK_CVS]/lbbs/src/io.c
ViewVC logotype

Diff of /lbbs/src/io.c

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

Revision 1.17 by sysadm, Fri May 2 03:34:58 2025 UTC Revision 1.18 by sysadm, Sun May 4 14:54:55 2025 UTC
# Line 58  int iflush() Line 58  int iflush()
58    
59  int igetch(int clear_buf)  int igetch(int clear_buf)
60  {  {
61            // static input buffer
62          static char buf[256];          static char buf[256];
63          unsigned char c, tmp[256];          static int len = 0;
64          int out = KEY_NULL, loop = 1, in_esc = 0, in_ascii = 0, in_control = 0, i = 0, j, result;          static int pos = 0;
65          static int len = 0, pos = 0;  
66          fd_set testfds;          unsigned char tmp[256];
67          struct timeval timeout;          int out = KEY_NULL;
68            int in_esc = 0;
69            int in_ascii = 0;
70            int in_control = 0;
71            int i = 0;
72    
73          if (clear_buf)          if (clear_buf)
74          {          {
# Line 79  int igetch(int clear_buf) Line 84  int igetch(int clear_buf)
84    
85          if (pos >= len)          if (pos >= len)
86          {          {
87                    fd_set testfds;
88                    struct timeval timeout;
89    
90                  pos = 0;                  pos = 0;
91                  len = 0;                  len = 0;
92    
# Line 88  int igetch(int clear_buf) Line 96  int igetch(int clear_buf)
96                  timeout.tv_sec = 1;                  timeout.tv_sec = 1;
97                  timeout.tv_usec = 0;                  timeout.tv_usec = 0;
98    
99                  result = SignalSafeSelect(FD_SETSIZE, &testfds, (fd_set *)NULL,                  int result = SignalSafeSelect(FD_SETSIZE, &testfds, (fd_set *)NULL,
100                                                                    (fd_set *)NULL, &timeout);                                                                    (fd_set *)NULL, &timeout);
101    
102                  if (result == 0)                  if (result == 0)
# Line 115  int igetch(int clear_buf) Line 123  int igetch(int clear_buf)
123    
124          while (pos < len)          while (pos < len)
125          {          {
126                  c = buf[pos++];                  unsigned char c = buf[pos++];
127    
128                  if (c == '\0')                  if (c == '\0')
129                  {                  {


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

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