/[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.21 by sysadm, Mon May 5 11:11:06 2025 UTC Revision 1.23 by sysadm, Mon May 5 11:59:18 2025 UTC
# Line 90  int load_bbsnet_conf(const char *file_co Line 90  int load_bbsnet_conf(const char *file_co
90                  p_menuitem = p_menu->items[item_count] = malloc(sizeof(MENU_ITEM));                  p_menuitem = p_menu->items[item_count] = malloc(sizeof(MENU_ITEM));
91                  p_menuitem->row = 2 + item_count / STATION_PER_LINE;                  p_menuitem->row = 2 + item_count / STATION_PER_LINE;
92                  p_menuitem->col = 5 + item_count % STATION_PER_LINE * 20;                  p_menuitem->col = 5 + item_count % STATION_PER_LINE * 20;
93                  sprintf(p_menuitem->action, "%d", item_count);                  snprintf(p_menuitem->action, sizeof(p_menuitem->action), "%d", item_count);
94                  p_menuitem->submenu = 0;                  p_menuitem->submenu = 0;
95                  p_menuitem->priv = 0;                  p_menuitem->priv = 0;
96                  p_menuitem->level = 0;                  p_menuitem->level = 0;
# Line 124  static void process_bar(int n, int len) Line 124  static void process_bar(int n, int len)
124          char *ptr3;          char *ptr3;
125    
126          moveto(4, 0);          moveto(4, 0);
127          prints("┌──────────────────────────────┐\r\n");          prints(" ------------------------------ \r\n");
128          sprintf(buf2, "            %3d%%              ", n * 100 / len);          snprintf(buf2, sizeof(buf2), "            %3d%%              ", n * 100 / len);
129          ptr = buf;          ptr = buf;
130          ptr2 = buf2;          ptr2 = buf2;
131          ptr3 = buf + n;          ptr3 = buf + n;
# Line 139  static void process_bar(int n, int len) Line 139  static void process_bar(int n, int len)
139          while (*ptr2 != '\0')          while (*ptr2 != '\0')
140                  *ptr++ = *ptr2++;                  *ptr++ = *ptr2++;
141          *ptr++ = '\0';          *ptr++ = '\0';
142          prints("│\033[46m%s\033[m│\r\n", buf);          prints("|\033[46m%s\033[m|\r\n", buf);
143          prints("└──────────────────────────────┘\r\n");          prints(" ------------------------------ \r\n");
144          iflush();          iflush();
145  }  }
146    
# Line 318  bbsnet_refresh() Line 318  bbsnet_refresh()
318  {  {
319          clearscr();          clearscr();
320          moveto(1, 0);          moveto(1, 0);
321          prints("╭═════════════════════════════════════════════════════════════════════════════╮");          prints(" ----------------------------------------------------------------------------- ");
322          for (int i = 2; i < 19; i++)          for (int i = 2; i < 19; i++)
323          {          {
324                  moveto(i, 0);                  moveto(i, 0);
325                  prints("║");                  prints("|");
326                  moveto(i, 79);                  moveto(i, 79);
327                  prints("║");                  prints("|");
328          }          }
329          moveto(19, 0);          moveto(19, 0);
330          prints("║—————————————————————————————————————————————————————————————————————————————║");          prints("|-----------------------------------------------------------------------------|");
331          moveto(22, 0);          moveto(22, 0);
332          prints("╰═════════════════════════════════════════════════════════════════════════════╯");          prints(" ----------------------------------------------------------------------------- ");
333          moveto(23, 0);          moveto(23, 0);
334          prints(" [\x1b[1;32mCtrl+C\x1b[m]退出");          prints(" [\x1b[1;32mCtrl+C\x1b[m]退出");
335    
# Line 342  int bbsnet_selchange(int new_pos) Line 342  int bbsnet_selchange(int new_pos)
342  {  {
343          moveto(20, 0);          moveto(20, 0);
344          clrtoeol();          clrtoeol();
345          prints("║\x1b[1m单位:\x1b[1;33m%-18s\x1b[m  站名:\x1b[1;33m%s\x1b[m",          prints("|\x1b[1m单位:\x1b[1;33m%-18s\x1b[m  站名:\x1b[1;33m%s\x1b[m",
346                     bbsnet_conf[new_pos].host2, bbsnet_conf[new_pos].host1);                     bbsnet_conf[new_pos].host2, bbsnet_conf[new_pos].host1);
347          moveto(20, 79);          moveto(20, 79);
348          prints("║");          prints("|");
349          moveto(21, 0);          moveto(21, 0);
350          clrtoeol();          clrtoeol();
351          prints("║\x1b[1m连往:\x1b[1;33m%-20s", bbsnet_conf[new_pos].ip);          prints("|\x1b[1m连往:\x1b[1;33m%-20s", bbsnet_conf[new_pos].ip);
352          if (bbsnet_conf[new_pos].port != 23)          if (bbsnet_conf[new_pos].port != 23)
353          {          {
354                  prints("  %d", bbsnet_conf[new_pos].port);                  prints("  %d", bbsnet_conf[new_pos].port);
355          }          }
356          prints("\x1b[m");          prints("\x1b[m");
357          moveto(21, 79);          moveto(21, 79);
358          prints("║");          prints("|");
359          iflush();          iflush();
360    
361          return 0;          return 0;


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

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