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

Diff of /lbbs/src/bbs_net.c

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

Revision 1.72 by sysadm, Mon Oct 20 03:38:23 2025 UTC Revision 1.75 by sysadm, Sat Nov 1 15:34:45 2025 UTC
# Line 56  struct _bbsnet_conf Line 56  struct _bbsnet_conf
56          char charset[20];          char charset[20];
57  } bbsnet_conf[MAXSTATION];  } bbsnet_conf[MAXSTATION];
58    
59  MENU_SET bbsnet_menu;  static MENU_SET bbsnet_menu;
60    
61  int load_bbsnet_conf(const char *file_config)  static int load_bbsnet_conf(const char *file_config)
62  {  {
63          FILE *fp;          FILE *fp;
64          MENU *p_menu;          MENU *p_menu;
# Line 153  int load_bbsnet_conf(const char *file_co Line 153  int load_bbsnet_conf(const char *file_co
153          return 0;          return 0;
154  }  }
155    
156  void unload_bbsnet_conf(void)  static void unload_bbsnet_conf(void)
157  {  {
158          bbsnet_menu.menu_count = 0;          bbsnet_menu.menu_count = 0;
159          bbsnet_menu.menu_item_count = 0;          bbsnet_menu.menu_item_count = 0;
# Line 164  void unload_bbsnet_conf(void) Line 164  void unload_bbsnet_conf(void)
164          bbsnet_menu.p_menu_item_pool = NULL;          bbsnet_menu.p_menu_item_pool = NULL;
165  }  }
166    
167  void process_bar(int n, int len)  static void process_bar(int n, int len)
168  {  {
169          char buf[LINE_BUFFER_LEN];          char buf[LINE_BUFFER_LEN];
170          char buf2[LINE_BUFFER_LEN];          char buf2[LINE_BUFFER_LEN];
# Line 185  void process_bar(int n, int len) Line 185  void process_bar(int n, int len)
185          moveto(4, 0);          moveto(4, 0);
186          prints(" ------------------------------ \r\n");          prints(" ------------------------------ \r\n");
187          snprintf(buf, sizeof(buf), "            %3d%%              ", n * 100 / len);          snprintf(buf, sizeof(buf), "            %3d%%              ", n * 100 / len);
188          strncpy(buf2, buf, (size_t)n);          memcpy(buf2, buf, (size_t)n);
189          buf2[n] = '\0';          buf2[n] = '\0';
190          prints("|\033[46m%s\033[44m%s\033[m|\r\n", buf2, buf + n);          prints("|\033[46m%s\033[44m%s\033[m|\r\n", buf2, buf + n);
191          prints(" ------------------------------ \r\n");          prints(" ------------------------------ \r\n");
192          iflush();          iflush();
193  }  }
194    
195  int bbsnet_connect(int n)  static int bbsnet_connect(int n)
196  {  {
197          int sock, ret, loop, error;          int sock, ret, loop, error;
198          int sock_connected = 0;          int sock_connected = 0;
# Line 539  int bbsnet_connect(int n) Line 539  int bbsnet_connect(int n)
539                                                  // Send NO-OP to remote server                                                  // Send NO-OP to remote server
540                                                  input_buf[input_buf_len] = '\0';                                                  input_buf[input_buf_len] = '\0';
541                                                  input_buf_len++;                                                  input_buf_len++;
542                                                    BBS_last_access_tm = time(NULL);
543    
544                                                  stdin_read_wait = 0;                                                  stdin_read_wait = 0;
545                                                  break; // Check whether channel is still open                                                  break; // Check whether channel is still open
# Line 806  cleanup: Line 807  cleanup:
807          return 0;          return 0;
808  }  }
809    
810  static int  static int bbsnet_refresh()
 bbsnet_refresh()  
811  {  {
812          clearscr();          clearscr();
813          moveto(1, 0);          moveto(1, 0);
# Line 831  bbsnet_refresh() Line 831  bbsnet_refresh()
831          return 0;          return 0;
832  }  }
833    
834  int bbsnet_selchange()  static int bbsnet_selchange()
835  {  {
836          int i = bbsnet_menu.menu_item_pos[0];          int i = bbsnet_menu.menu_item_pos[0];
837    
# Line 856  int bbsnet_selchange() Line 856  int bbsnet_selchange()
856          return 0;          return 0;
857  }  }
858    
859  int bbs_net()  extern int bbs_net()
860  {  {
861          int ch, i;          int ch, i;
862    


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

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