/[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.98 by sysadm, Mon Jun 16 14:30:44 2025 UTC Revision 1.102 by sysadm, Sat Jun 21 02:15:18 2025 UTC
# Line 14  Line 14 
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
16    
 #define _POSIX_C_SOURCE 200809L  
   
 #include "screen.h"  
17  #include "bbs.h"  #include "bbs.h"
18  #include "common.h"  #include "common.h"
 #include "str_process.h"  
 #include "log.h"  
 #include "io.h"  
19  #include "editor.h"  #include "editor.h"
20  #include "file_loader.h"  #include "file_loader.h"
21  #include <fcntl.h>  #include "io.h"
22    #include "log.h"
23    #include "login.h"
24    #include "screen.h"
25    #include "str_process.h"
26  #include <ctype.h>  #include <ctype.h>
27    #include <errno.h>
28    #include <fcntl.h>
29  #include <string.h>  #include <string.h>
 #include <unistd.h>  
30  #include <stdlib.h>  #include <stdlib.h>
31  #include <errno.h>  #include <unistd.h>
 #include <sys/types.h>  
 #include <sys/stat.h>  
32  #include <sys/param.h>  #include <sys/param.h>
33    #include <sys/stat.h>
34  #include <sys/shm.h>  #include <sys/shm.h>
35    #include <sys/types.h>
36    
37  #define ACTIVE_BOARD_HEIGHT 8  #define ACTIVE_BOARD_HEIGHT 8
38    
# Line 431  int display_data(const void *p_data, lon Line 430  int display_data(const void *p_data, lon
430                                          break;                                          break;
431                                  }                                  }
432    
433                                  BBS_last_access_tm = time(0);                                  BBS_last_access_tm = time(NULL);
434                          }                          }
435    
436                          continue;                          continue;
# Line 495  int display_file(const char *filename, i Line 494  int display_file(const char *filename, i
494                  return KEY_NULL;                  return KEY_NULL;
495          }          }
496    
497            if (user_online_update("VIEW_FILE") < 0)
498            {
499                    log_error("user_online_update(VIEW_FILE) error\n");
500            }
501    
502          ret = display_data(p_data, line_total, p_line_offsets, eof_exit, display_file_key_handler, DATA_READ_HELP);          ret = display_data(p_data, line_total, p_line_offsets, eof_exit, display_file_key_handler, DATA_READ_HELP);
503    
504          if (detach_file_shm(p_shm) < 0)          if (detach_file_shm(p_shm) < 0)
# Line 565  int show_bottom(const char *msg) Line 569  int show_bottom(const char *msg)
569    
570          len_username = (int)strnlen(BBS_username, sizeof(BBS_username));          len_username = (int)strnlen(BBS_username, sizeof(BBS_username));
571    
572          time_online = time(0) - BBS_login_tm;          time_online = time(NULL) - BBS_login_tm;
573          tm_online = gmtime(&time_online);          tm_online = gmtime(&time_online);
574          if (tm_online->tm_mday > 1)          if (tm_online->tm_mday > 1)
575          {          {
# Line 612  int show_active_board() Line 616  int show_active_board()
616                  }                  }
617          }          }
618    
619          if (time(0) - t_last_show >= 10)          if (time(NULL) - t_last_show >= 10)
620          {          {
621                  line_last = line_current;                  line_last = line_current;
622                  t_last_show = time(0);                  t_last_show = time(NULL);
623          }          }
624          else          else
625          {          {


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

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