/[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.128 by sysadm, Sat Nov 8 09:05:59 2025 UTC Revision 1.136 by sysadm, Thu Dec 18 10:43:48 2025 UTC
# Line 6  Line 6 
6   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7   */   */
8    
9    #ifdef HAVE_CONFIG_H
10    #include "config.h"
11    #endif
12    
13  #include "bbs.h"  #include "bbs.h"
14  #include "common.h"  #include "common.h"
15  #include "editor.h"  #include "editor.h"
# Line 24  Line 28 
28  #include <wchar.h>  #include <wchar.h>
29  #include <sys/param.h>  #include <sys/param.h>
30  #include <sys/stat.h>  #include <sys/stat.h>
 #include <sys/shm.h>  
31  #include <sys/types.h>  #include <sys/types.h>
32    
33  const char CTRL_SEQ_CLR_LINE[] = "\033[K";  const char CTRL_SEQ_CLR_LINE[] = "\033[K";
# Line 85  void clrtobot(int line_begin) Line 88  void clrtobot(int line_begin)
88  void clearscr()  void clearscr()
89  {  {
90          prints("\033[2J");          prints("\033[2J");
91          moveto(0, 0);          moveto(1, 1);
92  }  }
93    
94  inline int press_any_key()  inline int press_any_key()
# Line 206  static int _str_input(char *buffer, int Line 209  static int _str_input(char *buffer, int
209                                  ch = igetch(100);                                                // 0.1 second                                  ch = igetch(100);                                                // 0.1 second
210                                  if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input                                  if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input
211                                  {                                  {
212  #ifdef _DEBUG                                          log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len);
                                         log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len);  
 #endif  
213                                          str_len = 0;                                          str_len = 0;
214                                          break;                                          break;
215                                  }                                  }
# Line 530  int get_data(int row, int col, char *pro Line 531  int get_data(int row, int col, char *pro
531                                  ch = igetch(100);                                                // 0.1 second                                  ch = igetch(100);                                                // 0.1 second
532                                  if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input                                  if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input
533                                  {                                  {
534  #ifdef _DEBUG                                          log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len);
                                         log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len);  
 #endif  
535                                          str_len = 0;                                          str_len = 0;
536                                          break;                                          break;
537                                  }                                  }
# Line 700  int display_data(const void *p_data, lon Line 699  int display_data(const void *p_data, lon
699                                  if (ch != KEY_NULL && ch != KEY_TIMEOUT)                                  if (ch != KEY_NULL && ch != KEY_TIMEOUT)
700                                  {                                  {
701                                          BBS_last_access_tm = time(NULL);                                          BBS_last_access_tm = time(NULL);
702    
703                                            // Refresh current action
704                                            if (user_online_update(NULL) < 0)
705                                            {
706                                                    log_error("user_online_update(NULL) error\n");
707                                            }
708                                  }                                  }
709    
710                                  // extended key handler                                  // extended key handler
# Line 711  int display_data(const void *p_data, lon Line 716  int display_data(const void *p_data, lon
716                                  switch (ch)                                  switch (ch)
717                                  {                                  {
718                                  case KEY_NULL:                                  case KEY_NULL:
719                                          log_error("KEY_NULL\n");                                          log_debug("KEY_NULL\n");
720                                          goto cleanup;                                          goto cleanup;
721                                  case KEY_TIMEOUT:                                  case KEY_TIMEOUT:
722                                          log_error("User input timeout\n");                                          log_debug("User input timeout\n");
723                                          goto cleanup;                                          goto cleanup;
724                                  case KEY_HOME:                                  case KEY_HOME:
725                                          if (line_current - output_current_row < 0) // Reach begin                                          if (line_current - output_current_row < 0) // Reach begin
# Line 867  int display_file_key_handler(int *p_key, Line 872  int display_file_key_handler(int *p_key,
872  int display_file(const char *filename, int eof_exit)  int display_file(const char *filename, int eof_exit)
873  {  {
874          int ret;          int ret;
875          const void *p_shm;          void *p_shm;
876          size_t data_len;          size_t data_len;
877          long line_total;          long line_total;
878          const void *p_data;          const void *p_data;


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

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