⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.c

📁 minicom2.0源代码
💻 C
📖 第 1 页 / 共 4 页
字号:
  		P_PNAME(f), P_PPROG(f),  		P_PNN(f), P_PUD(f),		P_PFULL(f), P_PIORED(f),	  	P_MUL(f));     else        wprintf(w, "%c    -", 'A' + f);  }  wlocate(w, 1, 13);  wprintf(w, "%s %c", zmodem_download, P_PAUTO[0]);  wlocate(w, 1, 14);  wprintf(w, "%s %s", use_filename_selection, _(P_FSELW));  wlocate(w, 1, 15);  wprintf(w, "%s %s", prompt_downdir, _(P_ASKDNDIR));  wlocate(w, 3, 17);  wputs(w, question);  wredraw(w, 1);  do {  	wlocate(w, strlen (question) + 4, 17);  	c = rwxgetch();  	if (c >= 'A' && c <= 'L') inputproto(w, c - 'A');  	if (c == ' ') {  		wlocate(w, 3, 17);  		wputs(w, _("Delete which protocol? "));  		wclreol(w);  		c = rwxgetch();  		if (c >= 'A' && c <= 'L') {  			P_PNAME(c - 'A')[0] = '\0';  			mpars[PROTO_BASE + (c - 'A')].flags |= CHANGED;  			wlocate(w, 3, c - 'A' + 1);  			wclreol(w);  			wputs(w, "   -");  		}		wlocate(w, 3, 17);		wputs(w, question);		c = ' ';	}	else if (c == 'M') {		wlocate(w, strlen (zmodem_download) + 2, 13);		wprintf(w, " \b");		c = rwxgetch();		if (c >= 'A' && c <= 'L') {			P_PAUTO[0] = c;			markch(P_PAUTO);			wprintf(w, "%c", c);		} else if (c == '\n' || c == ' ') {			P_PAUTO[0] = ' ';			markch(P_PAUTO);		} else {			wprintf(w, "%c", P_PAUTO[0]);		}		c = 0;	}	else if (c == 'N') {		strcpy(P_FSELW, yesno(P_FSELW[0] == 'N'));		if (P_FSELW[0] == 'N') {		  strcpy(P_ASKDNDIR, "No ");		  wlocate(w, strlen (prompt_downdir) + 2, 15);		  wprintf(w, "%s ", _(P_ASKDNDIR));		  markch(P_ASKDNDIR);		}		wlocate(w, strlen (use_filename_selection) + 2, 14);		wprintf(w, "%s ", _(P_FSELW));		markch(P_FSELW);	}	else if (c == 'O') {	  	strcpy(P_ASKDNDIR, yesno(P_ASKDNDIR[0] == 'N'));		if (P_ASKDNDIR[0] == 'Y') {		  strcpy(P_FSELW, "Yes");		  wlocate(w, strlen (use_filename_selection) + 2, 14);		  wprintf(w, "%s ", _(P_FSELW));		  markch(P_FSELW);		}		wlocate(w, strlen (prompt_downdir) + 2, 15);		wprintf(w, "%s ", _(P_ASKDNDIR));		markch(P_ASKDNDIR);	}  } while(c != '\n');  wclose(w, 1);}static void doserial(){  WIN *w;  char* serial_device = _(" A -    Serial Device      :"),      * lockfile_location = _(" B - Lockfile Location     :"),      * callin_program = _(" C -   Callin Program      :"),      * callout_program = _(" D -  Callout Program      :"),      * bps_par_bits = _(" E -    Bps/Par/Bits       :"),      * hardware_flow_control = _(" F - Hardware Flow Control :"),      * software_flow_control = _(" G - Software Flow Control :"),      * question = _("Change which setting?");  w = wopen(5, 4, 75, 12, BDOUBLE, stdattr, mfcolor, mbcolor, 0, 0, 1);  wprintf(w, "%s %.41s\n", serial_device, P_PORT);  wprintf(w, "%s %.41s\n", lockfile_location, P_LOCK);  wprintf(w, "%s %.41s\n", callin_program, P_CALLIN);  wprintf(w, "%s %.41s\n", callout_program, P_CALLOUT);  wprintf(w, "%s %s %s%s%s\n",	  bps_par_bits, P_BAUDRATE, P_BITS, P_PARITY, P_STOPB);  wprintf(w, "%s %s\n", hardware_flow_control, _(P_HASRTS));  wprintf(w, "%s %s\n", software_flow_control, _(P_HASXON));  wlocate(w, 4, 8);  wputs(w, question);  wredraw(w, 1);  while(1) {      wlocate(w, strlen (question) + 5, 8);      switch(rwxgetch()) {  	case '\n':  		wclose(w, 1);  		return;  	case 'A':  		pgets(w, strlen (serial_device) + 1, 0, P_PORT, 64, 64);  		break;  	case 'B':  		pgets(w, strlen (lockfile_location) + 1, 1, P_LOCK, 64, 64);  		break;  	case 'C':  		pgets(w, strlen (callin_program) + 1, 2, P_CALLIN, 64, 64);  		break;  	case 'D':  		pgets(w, strlen (callout_program) + 1, 3, P_CALLOUT, 64, 64);  		break;  	case 'E':  		get_bbp(P_BAUDRATE, P_BITS, P_PARITY, P_STOPB, 0);  		if (portfd >= 0) port_init();  		wlocate(w, strlen (bps_par_bits) + 1, 4);		wprintf(w, "%s %s%s%s  \n",			P_BAUDRATE, P_BITS, P_PARITY, P_STOPB);		if (st != NIL_WIN) mode_status();		markch(P_BAUDRATE);		markch(P_BITS);		markch(P_PARITY);		markch(P_STOPB);		break;	case 'F':		strcpy(P_HASRTS, yesno(P_HASRTS[0] == 'N'));		wlocate(w, strlen (hardware_flow_control) + 1, 5);		wprintf(w, "%s ", _(P_HASRTS));  		if (portfd >= 0) port_init();		markch(P_HASRTS);		break;	case 'G':		strcpy(P_HASXON, yesno(P_HASXON[0] == 'N'));		wlocate(w, strlen (software_flow_control) + 1, 6);		wprintf(w, "%s ", _(P_HASXON));  		if (portfd >= 0) port_init();		markch(P_HASXON);		break;  	default:  		break;      }  }}char * sspd(char *sptyp){  if (sptyp[0] == 'd')    return (_("DTE speed "));  else    return (_("line speed"));}static void domodem(){  WIN *w;  char *str;  int c, x, y, ypos, maxl, string_size;  char* init_string = _(" A - Init string ........."),      * reset_string = _(" B - Reset string ........"),      * dialing_prefix_1 = _(" C - Dialing prefix #1...."),      * dialing_suffix_1 = _(" D - Dialing suffix #1...."),      * dialing_prefix_2 = _(" E - Dialing prefix #2...."),      * dialing_suffix_2 = _(" F - Dialing suffix #2...."),      * dialing_prefix_3 = _(" G - Dialing prefix #3...."),      * dialing_suffix_3 = _(" H - Dialing suffix #3...."),      * connect_string = _(" I - Connect string ......"),      * no_connect_strings = _(" J - No connect strings .."),      * hangup_string = _(" K - Hang-up string ......"),      * dial_cancel_string = _(" L - Dial cancel string .."),      * dial_time = _(" M - Dial time ..........."),      * delay_before_redial = _(" N - Delay before redial ."),      * number_of_tries = _(" O - Number of tries ....."),      * dtr_drop_time = _(" P - DTR drop time (0=no)."),      * auto_bps_detect = _(" Q - Auto bps detect ....."),      * modem_has_dcd_line = _(" R - Modem has DCD line .."),      * shown_speed = _(" S - Status line shows ..."),      * multi_node = _(" T - Multi-line untag ...."),      * question = _("Change which setting?");  w = wopen(2, 2, 77, 22, BDOUBLE, stdattr, mfcolor, mbcolor, 0, 0, 1);  dirflush = 0;  wtitle(w, TMID, _("Modem and dialing parameter setup"));  wprintf(w, "\n");  wprintf(w, "%s %.48s\n", init_string, P_MINIT);  wprintf(w, "%s %.48s\n", reset_string, P_MRESET);  wprintf(w, "%s %.48s\n", dialing_prefix_1, P_MDIALPRE);  wprintf(w, "%s %.48s\n", dialing_suffix_1, P_MDIALSUF);  wprintf(w, "%s %.48s\n", dialing_prefix_2, P_MDIALPRE2);  wprintf(w, "%s %.48s\n", dialing_suffix_2, P_MDIALSUF2);  wprintf(w, "%s %.48s\n", dialing_prefix_3, P_MDIALPRE3);  wprintf(w, "%s %.48s\n", dialing_suffix_3, P_MDIALSUF3);  wprintf(w, "%s %.48s\n", connect_string, P_MCONNECT);  wprintf(w, "%s %-20.20s  %.20s\n", no_connect_strings, P_MNOCON1, P_MNOCON2);  wlocate(w, strlen (no_connect_strings) + 1, 11);  wprintf(w, "%-20.20s  %.20s\n", P_MNOCON3, P_MNOCON4);  wprintf(w, "%s %.48s\n", hangup_string, P_MHANGUP);  wprintf(w, "%s %.48s\n", dial_cancel_string, P_MDIALCAN);  wprintf(w, "\n");  wprintf(w, "%s %.3s\n", dial_time, P_MDIALTIME);  wprintf(w, "%s %.3s\n", delay_before_redial, P_MRDELAY);  wprintf(w, "%s %.3s\n", number_of_tries, P_MRETRIES);  wprintf(w, "%s %.3s\n", dtr_drop_time, P_MDROPDTR);  wlocate(w, 34, 15);  wprintf(w, "%s %s\n", auto_bps_detect, _(P_MAUTOBAUD));  wlocate(w, 34, 16);  wprintf(w, "%s %s\n", modem_has_dcd_line, _(P_HASDCD));  wlocate(w, 34, 17);  wprintf(w, "%s %s\n", shown_speed, sspd(P_SHOWSPD));  wlocate(w, 34, 18); /* Option for multi-node untag */  wprintf(w, "%s %s\n", multi_node, _(P_MULTILINE));	/* er 18-Apr-99 */  wlocate(w, 1, 20);  wprintf(w, "%s ", question);  x = w->curx; y = w->cury;  wprintf(w, _("      (Return or Esc to exit)"));  wredraw(w, 1);  while(1) {  	wlocate(w, x, y);  	wflush();  	c = rwxgetch();  	ypos = 1;	maxl = 64;	string_size = 0;  	switch(c) {  		case 'M':			if (string_size == 0)			  string_size = strlen (dial_time);  		case 'N':			if (string_size == 0)			  string_size = strlen (delay_before_redial);  		case 'O':			if (string_size == 0)			  string_size = strlen (number_of_tries);	    	case 'P':			if (string_size == 0)			  string_size = strlen (dtr_drop_time);			    			ypos++;			maxl = 4;  		case 'K':			if (string_size == 0)			  string_size = strlen (hangup_string);  		case 'L':			if (string_size == 0)			  string_size = strlen (dial_cancel_string);  			ypos -= 2;  			c += 3;  		case 'A':			if (string_size == 0)			  string_size = strlen (init_string);  		case 'B':			if (string_size == 0)			  string_size = strlen (reset_string);  		case 'C':			if (string_size == 0)			  string_size = strlen (dialing_prefix_1);  		case 'D':			if (string_size == 0)			  string_size = strlen (dialing_suffix_1);  		case 'E':			if (string_size == 0)			  string_size = strlen (dialing_prefix_2);		case 'F':			if (string_size == 0)			  string_size = strlen (dialing_suffix_2);		case 'G':			if (string_size == 0)			  string_size = strlen (dialing_prefix_3);		case 'H':			if (string_size == 0)			  string_size = strlen (dialing_suffix_3);		case 'I':			if (string_size == 0)			  string_size = strlen (connect_string);  			/* Calculate adress of string tomodify */  			str = P_MINIT + (c - 'A') * sizeof(struct pars);  			pgets(w, string_size + 1, ypos + (c - 'A'), str, maxl, maxl);  			break;  		case 'J':		        string_size = strlen (no_connect_strings);  			/* Walk through all four */  			pgets(w, string_size + 1, 10, P_MNOCON1, 20, 64);  			pgets(w, string_size + 1 + 22, 10, P_MNOCON2, 20, 64);  			pgets(w, string_size + 1 , 11, P_MNOCON3, 20, 64);  			pgets(w, string_size + 1 + 22, 11, P_MNOCON4, 20, 64);  			break;  		case 'Q':  			psets(P_MAUTOBAUD, yesno(P_MAUTOBAUD[0] == 'N'));  			wlocate(w, 35 + strlen (auto_bps_detect), 15);  			wputs(w, _(P_MAUTOBAUD));  			break;  		case 'R':  			psets(P_HASDCD, yesno(P_HASDCD[0] == 'N'));  			wlocate(w, 35 + strlen (modem_has_dcd_line), 16);  			wputs(w, _(P_HASDCD));  			break;		case 'S':			psets(P_SHOWSPD, P_SHOWSPD[0] == 'd' ? "l": "d");			wlocate(w, 35 + strlen (shown_speed), 17);			wputs(w, sspd(P_SHOWSPD));			mode_status();			break;		case 'T': /* Update for multi-node */			psets(P_MULTILINE, yesno(P_MULTILINE[0] == 'N' ));			wlocate(w, 35 + strlen(multi_node), 18);			wputs(w, _(P_MULTILINE));			break;							/* er 18-Apr-99 */		case '\n':  			dirflush = 1;  			wclose(w, 1);  			return;  		default:  			break;	  	}  }}/* * Screen and keyboard menu. */static void doscrkeyb(){  WIN *w, *w1;  int c;  int once = 0;  int clr = 1;  int tmp_c;    /* fmg - need it to color keep in sanity checks */  char buf[16];  int miny = 4,   maxy = 17;  int old_stat = P_STATLINE[0];  char* command_key = _(" A - Command key is         :"),      * backspace_key = _(" B - Backspace key sends    :"),      * status_line = _(" C - Status line is         :"),      * alarm_sound = _(" D - Alarm sound            :"),      * foreground_color_menu = _(" E - Foreground Color (menu):"),      * background_color_menu = _(" F - Background Color (menu):"),      * foreground_color_term = _(" G - Foreground Color (term):"),      * background_color_term = _(" H - Background Color (term):"),      * foreground_color_stat = _(" I - Foreground Color (stat):"),      * background_color_stat = _(" J - Background Color (stat):"),      * history_buffer_size = _(" K - History Buffer Size    :"),      * question = _("Change which setting?  (Esc to exit)");#if _HAVE_MACROS  char* macros_file = _(" L - Macros file            :"),      * macros_enabled = _(" N - Macros enabled         :"),      * character_conversion = _(" O - Character conversion   :");  FILE	*fp;  miny = 3;  maxy = 20;#endif  w = wopen(15, miny, 69, maxy, BDOUBLE, stdattr, mfcolor, mbcolor, 0, 0, 1);  wtitle(w, TMID, _("Screen and keyboard"));  wprintf(w, "\n%s %s\n", command_key, P_ESCAPE);  wprintf(w, "%s %s\n", backspace_key, P_BACKSPACE);  wprintf(w, "%s %s\n", status_line, _(P_STATLINE));  wprintf(w, "%s %s\n", alarm_sound, _(P_SOUND));  /* fmg - colors support */  wprintf(w, "%s %s\n", foreground_color_menu, _(J_col[mfcolor]));  wprintf(w, "%s %s\n", background_color_menu, _(J_col[mbcolor]));  wprintf(w, "%s %s\n", foreground_color_term, _(J_col[tfcolor]));  wprintf(w, "%s %s\n", background_color_term, _(J_col[tbcolor]));  wprintf(w, "%s %s\n", foreground_color_stat, _(J_col[sfcolor]));  wprintf(w, "%s %s\n", background_color_stat, _(J_col[sbcolor]));    /* MARK updated 02/17/95 - Configurable history buffer size */  wprintf(w, "%s %s\n", history_buffer_size, P_HISTSIZE);#if _HAVE_MACROS  /* fmg - macros support */  wprintf(w, "%s %s\n", macros_file, P_MACROS);  wprintf(w, _(" M - Edit Macros\n"));  wprintf(w, "%s %s\n", macros_enabled, _(P_MACENAB));  wprintf(w, "%s %s\n", character_conversion, P_CONVF);#endif  wredraw(w, 1);  while(1) {  	if (clr) {  		wlocate(w, 2, maxy - miny);		wprintf(w, "%s ", question);		wclreol(w);		clr = 0;	} else  		wlocate(w, strlen (question) + 3, maxy - miny);  	if (once) {	/* fmg - allow to force looping */  		c = once;  		once = 0;	} else c = rwxgetch();#if 0 /* This might save us someday */	if (!usecolor && (c >= 'E' && c <= 'J')) {		werror(_("You can't change colors in black and white mode"));		continue;	}#endif  	switch(c) {  		case '\n':                 /* fmg - sanity checks... "we found the enemy and he is us" :-) */                 if (mfcolor == mbcolor)   /* oops... */                 {                    tmp_c=mfcolor;      /* save color (same for both, right?) */                    mfcolor=WHITE;      /* make sure they can see error :-) */                    mbcolor=BLACK;                    werror(_("Menu foreground == background color, change!"));                    mfcolor=tmp_c;      /* restore colors */                    mbcolor=tmp_c;                    break;                 }                 if (tfcolor == tbcolor)   /* oops... */                 {                    tmp_c=mfcolor;      /* save color (same for both, right?) */                    mfcolor=WHITE;      /* make sure they can see error :-) */                    mbcolor=BLACK;                    werror(_("Terminal foreground == background color, change!"));                    mfcolor=tmp_c;      /* restore colors */                    mbcolor=tmp_c;                    break;                 }                 /* fmg - I'll let them change sfcolor=sbcolor because it's just                          another way of turning "off" the status line... */			/* MARK updated 02/17/95, Warn user to restart */			/* minicom if they changed history buffer size */			if (atoi(P_HISTSIZE) != num_hist_lines) {				w1 = wopen(14, 9, 70, 15, BSINGLE, stdattr, mfcolor, mbcolor, 0, 0, 1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -