/[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.39 by sysadm, Thu Jun 5 05:24:56 2025 UTC Revision 1.44 by sysadm, Tue Jun 17 02:06:48 2025 UTC
# Line 91  int outc(char c) Line 91  int outc(char c)
91          return ret;          return ret;
92  }  }
93    
94  int iflush()  int iflush(void)
95  {  {
96          int flags;          int flags;
97          struct epoll_event ev, events[MAX_EVENTS];          struct epoll_event ev, events[MAX_EVENTS];
# Line 311  int igetch(int timeout) Line 311  int igetch(int timeout)
311                                                  }                                                  }
312                                                  else if (ret == 0)                                                  else if (ret == 0)
313                                                  {                                                  {
314                                                            out = 0;
315                                                          break; // Check whether channel is still open                                                          break; // Check whether channel is still open
316                                                  }                                                  }
317                                          }                                          }
# Line 533  int igetch(int timeout) Line 534  int igetch(int timeout)
534                                  case 49:                                  case 49:
535                                          out = KEY_HOME;                                          out = KEY_HOME;
536                                          break;                                          break;
537                                    case 50:
538                                            out = KEY_INS;
539                                            break;
540                                  case 51:                                  case 51:
541                                          out = KEY_DEL;                                          out = KEY_DEL;
542                                          break;                                          break;
# Line 623  int igetch(int timeout) Line 627  int igetch(int timeout)
627                                  in_ascii = 0;                                  in_ascii = 0;
628                                  switch (tmp[4])                                  switch (tmp[4])
629                                  {                                  {
630                                    case 65:
631                                            out = KEY_CTRL_UP;
632                                            break;
633                                    case 66:
634                                            out = KEY_CTRL_DOWN;
635                                            break;
636                                    case 67:
637                                            out = KEY_CTRL_RIGHT;
638                                            break;
639                                    case 68:
640                                            out = KEY_CTRL_LEFT;
641                                            break;
642                                    case 70:
643                                            out = KEY_CTRL_END;
644                                            break;
645                                    case 72:
646                                            out = KEY_CTRL_HOME;
647                                            break;
648                                  case 80:                                  case 80:
649                                          out = KEY_CTRL_F1;                                          out = KEY_CTRL_F1;
650                                          break;                                          break;
# Line 791  int igetch(int timeout) Line 813  int igetch(int timeout)
813          // for debug          // for debug
814          // if (out != KEY_TIMEOUT && out != KEY_NULL)          // if (out != KEY_TIMEOUT && out != KEY_NULL)
815          // {          // {
816          //      log_common ("Debug: -->[0x %x]\n", out);          //      log_common("Debug: -->[0x %x]\n", out);
817          // }          // }
818    
819          return out;          return out;
# Line 800  int igetch(int timeout) Line 822  int igetch(int timeout)
822  int igetch_t(int sec)  int igetch_t(int sec)
823  {  {
824          int ch;          int ch;
825          time_t t_begin = time(0);          time_t t_begin = time(NULL);
826    
827          do          do
828          {          {
829                  ch = igetch(100);                  ch = igetch(100);
830          } while (!SYS_server_exit && ch == KEY_TIMEOUT && (time(0) - t_begin < sec));          } while (!SYS_server_exit && ch == KEY_TIMEOUT && (time(NULL) - t_begin < sec));
831    
832          return ch;          return ch;
833  }  }


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

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