/[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.14 by sysadm, Mon Apr 28 03:30:59 2025 UTC Revision 1.17 by sysadm, Fri May 2 03:34:58 2025 UTC
# Line 16  Line 16 
16   ***************************************************************************/   ***************************************************************************/
17    
18  #include "io.h"  #include "io.h"
19    #include "log.h"
20  #include "common.h"  #include "common.h"
21  #include "tcplib.h"  #include "tcplib.h"
22  #include <stdio.h>  #include <stdio.h>
# Line 55  int iflush() Line 56  int iflush()
56          return retval;          return retval;
57  }  }
58    
59  int igetch()  int igetch(int clear_buf)
60  {  {
61          static char buf[256];          static char buf[256];
62          unsigned char c, tmp[256];          unsigned char c, tmp[256];
# Line 64  int igetch() Line 65  int igetch()
65          fd_set testfds;          fd_set testfds;
66          struct timeval timeout;          struct timeval timeout;
67    
68            if (clear_buf)
69            {
70                    pos = 0;
71                    len = 0;
72    
73                    return 0;
74            }
75    
76          // Stop on system exit          // Stop on system exit
77          if (SYS_exit)          if (SYS_exit)
78                  return KEY_NULL;                  return KEY_NULL;
# Line 226  int igetch_t(long int sec) Line 235  int igetch_t(long int sec)
235    
236          do          do
237          {          {
238                  ch = igetch();                  ch = igetch(0);
239          } while ((ch == KEY_TIMEOUT || ch == 0xa) && (time(0) - t_begin < sec));          } while ((ch == KEY_TIMEOUT || ch == 0xa) && (time(0) - t_begin < sec));
240    
241          return ch;          return ch;


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

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