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

Diff of /lbbs/src/screen.c

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

Revision 1.113 by sysadm, Fri Oct 17 11:23:30 2025 UTC Revision 1.114 by sysadm, Sat Oct 18 05:02:15 2025 UTC
# Line 104  void clearscr() Line 104  void clearscr()
104    
105  inline int press_any_key()  inline int press_any_key()
106  {  {
107          return press_any_key_ex("                           \033[1;33m按任意键继续...\033[m");          return press_any_key_ex("                           \033[1;33m按任意键继续...\033[m", 60);
108  }  }
109    
110  int press_any_key_ex(const char *msg)  int press_any_key_ex(const char *msg, int sec)
111  {  {
112          int ch = 0;          int ch = 0;
         int wait_seconds = 60;  
113          int duration = 0;          int duration = 0;
114          time_t t_begin = time(NULL);          time_t t_begin = time(NULL);
115    
# Line 120  int press_any_key_ex(const char *msg) Line 119  int press_any_key_ex(const char *msg)
119          prints(msg);          prints(msg);
120          iflush();          iflush();
121    
122            igetch_reset();
123    
124          do          do
125          {          {
126                  ch = igetch_t(wait_seconds - duration);                  ch = igetch_t(sec - duration);
127                  duration = (int)(time(NULL) - t_begin);                  duration = (int)(time(NULL) - t_begin);
128          } while (!SYS_server_exit && ch == 0 && duration < 60);          } while (!SYS_server_exit && ch == 0 && duration < 60);
129    


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

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