home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
ZMP-SRC.LZH
/
ZMCONFIG.C
< prev
next >
Wrap
Text File
|
2000-06-30
|
8KB
|
397 lines
/*************************************************************************/
/* */
/* Configuration Overlay for ZMP - Module 1 */
/* */
/*************************************************************************/
#include "zmp.h"
#ifdef AZTEC_C
#include "libc.h"
#else
#include <stdio.h>
#endif
ovmain()
{
int c, cfgchanged, phonechanged;
#ifdef C80
Cmode = 0;
#endif
cfgchanged = phonechanged = FALSE;
start:
cls();
printf("\r\t\t");
stndout();
printf(" CONFIGURATION MENU ");
stndend();
printf("\n\n\tA - Edit long distance access number\n");
#ifdef HOSTON
printf("\tH - Set host mode parameters\n");
#endif
printf("\tK - Edit keyboard macros\n");
printf("\tL - Set line parameters\n");
printf("\tM - Set modem parameters\n");
printf("\tP - Edit phone number list\n");
printf("\tS - Set system parameters\n");
printf("\tT - Set file transfer parameters\n");
printf("\tZ - Exit\n");
printf("\n Select: ");
flush();
c = toupper(bdos(CONIN));
switch (c) {
case 'A':
ldedit();
cfgchanged = TRUE;
break;
#ifdef HOSTON
case 'H':
sethost();
cfgchanged = TRUE;
break;
#endif
case 'K':
edit();
cfgchanged = TRUE;
break;
case 'L':
setline();
cfgchanged = TRUE;
break;
case 'M':
setmodem();
cfgchanged = TRUE;
break;
case 'P':
phonedit();
phonechanged = TRUE;
break;
case 'S':
setsys();
cfgchanged = TRUE;
break;
case 'T':
settransfer();
cfgchanged = TRUE;
break;
case ESC:
case 'Z':
if (cfgchanged || phonechanged) {
printf("\nMake changes permanent? ");
if (c = toupper(bdos(CONIN)) == 'Y') {
if (cfgchanged)
saveconfig();
if (phonechanged)
savephone();
kbwait(2);
}
}
cls();
return; /* Return from overlay */
break;
default:
break;
} /* end of switch */
goto start;
}
settransfer()
{
int c;
start:
cls();
printf("\r\t\t\t");
stndout();
printf(" FILE TRANSFER PARAMETERS ");
stndend();
printf("\n\n\tC - Set Checksum/CRC default - %s\n",
Crcflag?"CRC":"Checksum");
printf("\tD - Set delay after each character in ASCII send - %d mS\n",
Chardelay);
printf("\tF - Toggle 32-bit FCS capability - %s\n",
Wantfcs32?"Enabled":"Disabled");
printf("\tL - Set delay after each line in ASCII send - %d mS\n",
Linedelay);
printf("\tW - Change Zmodem receive window size - %d\n",Zrwindow);
printf("\tX - Toggle X-on/X-off protocol - %s\n",
XonXoff?"Enabled":"Disabled");
printf("\tZ - Exit\n\n");
printf(" Select: ");
c = toupper(bdos(CONIN));
putchar('\n');
switch (c) {
case 'C':
Crcflag = !Crcflag;
break;
case 'D':
gnewint("character delay",&Chardelay);
break;
case 'F':
Wantfcs32 = !Wantfcs32;
break;
case 'L':
gnewint("line delay",&Linedelay);
break;
case 'W':
gnewint("window size",&Zrwindow);
break;
case 'X':
XonXoff = !XonXoff;
break;
case ESC:
case 'Z':
return;
break;
default:
break;
}
goto start;
}
setsys()
{
int c;
char d;
start:
cls();
printf("\r\t\t\t");
stndout();
printf(" SYSTEM PARAMETERS ");
stndend();
printf("\n\n\tB - Set print buffer size - %d bytes\n",Pbufsiz);
printf("\tF - Toggle T-mode control character filter - now %s\n",
Filter ? "ON" : "OFF");
printf("\tM - Set maximum drive on system - now %c:\n",Maxdrive);
printf("\tP - Toggle T-mode parity bit removal - now %s\n",
ParityMask ? "ON" : "OFF");
printf("\tZ - Exit\n\n");
printf(" Select: ");
c = toupper(bdos(CONIN));
switch (c) {
case 'B':
gnewint("print buffer size",&Pbufsiz);
Pbufsiz = Pbufsiz < 1 ? 512 : Pbufsiz;
break;
case 'F':
Filter = !Filter;
break;
case 'M':
printf("\n\nEnter new maximum drive: ");
d = toupper(bdos(CONIN));
Maxdrive = ((d >= 'A') && (d <= 'P')) ? d : 'B';
break;
case 'P':
ParityMask = !ParityMask;
break;
case ESC:
case 'Z':
return;
break;
default:
break;
}
goto start;
}
char *Mdmstrings[] = {
"Modem init string.....",
"Dialling command......",
"Dial command suffix...",
"Connect string........",
"No Connect string 1...",
"No Connect string 2...",
"No Connect string 3...",
"No Connect string 4...",
"Hangup string.........",
"Redial timeout delay..",
"Redial pause delay...."
};
setmodem()
{
int c;
start:
cls();
printf("\r\t\t\t");
stndout();
printf(" MODEM PARAMETERS ");
stndend();
printf("\n\n\tA - %s%s\n",Mdmstring[0],Modem.init);
printf("\tB - %s%s\n",Mdmstring[1],Modem.dialcmd);
printf("\tC - %s%s\n",Mdmstring[2],Modem.dialsuffix);
printf("\tD - %s%s\n",Mdmstring[3],Modem.connect);
printf("\tE - %s%s\n",Mdmstring[4],Modem.busy1);
printf("\tF - %s%s\n",Mdmstring[5],Modem.busy2);
printf("\tG - %s%s\n",Mdmstring[6],Modem.busy3);
printf("\tH - %s%s\n",Mdmstring[7],Modem.busy4);
printf("\tI - %s%s\n",Mdmstring[8],Modem.hangup);
printf("\tJ - %s%d\n",Mdmstring[9],Modem.timeout);
printf("\tK - %s%d\n",Mdmstring[10],Modem.pause);
printf("\tZ - Exit\n\n");
printf(" Select: ");
c = toupper(bdos(CONIN));
putchar('\n');
switch (c) {
case 'A':
gnewstr(Mdmstring[0],Modem.init,40);
break;
case 'B':
gnewstr(Mdmstring[1],Modem.dialcmd,20);
break;
case 'C':
gnewstr(Mdmstring[2],Modem.dialsuffix,20);
break;
case 'D':
gnewstr(Mdmstring[3],Modem.connect,20);
break;
case 'E':
gnewstr(Mdmstring[4],Modem.busy1,20);
break;
case 'F':
gnewstr(Mdmstring[5],Modem.busy2,20);
break;
case 'G':
gnewstr(Mdmstring[6],Modem.busy3,20);
break;
case 'H':
gnewstr(Mdmstring[7],Modem.busy4,20);
break;
case 'I':
gnewstr(Mdmstring[8],Modem.hangup,20);
break;
case 'J':
gnewint(Mdmstring[9],&Modem.timeout);
break;
case 'K':
gnewint(Mdmstring[10],&Modem.pause);
break;
case ESC:
case 'Z':
return;
break;
default:
break;
}
goto start;
}
gnewint(prompt,intp)
char *prompt;
int *intp;
{
static char *temp;
temp = Pathname;
printf("\n\nEnter new %s: ",prompt);
if (getline(temp,20))
*intp = atoi(temp);
}
gnewstr(prompt,mstring,length)
char *prompt, *mstring;
short length;
{
char *temp;
temp = Pathname;
printf("\n\nEnter new %s: ",prompt);
if (getline(temp,length))
strcpy(mstring,temp);
}
setline()
{
int c;
start:
cls();
printf("\r\t\t\t");
stndout();
printf(" LINE PARAMETERS ");
stndend();
printf("\n\n\tB - Bits per second.......%u\n",
Baudtable[Line.baudindex]);
printf("\tD - Number data bits......%d\n",Line.databits);
printf("\tP - Parity................%c\n",Line.parity);
printf("\tS - Number stop bits......%d\n",Line.stopbits);
printf("\tZ - Exit\n\n");
printf(" Select: ");
c = toupper(bdos(CONIN));
cls();
switch (c) {
case 'B':
setbaud();
break;
case 'D':
setdatabits();
break;
case 'P':
setparity();
break;
case 'S':
setstopbits();
break;
case ESC:
case 'Z':
return;
break;
default:
break;
}
goto start;
}
/********************** END OF ZMCONFIG MODULE 1 ****************************/