📄 ecuicmd.c
字号:
ff(se,"\r\nscreen dump name: %s\r\n",screen_dump_file_name); break; case CTlog: case CTloff: case CTllp: icmd_log(token,narg,arg); break; case CTnl: case CTnlin: case CTnlout: nlin_nlout_control(token,narg,arg); break; case CTparity: if(narg > 1) { switch(to_lower(*arg[1])) { case 'n': shm->Lparity = 0; break; case 'e': case 'o': shm->Lparity = to_lower(*arg[1]); break; default: ff(se," unrecognized parity: %c\r\n",*arg[1]); goto PARITY_DONE; } lset_parity(1); } ff(se," parity set to %c\r\n", (shm->Lparity) ? to_upper(shm->Lparity) : 'N');PARITY_DONE: ; break; case CTpid: ff(se,": xmtr %d, rcvr: %d, parent: %d, group: %d\r\n", xmtr_pid,rcvr_pid,shm->xmtr_ppid,shm->xmtr_pgrp); break; case CTpwd: ff(se," %s\r\n",curr_dir); break; case CTredial: (void)DCE_redial(arg,narg); break; case CTrev: fputs("\r\n",se); fputs(hello_str,se); fputs("\r\n",se); ff(se,"%s\r\n",makedate);#if defined(MEMCHECK) _dump_malloc();#endif break; case CTtime: get_tod(4,cmd); ff(se,": %s\r\n",cmd); break; case CTdcdwatch: if(narg > 1) { if(ldcdwatch_str(arg[1])) ff(se," ... argument error; remains set to "); else ff(se," ... set to "); } else ff(se," is "); cptr = "???"; switch(shm->Ldcdwatch) { case DCDW_OFF: cptr = "off"; break; case DCDW_ON: cptr = "on"; break; case DCDW_TERMINATE: cptr = "TERMINATE"; break; } ff(se,"%s\r\n",cptr); break; case CTts: ff(se,"\r\n"); sprintf(s80,"TTYIN %s (ttymode=%d)",get_ttyname(),current_ttymode); disp_line_termio(TTYIN,s80); ff(se,"\r\n"); sprintf(s80,"comm line %s",shm->Lline); disp_line_termio(shm->Liofd,s80);#ifdef sun ioctl(shm->Liofd,TIOCMGET,(char *)&modem_lines); ff(se,"Current modem signals: RTS:%c CTS:%c DCD:%c\r\n", (modem_lines & TIOCM_RTS) ? '1' : '0', (modem_lines & TIOCM_CTS) ? '1' : '0', (modem_lines & TIOCM_CD) ? '1' : '0');#endif break;#if defined(FASI) case CTfasi: icmd_fasi(narg,arg); break;#endif case CTtty: ff(se," %s\r\n",get_ttyname()); break; case CTda: case CToa: case CTxa: case CTax: icmd_conversion(token,narg,arg); break; case CTbn: if(narg < 2) ff(se," is "); else { if((itmp = parse_bell_notify_argument(arg[1])) < 0) ff(se,"\r\nbad argument (try help bn); remains set to "); else { shm->bell_notify_state = itmp; ff(se," set to "); } } ff(se,"%s\r\n",bell_notify_text(shm->bell_notify_state)); break; case CTrtscts:#if defined(HW_FLOW_CONTROL) /* see ecu.h */ if(narg > 1) { lRTSCTS_control(yes_or_no(arg[1])); pputs("\nNew c"); } else pputs("\nC"); pputs("onfiguration: "); display_hw_flow_config();#else /* !HW_FLOW_CONTROL */ ff(se,"\r\nhardware flow control not available\r\n");#endif /* HW_FLOW_CONTROL */ break; case CTeto: if(narg > 1) { itmp = atoi(arg[1]); if((itmp < 20) || (itmp > 1000)) { ff(se," invalid\r\n"); } tty_escape_timeout = (long)itmp; ff(se," set to"); } ff(se," %ld msec\r\n",tty_escape_timeout); break; case CTnice: itmp = nice(0) + 20; if(narg > 1) { kill_rcvr_process(SIGUSR1); itmp2 = atoi(arg[1]); itmp3 = nice(-itmp + itmp2); ff(se," -> desired=%d, was %d, ",itmp2,itmp); if(itmp3 < 0) ff(se,"nice failed: %s\r\n",errno_text(errno)); else ff(se,"set to %d\r\n",itmp3); start_rcvr_process(0); } else ff(se," is %d\r\n",itmp); break; case CTfkey: if(narg < 2) keyset_display(); else if(!strcmp(arg[1],"-r")) { keyset_init(); keyset_read("default"); ff(se," keyboard reset done ...\r\n"); } else { switch(keyset_read(arg[1])) { case 0: keyset_display(); break; case -1: ff(se," cannot find ~/.ecu/keys\r\n"); break; case -2: ff(se," not found in ~/.ecu/keys\r\n"); break; case -3: ff(se," syntax error ... default restored\r\n"); default: keyset_init(); keyset_read("default"); break; } } break; case CTfkmap: ff(se,"\r\n"); fkmap_command(narg,arg); break; case CTstat: get_tod(4,s80); ff(se,"\r\nDate: %s\r\n",s80); ff(se,"Communications line: %s %u-%c-1 ", shm->Lline, shm->Lbaud, (shm->Lparity) ? to_upper(shm->Lparity) : 'N'); lget_xon_xoff(&itmp2,&itmp3); ff(se,"XON/XOFF input %s output %s\r\n", (itmp2) ? "on" : "off", /* IXON */ (itmp3) ? "on" : "off"); /* IXOFF */ #if defined(HW_FLOW_CONTROL) /* see ecu.h */ ff(se,"Hardware flow control configuration: "); display_hw_flow_config();#else ff(se,"no hardware flow control available\r\n");#endif if(!shm->Lconnected) ff(se,"Not connected to a remote\r\n"); else { ff(se,"Connected to %s: %s (%s)\r\n", shm->Lrname,shm->Ldescr,shm->Ltelno); ff(se,"at %s (elapsed %s)\r\n", epoch_secs_to_str(shm->Loff_hook_time,1,s80), get_elapsed_time(time((long *)0) - shm->Loff_hook_time)); } ff(se,"Duplex: %s ",(shm->Lfull_duplex) ? "full" : "half"); cptr = "???"; switch(shm->Ldcdwatch) { case DCDW_OFF: cptr = "off"; break; case DCDW_ON: cptr = "on"; break; case DCDW_TERMINATE: cptr = "TERMINATE"; break; } ff(se,"DCD watcher: %s\r\n",cptr); ff(se,"Console: %s %dx%d ",get_ttyname(),tcap_COLS,tcap_LINES); if(tty_is_multiscreen) ff(se,"<multiscreen> "); if(tty_is_scoterm) ff(se,"<scoterm> "); if(tty_is_pty) ff(se,"<pty> "); if(kbd_is_7bit) ff(se,"<7-bit kbd> "); fputs(console_xon_status(),se); ff(se,"\r\n");#if defined(USE_ECUUNGETTY) display_ungetty_list();#endif ff(se,"Current directory: %s\r\n",curr_dir); ff(se,"Total chars transmitted: %ld",shm->xmit_chars); if(shm->Lconnected) ff(se," (since CONNECT %ld)\r\n", shm->xmit_chars_this_connect); else fputs("\r\n",se); ff(se,"Total chars received: %ld",shm->rcvd_chars); if(shm->Lconnected) ff(se," (since CONNECT %ld)\r\n",shm->rcvd_chars_this_connect); else fputs("\r\n",se); if(keyset_name[0]) ff(se,"Function key set '%s' loaded\r\n",keyset_name); else ff(se,"No function key set loaded\r\n"); if(rcvr_log) { ff(se,"Session log open: %s (%s mode)\r\n", rcvr_log_file,(rcvr_log_raw) ? "raw" : "filtered"); } else ff(se,"Session logging not active\r\n"); ff(se,"Bell notify is %s\r\n", bell_notify_text(shm->bell_notify_state)); ff(se,"CR conversion: incoming %s outgoing %s\r\n", (shm->Ladd_nl_incoming) ? "CR/LF" : "CR", (shm->Ladd_nl_outgoing) ? "CR/LF" : "CR"); ff(se,"Keyboard ESC/funckey time constant = %ld msec\r\n", tty_escape_timeout); ff(se,"Pids: xmtr=%d rcvr=%d parent=%d pgrp=%d\r\n", xmtr_pid, rcvr_pid, shm->xmtr_pgrp, shm->xmtr_ppid); fputs("\r\n",se); break; case CTxon: if(narg > 1) { if(set_xon_xoff_by_arg(arg[1])) ff(se," argument error\r\n"); else ff(se,"\r\n"); break; } ff(se," xon/xoff flow control: %s\r\n",xon_status()); break; case CTconxon: if(narg > 1) { if(set_console_xon_xoff_by_arg(arg[1])) ff(se," argument error\r\n"); else ff(se,"\r\n"); break; } ff(se,"\r\nconsole xon/xoff flow control: %s\r\n",console_xon_status()); break; case CTsgr: send_get_response(narg,arg); break;/* case CTmkdir: if(narg < 2) ff(se," no argument\r\n"); if(mkdir(arg[2],0755)) { ff(se," "); pperror(arg[2]); } else ff(se," made directory %s\r\n",arg[2]); break;*/ case CTmemstat:#if defined(MALLOC_3X) { struct mallinfo minfo; extern char *startbrk; extern char *startsp; char *sbrk(); minfo = mallinfo(); pputs("\n"); /* all this casting for 16- vs 32- bit ints */ pprintf("%10lu total space in arena\n",(ulong)minfo.arena); pprintf("%10lu number of ordinary blocks\n",(ulong)minfo.ordblks); pprintf("%10lu number of small blocks\n",(ulong)minfo.smblks); pprintf("%10lu number of holding blocks\n",(ulong)minfo.hblks); pprintf("%10lu space in holding block headers\n",(ulong)minfo.hblkhd); pprintf("%10lu space in small blocks in use\n",(ulong)minfo.usmblks); pprintf("%10lu space in free small blocks\n",(ulong)minfo.fsmblks); pprintf("%10lu space in ordinary blocks in use\n", (ulong)minfo.uordblks); pprintf("%10lu space in free ordinary blocks\n",(ulong)minfo.fordblks); pprintf("%10lu cost of enabling keep option\n",(ulong)minfo.keepcost); pprintf(" %08lx startbrk\n",startbrk); pprintf(" %08lx sbrk(0) ",sbrk(0)); pprintf(" (break delta %10ld)\n",sbrk(0) - startbrk); pprintf(" %08lx startsp\n",startsp); pprintf(" %08lx sp ",&minfo); pprintf(" (stack size %10ld)\n",(long)(startsp - (char *)&minfo)); }#else ff(se," not available\r\n");#endif break; case CTkbdtest: ff(se,"\r\n"); kbd_test(); break; case 0: ff(se," procedure command not allowed in interactive mode\r\n"); break; default: do_proc(narg,arg); sigint = 0; break; } return(0); /* 0 == do not end program */} /* end of icmd *//* end of ecuicmd.c *//* vi: set tabstop=4 shiftwidth=4: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -