home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume32
/
xbbs
/
part04
/
bbsc1.c.A
next >
Wrap
Text File
|
1992-09-08
|
40KB
|
1,870 lines
/*
* bbsc.c
*
* BBS (Bulletin Board System) written in xenix system V "C".
*
* Support files needed: bbscdef.h bbscport.o or bbscport.c bbsclock.o or
* bbsclock.c bbscfile.o or bbscfile.c bbscmisc.o or bbscmisc.c bbscio.o or
* bbscio.c bbscarea.o or bbscarea.c bbscmsga.o or bbscmsga.c bbscqust.o or
* bbscqust.c bbscbult.o or bbscbult.c bbscadds.o or bbscadds.c bbsclist.o or
* bbsclist.c bbsczip.o or bbsczip.c bbscconf.c or bbscconf.o bbscsumm.c or
* .o
*
*
* Sanford J. Zelkovitz
*
*/
#include "bbsc12.h"
char *basename();
long difft();
main()
{
int i, fd;
char ptype[2];
char pval[18];
/*
* init global variables
*/
Zsec = Ztime = sigreturn = 0;
if ((inbuf = fopen(CONFIG, "r")) == NULL) {
portsout("\n\rError opening configuration file!\n\r");
exit(1);
}
if ((fgets(WELCOME, 49, inbuf) == NULL))
error_config();
strip(WELCOME);
if ((fgets(BULLETINS, 49, inbuf) == NULL))
error_config();
strip(BULLETINS);
if ((fgets(NEWUSER, 49, inbuf) == NULL))
error_config();
strip(NEWUSER);
if ((fgets(SYSTEM, 49, inbuf) == NULL))
error_config();
strip(SYSTEM);
if ((fgets(CALLERS, 49, inbuf) == NULL))
error_config();
strip(CALLERS);
if ((fgets(LASTCALL, 49, inbuf) == NULL))
error_config();
strip(LASTCALL);
if ((fgets(USERS, 49, inbuf) == NULL))
error_config();
strip(USERS);
if ((fgets(UNIXMSG, 49, inbuf) == NULL))
error_config();
strip(UNIXMSG);
if ((fgets(DLMSG, 49, inbuf) == NULL))
error_config();
strip(DLMSG);
if ((fgets(HUMOR, 49, inbuf) == NULL))
error_config();
strip(HUMOR);
if ((fgets(HELP, 49, inbuf) == NULL))
error_config();
strip(HELP);
if ((fgets(HELPFILE, 49, inbuf) == NULL))
error_config();
strip(HELPFILE);
if ((fgets(HELPMSG, 49, inbuf) == NULL))
error_config();
strip(HELPMSG);
if ((fgets(USERPRIV, 49, inbuf) == NULL))
error_config();
strip(USERPRIV);
if ((fgets(MAINPRIV, 49, inbuf) == NULL))
error_config();
strip(MAINPRIV);
if ((fgets(FILEPRIV, 49, inbuf) == NULL))
error_config();
strip(FILEPRIV);
if ((fgets(QUESTION, 49, inbuf) == NULL))
error_config();
strip(QUESTION);
if ((fgets(ANSWER, 49, inbuf) == NULL))
error_config();
strip(ANSWER);
if ((fgets(ADDITN, 49, inbuf) == NULL))
error_config();
strip(ADDITN);
if ((fgets(LISTFILES, 49, inbuf) == NULL))
error_config();
strip(LISTFILES);
if ((fgets(TODAY, 98, inbuf) == NULL))
error_config();
strip(TODAY);
if ((fgets(ORGPATH, 49, inbuf) == NULL))
error_config();
strip(ORGPATH);
if ((fgets(AREAS, 49, inbuf) == NULL))
error_config();
strip(AREAS);
strcpy(SIGS, ORGPATH);
strcat(SIGS, "sigs.bbs");
if ((fgets(MSGS, 49, inbuf) == NULL))
error_config();
strip(MSGS);
if ((fgets(USRBBS, 49, inbuf) == NULL))
error_config();
strip(USRBBS);
if ((fgets(RB, 49, inbuf) == NULL))
error_config();
strip(RB);
if ((fgets(SB, 49, inbuf) == NULL))
error_config();
strip(SB);
if ((fgets(CRCR, 49, inbuf) == NULL))
error_config();
strip(CRCR);
if ((fgets(CRCS, 49, inbuf) == NULL))
error_config();
strip(CRCS);
if ((fgets(YMDR, 49, inbuf) == NULL))
error_config();
strip(YMDR);
if ((fgets(YMDS, 49, inbuf) == NULL))
error_config();
strip(YMDS);
if ((fgets(YMR, 49, inbuf) == NULL))
error_config();
strip(YMR);
if ((fgets(YMS, 49, inbuf) == NULL))
error_config();
strip(YMS);
if ((fgets(RZ, 49, inbuf) == NULL))
error_config();
strip(RZ);
if ((fgets(SZ, 49, inbuf) == NULL))
error_config();
strip(SZ);
if ((fgets(KS, 49, inbuf) == NULL))
error_config();
strip(KS);
if ((fgets(KRA, 49, inbuf) == NULL))
error_config();
strip(KRA);
if ((fgets(KRE, 49, inbuf) == NULL))
error_config();
strip(KRE);
if ((fgets(SEAR, 49, inbuf) == NULL))
error_config();
strip(SEAR);
if ((fgets(SEAS, 49, inbuf) == NULL))
error_config();
strip(SEAS);
if ((fgets(SYSOP, 49, inbuf) == NULL))
error_config();
strip(SYSOP);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
LOGTIME = atoi(buf128);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
RUNTIME = atoi(buf128);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
WAITTIME = atoi(buf128);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
NEWPRIV = atoi(buf128);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
MAXPRIV = atoi(buf128);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
MAXSEC = atoi(buf128);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
MAXKBYTE = atoi(buf128);
if ((fgets(TAR, 49, inbuf) == NULL))
error_config();
strip(TAR);
if ((fgets(ZCAT, 49, inbuf) == NULL))
error_config();
strip(ZCAT);
/*
Starting with version 7.102, the following fgets can just get garbage
since the arc file lister is now a built-in ( bbscarc.c )
*/
if ((fgets(ARC, 49, inbuf) == NULL))
error_config();
strip(ARC);
/*
Starting with version 7.102, the following fgets can just get garbage
since the zip file lister is now a built-in ( bbscunzip.c )
*/
if ((fgets(ZIP, 49, inbuf) == NULL))
error_config();
strip(ZIP);
if ((fgets(MONITOR, 29, inbuf) == NULL))
error_config();
strip(MONITOR);
if ((fgets(CONSOLE, 29, inbuf) == NULL))
error_config();
strip(CONSOLE);
if ((fgets(SHELL, 29, inbuf) == NULL))
error_config();
strip(SHELL);
if ((fgets(buf128, 49, inbuf) == NULL))
error_config();
strip(buf128);
scan = atoi(buf128);
if ((fgets(READN, 98, inbuf) == NULL))
error_config();
strip(READN);
if ((fgets(POSTN, 98, inbuf) == NULL))
error_config();
strip(POSTN);
fclose(inbuf);
strcpy(l_m_base, "0");
strcpy(l_f_base, "0");
strcpy(xprt_a, "0");
strcpy(tggl_a, "1");
maxkbyte = MAXKBYTE;
logtime = LOGTIME;
Ytime = logtime;
runtime = RUNTIME;
waittime = WAITTIME;
newpriv = NEWPRIV;
max_priv = MAXPRIV;
strcpy(callers, CALLERS);
this_ttyname = ttyname(0);
strcpy(buf128, this_ttyname);
i = strlen(buf128);
i--;
substr(buf128, pval, i, 2);
strcat(callers, pval);
strcpy(port_id, pval);
strcpy(buf128, "/tmp/conf");
strcat(buf128, pval);
(void) unlink(buf128);
strcpy( buf128, ORGPATH );
strcat( buf128, "inval_port.bbs");
inbuf = fopen(buf128, "r" );
if( inbuf != NULL ) {
while (1) {
if( fscanf(inbuf, "%s", buf128) == EOF )
break;
if(strcmp(basename(buf128),basename(this_ttyname))==0){
fclose(inbuf);
portinit();
setmodes();
portsout("\n\r\n\rYou called in on a restricted line!\n\r\n\r");
restoremodes();
portrst();
strcpy(buf128, ORGPATH);
strcat(buf128, "restricted.bbs");
if((inbuf=fopen(buf128,"a")) != NULL) {
gettime(ttime);
GeTdAtE(mm, dd, yy, month, day, year, date, week);
fd = atoi(mm);
fd++;
sprintf(mm, "%.2d", fd);
(void)fprintf(inbuf, "%s/%s/%s %s restricted line caller on %s\n", mm,dd,yy,ttime,this_ttyname);
fclose(inbuf);
}
exit(1);
}
}
fclose(inbuf);
}
hold_pipe = FALSE;
debug = FALSE;
hold_off = FALSE;
toggle_hold = FALSE;
first_time_in = TRUE;
first_msg_in = TRUE;
chat_in_progress = FALSE;
stop_chat = FALSE;
newuzr = FALSE;
statcnt = 0;
last_msg_read = 0;
xpert = FALSE;
listed_l = FALSE;
listed_r = FALSE;
listed_n = FALSE;
toggle = TRUE;
active = TRUE;
reply_sw = FALSE;
end_msg = FALSE;
read_flag = FALSE;
sys_flag = FALSE;
strcpy(old_upath, AUTHOR);
new_msg = 0;
c_pathname[0] = '\0';
if_monitor = FALSE;
no_cntrl_k = FALSE;
resp_flag = FALSE;
in_the_buffer = 0;
user_priv = 1;
read_number = 1;
extra_time = 0L;
extra_size = 0L;
dload_total = 0L;
max_dload = 0L;
blocked_m = 0;
mpA = 1;
mpB = 1;
mpE = 1;
mpG = 1;
mpK = 1;
mpP = 1;
mpN = 1;
mpQ = 1;
mpR = 1;
mpS = 1;
mpW = 1;
mpM = 1;
mpX = 1;
mpF = 1;
mpC = 1;
mpH = 1;
mpT = 1;
mpD = 1;
mpY = 1;
mpUSENET = 1; /* added for 7.2.1 */
mpRF = 1;
mpQUEST = 1;
mpU = 32767;
mpMS = 1;
mpCHAT = 1;
mpCONF = 1;
mpL = 1;
fpL = 1;
fpU = 1;
fpD = 1;
fpM = 1;
fpG = 1;
fpR = 1;
strcpy(buf128, STDERR);
strcat(buf128, port_id);
STDerr = freopen(buf128, "w+", stderr);
if (IF_MONITOR) {
mon_handle = open(MONITOR, O_WRONLY);
if (mon_handle == -1) {
portsout("\n\rCritical Error --- End BBS\n\r");
exit(1);
}
if_monitor = FALSE;
i = getpid();
itoa(buf128, i);
strcpy(who_am_i, "/tmp/pid");
strcat(who_am_i, pval);
inbuf = fopen(who_am_i, "w");
fprintf(inbuf, "%s", buf128);
fclose(inbuf);
}
if ((inbuf = fopen(MAINPRIV, "r")) == NULL) {
portsout("\n\rCritical Error!\n\r");
portsout("Unable to find main privs!\n\r");
exit(1);
}
while (fscanf(inbuf, "%s%s", ptype, pval) != EOF) {
ptype[1] = '\0';
*ptype = toupper(*ptype);
switch (ptype[0]) {
case ('B'):
mpB = atoi(pval);
break;
case ('E'):
mpE = atoi(pval);
break;
case ('G'):
mpG = atoi(pval);
break;
case ('K'):
mpK = atoi(pval);
break;
case ('N'):
mpN = atoi(pval);
break;
case ('Q'):
mpQ = atoi(pval);
break;
case ('R'):
mpR = atoi(pval);
break;
case ('S'):
mpS = atoi(pval);
break;
case ('W'):
mpW = atoi(pval);
break;
case ('M'):
mpM = atoi(pval);
break;
case ('X'):
mpX = atoi(pval);
break;
case ('F'):
mpF = atoi(pval);
break;
case ('C'):
mpC = atoi(pval);
break;
case ('H'):
mpH = atoi(pval);
break;
case ('T'):
mpT = atoi(pval);
break;
case ('D'):
mpD = atoi(pval);
break;
case ('Y'):
mpY = atoi(pval);
break;
case ('U'):
mpU = atoi(pval);
break;
case ('P'):
mpP = atoi(pval);
break;
case ('A'):
mpA = atoi(pval);
break;
case ('L'):
mpL = atoi(pval);
break;
case ('&'):
mpMS = atoi(pval);
break;
case ('?'):
mpZ = atoi(pval);
break;
case ('~'):
mpCHAT = atoi(pval);
break;
case ('%'):
mpQUEST = atoi(pval);
break;
case ('$'):
mpRF = atoi(pval);
break;
case ('O'):
mpCONF = atoi(pval);
break;
case ('I'): /* added for 7.2.1 */
mpUSENET = atoi(pval);
break;
default:
portsout("\n\rBad entry in MAIN PRIV\n\r");
break;
}
}
fclose(inbuf);
if ((inbuf = fopen(FILEPRIV, "r")) == NULL) {
portsout("\n\rCritical Error!\n\r");
portsout("Unable to find file privs!\n\r");
exit(1);
}
while (fscanf(inbuf, "%s%s", ptype, pval) != EOF) {
ptype[1] = '\0';
*ptype = toupper(*ptype);
switch (ptype[0]) {
case ('L'):
fpL = atoi(pval);
break;
case ('U'):
fpU = atoi(pval);
break;
case ('D'):
fpD = atoi(pval);
break;
case ('M'):
fpM = atoi(pval);
break;
case ('G'):
fpG = atoi(pval);
break;
case ('R'):
fpR = atoi(pval);
break;
default:
portsout("\n\rBad entry in FILE PRIV\n\r");
break;
}
}
fclose(inbuf);
w_fname[0] = '\0';
w_lname[0] = '\0';
strcpy(w_password, "MPK0");
u_fname[0] = '\0';
u_lname[0] = '\0';
strcpy(u_password, "MPK0");
u_time1[0] = '\0';
u_date1[0] = '\0';
u_time2[0] = '\0';
u_date2[0] = '\0';
u_city[0] = '\0';
mm[0] = '\0';
dd[0] = '\0';
yy[0] = '\0';
month[0] = '\0';
day[0] = '\0';
year[0] = '\0';
date[0] = '\0';
week[0] = '\0';
ttime[0] = '\0';
strcpy(msg_delete, "0");
msg_no[0] = '\0';
msg_date[0] = '\0';
msg_date[0] = '\0';
msg_time[0] = '\0';
msg_to[0] = '\0';
msg_from[0] = '\0';
msg_pass[0] = '\0';
msg_subject[0] = '\0';
msg_text[0] = '\0';
strfill(msg_text, 0, 1482);
stop_that = FALSE;
/* get date and time from the clock */
gettime(ttime);
GeTdAtE(mm, dd, yy, month, day, year, date, week);
substr(month, mnd, 1, 3);
strcat(mnd, day);
fd = atoi(mm);
fd++;
sprintf(mm, "%.2d", fd);
sec = logtime;
which_timer = 1;
alarm(sec);
if (signal(SIGALRM, timer) == (int (*) ()) -1)
exit(1);
if (signal(SIGUSR1, mon_toggle) == (int (*) ()) -1)
exit(1);
if (signal(SIGUSR2, sys_toggle) == (int (*) ()) -1)
exit(1);
if (signal(SIGPIPE, chat) == (int (*) ()) -1)
exit(1);
if (signal(SIGINT, STOP) == (int (*) ()) -1)
exit(1);
if (signal(SIGHUP, hanged) == (int (*) ()) -1)
exit(1);
portinit(); /* init terminal modes */
setmodes();
signon();
driver();
restoremodes();
portrst(); /* undo any special modes */
closer(1);
}
/* end of mainline routine */
driver()
{
char linebuf[MAXLINE], buf[128], *bufptr, /* ptr to buf */
usercd[100], /* user record */
*userptr,/* ptr to usercd */
cmd[2];
int cnt, ok_sw, case_sw, i, mpk, result, num0, num1, num2;
long vtime;
mpk = mpK;
cnt = 0;
ok_sw = TRUE;
bufptr = buf;
cmd[0] = '\0';
if (active) {
sec = runtime;
vtime = sec;
vtime += extra_time;
if (vtime > 32767L)
vtime = 32767L;
if (vtime < 60L)
vtime = 60L;
sec = vtime;
Ytime = sec;
max_dload = ((long) (maxkbyte)) * 1024L;
max_dload += extra_size;
alarm(sec);
which_timer = 2;
change_bult();
today_msg();
if (scan) {
if (!newuzr) {
portsout("\n\rLast time you were on the system: ");
portsout(z_date);
portsout(" at ");
portsout(z_time);
portsout("\n\r\n\r");
portsout("\n\rDo you wish to check to see if you have any messages? (Y/n): ");
portsin(cmd, 1);
portsout(CRLF);
if (cmd[0] == 'N' || cmd[0] == 'n')
check_msga_n();
else
check_msga();
cmd[0] = '\0';
} else {
portsout(CRLF);
portsout("Since you are a new user, the scan for messages will not be performed.\n\r");
portsout("The next time that you call, all message bases will be scanned.\n\r\n\r");
check_msga_n();
portsout("Since you are a new user, you will be asked to fill out our questionnaire.\n\r");
portsout("Please take the time and fill it out. Thank you.\n\r");
question(1);
}
} else
check_msga_n();
}
while (active) {
stop_that = FALSE; /* reset switch */
portsout(CRLF);
signal(SIGALRM, timer);
signal(SIGUSR1, mon_toggle);
signal(SIGUSR2, sys_toggle);
signal(SIGPIPE, chat);
signal(SIGINT, STOP);
signal(SIGHUP, hanged);
cmd_t();
sigreturn = 0;
bbsmenu(1,0);
portsin(cmd, 1);
portsout(CRLF);
*cmd = toupper(*cmd);
switch (cmd[0]) {
case ('V'):
portsout("\n\r\n\rVersion: ");
portsout(VERSION);
portsout(" ");
portsout(LASTDATE);
portsout("\n\r\n\r");
break;
case ('U'):
if (!privmsg(mpU))
break;
cmd_p(UNIXMSG);
if ((inbuf = fopen(callers, "a")) == NULL) { /* create or open for
* append */
portsout(CRLF);
portsout("Can't open/create callers file!");
portsout(CRLF);
return;
}
result = fprintf(inbuf, "%s", " Going into Xenix/Unix");
if (result < 0) {
portsout(CRLF);
portsout("Caller file has problem writing");
portsout(CRLF);
} else {
fputs("\n", inbuf);
}
fclose(inbuf);
restoremodes();
portrst();
STDerr = freopen("/dev/tty", "w+", stderr);
result = system(SHELL);
strcpy(buf128, STDERR);
strcat(buf128, port_id);
STDerr = freopen(buf128, "w+", stderr);
signal(SIGALRM, timer);
signal(SIGHUP, hanged);
signal(SIGUSR1, mon_toggle);
signal(SIGUSR2, sys_toggle);
signal(SIGPIPE, chat);
signal(SIGINT, STOP);
portinit();
setmodes();
break;
case ('G'): /* goodby */
if (!privmsg(mpG))
break;
cmd_c();
break;
case ('L'):
if (!privmsg(mpL))
break;
who_is_there();
break;
case ('Z'):
if (!privmsg(mpY))
break;
cmd_z();
break;
case ('R'):
if (!privmsg(mpRF))
break;
file_list();
break;
case ('C'):
if (!privmsg(mpCHAT))
break;
sigchat();
break;
case ('O'):
if (!privmsg(mpCONF))
break;
conf();
break;
case ('E'):
if (!privmsg(mpCONF))
break;
portsout("\n\r\n\rThe following users are presently in conference\n\r");
no_cntrl_k = 1;
strcpy(buf128, "ls /tmp/conf* > /tmp/inconf.");
strcat(buf128, port_id);
(void) system(buf128);
strcpy(buf128, "/tmp/inconf.");
strcat(buf128, port_id);
if ((otbuf = fopen(buf128, "r")) == NULL) {
portsout("\n\rError opening list file!\n\r");
exit(1);
}
while (fscanf(otbuf, "%s", who_am_i) != EOF)
cmd_p(who_am_i);
fclose(otbuf);
no_cntrl_k = 0;
break;
case ('I'): /* No need to check privs since
each command has access privs */
sig_access();
break;
case ('Q'):
if (!privmsg(mpQUEST))
break;
question(0);
break;
case ('A'):
if (!privmsg(mpA))
break;
additional(ADDITN);
break;
case ('D'):
if (!privmsg(mpD))
break;
strcpy(buf128, TODAY);
strcat(buf128, port_id);
result = system(buf128);
strcpy(buf128, "/tmp/today");
strcat(buf128, port_id);
cmd_p(buf128);
break;
case ('P'):
if (!privmsg(mpP))
break;
ch_password();
break;
case ('X'): /* expert toggle */
if (!privmsg(mpX))
break;
cmd_x();
rewritx();
break;
case ('N'): /* print new-user stuff */
if (!privmsg(mpN))
break;
cmd_p(NEWUSER);
break;
case ('W'): /* print welcome file */
if (!privmsg(mpW))
break;
cmd_p(WELCOME);
break;
case ('B'): /* print bulletins */
if (!privmsg(mpB))
break;
change_bult();
break;
case ('H'): /* print humor file */
if (!privmsg(mpH))
break;
cmd_p(HUMOR);
break;
case ('F'):
if (!privmsg(mpF))
break;
cmd_f();
break;
case ('M'):
if (!privmsg(mpMS))
break;
msg_section(mpk);
break;
case ('T'):
if (!privmsg(mpT))
break;
toggle = !toggle;
rewritx();
if (toggle) {
portsout("\n\rStop Mode\n\r");
} else {
portsout("\n\rContinuous Mode\n\r");
}
break;
case ('?'): /* help */
if (!privmsg(mpZ))
break;
cmd_p(HELP);
break;
case ('S'): /* added for 7.2.1 USENET ACCESS */
if (!privmsg(mpUSENET))
break;
usenet();
break;
default:
break;
}
}
}
/* end of function */
sigchat()
{
char *ttyzz;
char tb[80];
int result, handle;
static char bell = '\007';
if ((inbuf = fopen(callers, "a")) == NULL) { /* create or open for
* append */
portsout(CRLF);
portsout("Can't open/create callers file!");
portsout(CRLF);
return;
}
result = fprintf(inbuf, "%s", " Requesting a chat");
if (result < 0) {
portsout(CRLF);
portsout("Caller file has problem writing");
portsout(CRLF);
} else {
fputs("\n", inbuf);
}
fclose(inbuf);
result = stat(SYSTTY, &statbuf);
if (!result) {
strcpy(buf128, "\n\r\n\r");
strcat(buf128, SYSOP);
strcat(buf128, " is already engaged in a chat or has turned it off.\n\r\n\r");
portsout(buf128);
return;
}
handle = open(CONSOLE, O_WRONLY);
if (handle == -1) {
portsout("\n\rError opening console driver!\n\r");
exit(1);
}
ttyzz = ttyname(1);
strcpy(tb, "\n\rChat requested by ");
strcat(tb, w_fname);
strcat(tb, " ");
strcat(tb, w_lname);
strcat(tb, " on ");
strcat(tb, ttyzz);
strcat(tb, "\n\r");
write(handle, tb, (strlen(tb)));
Xsec = 0;
stop_chat = FALSE;
portsout("\n\rPaging: ");
for (result = 0; result <= 30; result++) {
sigloop:
if (stop_chat) {
portsout(CRLF);
close(handle);
return;
}
Sec = alarm(0);
hold_pipe = TRUE;
alarm(Sec);
hold_pipe = FALSE;
if (Sec != Xsec) {
if (stop_chat) {
portsout(CRLF);
close(handle);
return;
}
Xsec = Sec;
portsout(". ");
write(handle, &bell, 1);
} else
goto sigloop;
}
strcpy(buf128, "\n\rI am sorry; however, ");
strcat(buf128, SYSOP);
strcat(buf128, " is unavailable to chat with you.\n\r");
portsout(buf128);
close(handle);
}
ch_password()
{
int result, char_in_passwd;
char *pptr;
while (1) {
in_passx:
portsout(CRLF);
portsout("Ok, now I need a 4 to 10 character password ===> ");
portsinz(u_password, 10);
portsout(CRLF);
char_in_passwd = strlen(u_password);
if (char_in_passwd < 4) {
portsout("\n\rPassword was NOT changed!\n\r");
return;
}
pptr = strchr(u_password, '~');
if (pptr != NULL) {
portsout("\n\rInvalid password try again!\n\r");
goto in_passx;
}
pptr = strchr(u_password, ' ');
if (pptr != NULL) {
portsout("\n\rInvalid password try again!\n\r");
goto in_passx;
}
portsout("Just to make sure, enter it again ===> ");
portsinz(w_password, 10);
result = strlen(w_password);
if (result != char_in_passwd)
goto passwx_loop;
portsout(CRLF);
if (strcmp(u_password, w_password) == 0) {
result = 10 - result;
while (result) {
strcat(u_password, " ");
result--;
}
break; /* get it right twice, then get out */
}
passwx_loop:
portsout(CRLF);
portsout("hmmmm, one of us forgot it already");
portsout(CRLF);
portsout(" let's try it again!!");
portsout(CRLF);
portsout(CRLF);
}
if ((inbuf = fopen(USERS, "r+")) == NULL) {
portsout("\n\rError opening users file!\n\r");
exit(1);
}
fds = fileno(inbuf);
rewind(inbuf);
locking(fds, LK_LOCK, 0L);
result = fseek(inbuf, save_d_pos, 0);
rewrtuser(inbuf);
rewind(inbuf);
locking(fds, LK_UNLCK, 0L);
fclose(inbuf);
}
msg_section(mpk)
int mpk;
{
char cmd[81];
char tmp_cmd[80];
char *cmd_ptr, *tmp_cmd_ptr;
int result, tmp_number;
char *file_ptr_x;
if (first_msg_in) {
result = atoi(l_m_base);
change_msga(result);
check_mail();
}
first_msg_in = FALSE;
msg_looper:
signal(SIGALRM, timer);
signal(SIGHUP, hanged);
signal(SIGUSR1, mon_toggle);
signal(SIGUSR2, sys_toggle);
signal(SIGPIPE, chat);
signal(SIGINT, STOP);
stop_that = FALSE;
cmd_t();
portsout("\n\rCurrent message area = ");
strcpy(buf128, m_pathname);
file_ptr_x = strrchr(buf128, '/');
*file_ptr_x = '\0';
file_ptr_x = strrchr(buf128, '/');
*file_ptr_x++;
strcpy(who_am_i, file_ptr_x);
portsout(who_am_i);
portsout(CRLF);
portsout(CRLF);
bbsmenu(2,mpk);
portsin_cmp(cmd, 80, "KkQqSsRrYyCcEeNnMmGgXxTt?");
portsout(CRLF);
if(cmd[0] != 'B' && cmd[0] != 'b')
fix_name(cmd);
switch (cmd[0]) {
case ('E'): /* enter msg */
if (!privmsg(mpE))
goto msg_looper;
cmd_e();
goto msg_looper;
case ('N'): /*Enter BLOCKED message */
if(!privmsg(mpE))
goto msg_looper;
blocked_m = 1;
cmd_e();
blocked_m = 0;
goto msg_looper;
case ('G'): /* goodby */
if (!privmsg(mpG))
goto msg_looper;
cmd_c();
break;
case ('T'):
if (!privmsg(mpT))
goto msg_looper;
toggle = !toggle;
rewritx();
if (toggle) {
portsout("\n\rStop Mode\n\r");
} else {
portsout("\n\rContinuous Mode\n\r");
}
goto msg_looper;
case ('X'):
if (!privmsg(mpX))
goto msg_looper;
cmd_x();
rewritx();
goto msg_looper;
case ('K'):
if (!privmsg(mpk))
goto msg_looper;
cmd_k();
goto msg_looper;
case ('Q'): /* quick scan */
if (!privmsg(mpQ))
goto msg_looper;
cmd_q();
goto msg_looper;
case ('R'): /* read msg */
if (!privmsg(mpR))
goto msg_looper;
cmd_r();
goto msg_looper;
case ('B'):
case ('b'):
if(!privmsg(mpR))
goto msg_looper;
cmd_ptr = cmd;
cmd_ptr++;
tmp_number=strlen(cmd_ptr);
if(!tmp_number)
{
portsout("\n\r\n\rNo messages selected in batch command!\n\r\n\r");
goto msg_looper;
}
digit(cmd_ptr);
while(*cmd_ptr)
{
tmp_cmd_ptr = tmp_cmd;
if(*cmd_ptr == (char) ' ')
{
cmd_ptr++;
continue;
}
while(*cmd_ptr != (char) ' ')
{
if(*cmd_ptr == (char) '\0')
break;
*tmp_cmd_ptr++ = *cmd_ptr++;
}
*tmp_cmd_ptr = (char)'\0';
read_number = atoi(tmp_cmd);
read_flag = TRUE;
cmd_r();
read_flag = FALSE;
portsout(CRLF);
portsout("*** Depress a key to continue ( control-k to quit ) ........ ");
jnk[0] = portin();
if (jnk[0] == CTL_K || stop_that)
{
stop_that = FALSE;
goto msg_looper;
}
}
goto msg_looper;
case ('Y'):
if (!privmsg(mpY))
goto msg_looper;
cmd_y();
goto msg_looper;
case ('S'): /* scan msg */
if (!privmsg(mpS))
goto msg_looper;
cmd_s();
goto msg_looper;
case ('C'):
if (!privmsg(mpC))
goto msg_looper;
check_mail();
goto msg_looper;
case ('M'):
break;
case ('?'): /* help */
if (!privmsg(mpZ))
goto msg_looper;
cmd_p(HELPMSG);
goto msg_looper;
case ('A'):
result = strlen(cmd);
result--;
if (!result)
change_msga(0);
else {
substr(cmd, buf128, 2, result);
digit(buf128);
result = atoi(buf128);
change_msga(result);
}
check_mail();
goto msg_looper;
default:
goto msg_looper;
}
}
privmsg(priv)
int priv;
{
if (user_priv >= priv)
return (TRUE);
portsout("\n\rI'm sorry, your privilege level is not high enough to use that option.\n\r");
return (FALSE);
}
cmd_c()
{ /* go to the operating system level */
char well[3];
int length;
if (resp_flag) {
portsout("\n\r\n\rAre you sure you want to exit? (Y/n): ");
portsin(well, 1);
portsout(CRLF);
if (well[0] == 'N' || well[0] == 'n')
return;
}
length = strlen(c_pathname);
if (resp_flag && length > 0) {
portsout(CRLF);
strcpy(buf128, "Would you like to leave a private message for ");
strcat(buf128, SYSOP);
strcat(buf128, "? (y/N): ");
portsout(buf128);
portsin(well, 1);
portsout(CRLF);
if (well[0] == 'y' || well[0] == 'Y') {
portsout("\n\rDo you wish to use blocked (right justified) format? (y/N: ");
portsin(well, 1);
portsout(CRLF);
if (well[0] == 'y' || well[0] == 'Y')
blocked_m = 1;
else
blocked_m = 0;
strcpy(m_pathname, c_pathname);
hdrread();
reply_sw = TRUE;
strcpy(msg_to, SYSOP);
strcpy(msg_subject, "Departure Message");
end_msg = TRUE;
cmd_e();
reply_sw = FALSE;
}
}
if ((inbuf = fopen(SYSTEM, "r")) == NULL) {
portsout("\n\rError opening system file!\n\r");
exit(1);
} else {
no_cntrl_k = TRUE;
porttype(inbuf);/* type a file to port */
fclose(inbuf);
}
active = FALSE;
}
/* end of function */
cmd_t()
{
int minutes, seconds;
xsec = alarm(0);
sec = xsec;
alarm(sec);
minutes = xsec / 60;
seconds = xsec - (minutes * 60);
portsout(CRLF);
portsout("Time left = ");
itoa(bufy, minutes);
strcpy(bufx, bufy);
strcat(bufx, " minutes and ");
itoa(bufy, seconds);
strcat(bufx, bufy);
strcat(bufx, " seconds");
portsout(bufx);
portsout(CRLF);
}
cmd_tt(tt) int tt;
{
int minutes, seconds;
long tottime;
tottime = difft();
minutes = (int)tottime / 60L;
seconds = (int)tottime - (long)(minutes * 60);
itoa(bufy, minutes);
strcpy(bufx, bufy);
strcat(bufx, " minutes and ");
itoa(bufy, seconds);
strcat(bufx, bufy);
strcat(bufx, " seconds");
}
int
timer()
{
portsout(CRLF);
if (which_timer == 1)
portsout("Your login time limit has been reached!");
if (which_timer == 2)
portsout("Your usage time limit has been reached!");
if (which_timer == 3)
portsout("Your response time limit has been reached!");
portsout(CRLF);
restoremodes();
portrst(); /* undo any special modes */
closer(2);
exit(1);
}
int
hanged()
{
restoremodes();
portrst();
closer(3);
exit(1);
}
closer(typeclose)
int typeclose;
{
int result;
if(typeclose == 2)
cmd_tt(0);
else
cmd_tt(1);
if ((inbuf = fopen(callers, "a")) == NULL)
exit(1);
result = fprintf(inbuf, "Time used on the system = %s\n",bufx);
if (result < 0)
exit(1);
switch(typeclose) {
case (1): fprintf(inbuf, "Normal exit .....\n");
break;
case (2): fprintf(inbuf, "Limit exit .....");
switch (which_timer) {
case(1): fprintf(inbuf, "logon\n");
break;
case(2): fprintf(inbuf, "usage\n");
break;
case(3): fprintf(inbuf, "response\n");
break;
}
break;
case (3): fprintf(inbuf, "The user just hung up! .....\n");
break;
case (4): fprintf(inbuf, "The user forgot his password! .....\n");
break;
default: fprintf(inbuf, "Ooooops .... This exit is not known! .....\n");
break;
}
fprintf(inbuf,"\n\n");
fclose(inbuf);
}
int
mon_toggle()
{
signal(SIGUSR1, mon_toggle);
if (!chat_in_progress)
if_monitor = !if_monitor;
else
chat_in_progress = !chat_in_progress;
}
int
STOP()
{
signal(SIGINT, STOP);
stop_that = TRUE;
}
int
chat()
{
FILE *dev;
int result, handle;
char byte, byten, byter, bytes, device[30];
signal(SIGPIPE, chat);
byten = (char) '\n';
byter = (char) '\r';
bytes = (char) ' ';
chat_in_progress = TRUE;
stop_chat = TRUE;
if (hold_pipe) {
alarm(Sec);
hold_pipe = FALSE;
}
Xsec = alarm(0);
if ((dev = fopen(SYSTTY, "r")) == NULL) {
portsout_chat("\n\rError finding sysop's device driver!\n\r");
exit(1);
}
if ((fgets(device, 29, dev) == NULL)) {
portsout_chat("\n\rError reading sysop's device driver name!\n\r");
exit(1);
}
fclose(dev);
strip(device);
handle = open(device, O_WRONLY);
if (handle == -1) {
portsout_chat("\n\rError opening sysop's device driver!\n\r");
exit(1);
}
portsout_chat(CRLF);
portsout_chat(CRLF);
portsout_chat(CRLF);
portsout_chat("********** THE SYSOP HAS STARTED CHAT MODE ********");
portsout_chat(CRLF);
portsout_chat("*** Your usage time has stopped during the chat ***");
portsout_chat(CRLF);
portsout_chat(CRLF);
portsout_chat(CRLF);
while (chat_in_progress) {
byte = portin_chat();
if (byte == 127)
byte = '\b';
portout_chat(byte);
if (byte == '\n')
portout_chat(byter);
if (byte == '\r')
portout_chat(byten);
write(handle, &byte, 1);
if (byte == '\n')
write(handle, &byter, 1);
if (byte == '\r')
write(handle, &byten, 1);
if (byte == '\b') {
write(handle, &bytes, 1);
portout_chat(bytes);
write(handle, &byte, 1);
portout_chat(byte);
}
}
close(handle);
portsout_chat(CRLF);
portsout_chat(CRLF);
portsout_chat(CRLF);
portsout_chat("********** THE SYSOP HAS STOPPED CHAT MODE **********");
portsout_chat(CRLF);
portsout_chat(CRLF);
portsout_chat(CRLF);
alarm(Xsec);
}
int
sys_toggle()
{
signal(SIGUSR2, sys_toggle);
if (!toggle_hold && hold_off) {
toggle_hold = TRUE;
return;
}
toggle_hold = FALSE;
if (!sys_flag) {
old_priv = user_priv;
user_priv = max_priv;
if (max_priv != MAXPRIV) {
sprintf(buf128, "\n\rCompiler error max=%d MAX=%d\n\r", max_priv, MAXPRIV);
portsout(buf128);
exit(1);
}
strcpy(old_upath, u_pathname);
strcpy(old_fpath, f_pathname);
strcpy(old_mpath, m_pathname);
old_sec = alarm(0);
alarm(MAXSEC);
} else {
user_priv = old_priv;
strcpy(u_pathname, old_upath);
strcpy(f_pathname, old_fpath);
strcpy(m_pathname, old_mpath);
if (!first_msg_in)
hdrread();
delta_time = old_sec;
delta_time = delta_time - (MAXSEC - alarm(0));
if (delta_time < 0L || delta_time > 32767L)
delta_time = 5L;
sec = delta_time;
alarm(sec);
}
sys_flag = !sys_flag;
}
cmd_f()
{
char choice[6];
char *file_ptr_x;
long bytes_left;
int result;
listed_l = FALSE;
listed_r = FALSE;
listed_n = FALSE;
if (first_time_in) {
result = atoi(l_f_base);
change_area(result);
}
first_time_in = FALSE;
ffile:
portsout(CRLF);
portsout(CRLF);
signal(SIGALRM, timer);
signal(SIGHUP, hanged);
signal(SIGUSR1, mon_toggle);
signal(SIGUSR2, sys_toggle);
signal(SIGPIPE, chat);
signal(SIGINT, STOP);
cmd_t();
portsout("\n\rCurrent download area = ");
strcpy(buf128, f_pathname);
file_ptr_x = strrchr(buf128, '/');
*file_ptr_x = '\0';
file_ptr_x = strrchr(buf128, '/');
*file_ptr_x++;
strcpy(who_am_i, file_ptr_x);
portsout(who_am_i);
portsout("\n\rCurrent upload area = ");
strcpy(buf128, u_pathname);
file_ptr_x = strrchr(buf128, '/');
*file_ptr_x = '\0';
file_ptr_x = strrchr(buf128, '/');
*file_ptr_x++;
strcpy(who_am_i, file_ptr_x);
portsout(who_am_i);
portsout(CRLF);
bytes_left = max_dload - dload_total;
strcpy(buf128, "Allowable daily download limit = ");
sprintf(who_am_i, "%ld", bytes_left);
strcat(buf128, who_am_i);
strcat(buf128, " bytes\n\r");
portsout(buf128);
stop_that = FALSE;
bbsmenu(3,0);
portsin_cmp(choice, 5, "FfLlUuDdMmXxTtGgCcRrNnSsZz?");
portsout(CRLF);
fix_name(choice);
switch (choice[0]) {
case ('S'):
if (!privmsg(fpL))
goto ffile;
summary();
goto ffile;
case ('L'):
if (!privmsg(fpL))
goto ffile;
listed_r = FALSE;
listed_n = FALSE;
listed_l = FALSE;
file_loc( NULL );
goto ffile;
case ('F'):
if (!privmsg(fpL))
goto ffile;
listed_r = FALSE;
listed_n = FALSE;
file_l();
listed_l = TRUE;
goto ffile;
case ('N'):
if (!privmsg(fpL))
goto ffile;
listed_r = FALSE;
listed_l = FALSE;
file_n();
listed_n = TRUE;
goto ffile;
case ('Z'):
if (!privmsg(fpL))
goto ffile;
listed_r = FALSE;
listed_l = FALSE;
listed_n = FALSE;
allnew();
goto ffile;
case ('?'): /* help */
if (!privmsg(mpZ))
goto ffile;
cmd_p(HELPFILE);
goto ffile;
case ('R'):
if (!privmsg(fpR))
goto ffile;
listed_l = FALSE;
listed_n = FALSE;
file_r();
listed_r = TRUE;
goto ffile;
case ('C'):
if (!privmsg(fpL))
goto ffile;
listed_l = FALSE;
listed_r = FALSE;
listed_n = FALSE;
file_c();
goto ffile;
case ('T'):
if (!privmsg(mpT))
goto ffile;
toggle = !toggle;
rewritx();
if (toggle) {
portsout("\n\rStop Mode\n\r");
} else {
portsout("\n\rContinuous Mode\n\r");
}
goto ffile;
case ('A'):
result = strlen(choice);
result--;
if (!result)
change_area(0);
else {
substr(choice, buf128, 2, result);
digit(buf128);
result = atoi(buf128);
change_area(result);
}
listed_r = FALSE;
listed_l = FALSE;
listed_n = FALSE;
goto ffile;
case ('X'):
if (!privmsg(mpX))
goto ffile;
cmd_x();
rewritx();
goto ffile;
case ('U'):
if (!privmsg(fpU))
goto ffile;
file_u();
listed_r = FALSE;
listed_l = FALSE;
listed_n = FALSE;
goto ffile;
case ('D'):
if (!privmsg(fpD))
goto ffile;
file_d();
goto ffile;
case ('M'):
if (!privmsg(fpM))
goto ffile;
listed_l = FALSE;
listed_r = FALSE;
listed_n = FALSE;
break;
case ('G'):
if (!privmsg(fpG))
goto ffile;
cmd_c();
break;
default:
goto ffile;
}
}
file_c()
{
int result, zcat;
char *ptr, temp[16];
zcat = 0;
portsout("\n\r\n\rArchive Contents Listing Option for .tar(.Z), .zip or .arc files\n\r\n\r");
portsout("Input archive file name to list ====> ");
portsin(x_filename, 15);
portsout(CRLF);
if (strlen(x_filename) < 1)
return;
strcpy(x_pathandfile, f_pathname);
strcat(x_pathandfile, x_filename);
ptr = strrchr(x_pathandfile, '.');
if (ptr == NULL) {
portsout("\n\rImproper file extension\n\r");
return;
}
*ptr++;
strcpy(temp, ptr);
if (strcmp(temp, "Z") == 0) {
zcat = 1;
strcpy(buf128, x_pathandfile);
ptr = strrchr(buf128, '.');
if (ptr == NULL) {
portsout("\n\rImproper file extension\n\r");
return;
}
*ptr = '\0';
ptr = strrchr(buf128, '.');
if (ptr == NULL) {
portsout("\n\rImproper file extension\n\r");
return;
}
*ptr++;
strcpy(temp, ptr);
}
if ((strcmp(temp, "arc") == 0) || (strcmp(temp, "ARC") == 0) || (strcmp(temp, "tar") == 0) || (strcmp(temp,"zip") == 0) || (strcmp(temp,"ZIP") ==0)) {
result = stat(x_pathandfile, &statbuf);
if (result != 0) {
portsout("\n\r\n\rThe requested file was not found!\n\r\n\r");
return;
}
if ((strcmp(temp, "arc") == 0 || strcmp(temp, "ARC") == 0)) {
listarc(x_pathandfile, port_id);
/*
strcpy(buf128, ARC);
strcat(buf128, x_pathandfile);
strcat(buf128, " > ");
strcat(buf128, TMPFILE);
strcat(buf128, port_id);
(void) system(buf128);
*/
strcpy(buf128, "/tmp/arclst.");
strcat(buf128, port_id);
portsout("\n\r\n\r");
/*
strcpy(buf128, TMPFILE);
strcat(buf128, port_id);
*/
cmd_p(buf128);
portsout("\n\r\n\r");
return;
}
if ((strcmp(temp, "zip") == 0 || strcmp(temp, "ZIP") == 0)) {
listzip( x_pathandfile, port_id);
/*
strcpy(buf128, ZIP);
strcat(buf128, x_pathandfile);
strcat(buf128, " > ");
strcat(buf128, TMPFILE);
strcat(buf128, port_id);
(void) system(buf128);
*/
strcpy(buf128, "/tmp/ziplst.");
strcat(buf128, port_id);
portsout("\n\r\n\r");
/*
strcpy(buf128, TMPFILE);
strcat(buf128, port_id);
*/
cmd_p(buf128);
portsout("\n\r\n\r");
return;
}
if (strcmp(temp, "tar") == 0) {
if (!zcat) {
strcpy(buf128, TAR);
strcat(buf128, x_pathandfile);
} else {
strcpy(buf128, ZCAT);
strcat(buf128, x_pathandfile);
strcat(buf128, " | ");
strcat(buf128, TAR);
strcat(buf128, "-");
}
strcat(buf128, " > ");
strcat(buf128, TMPFILE);
strcat(buf128, port_id);
portsout("\n\rOne moment please ....");
(void) system(buf128);
portsout("\n\r\n\r");
strcpy(buf128, TMPFILE);
strcat(buf128, port_id);
cmd_p(buf128);
portsout("\n\r\n\r");
return;
}
}
portsout("\n\r\n\rIllegal file extension!\n\r\n\r");
}
file_r()
{
int result;
if (!listed_r) {
portsout("\n\rOne moment please ....");
strcpy(buf128, "ls -l ");
strcat(buf128, f_pathname);
strcat(buf128, " > ");
strcat(buf128, TMPFILE);
strcat(buf128, port_id);
(void) system(buf128);
}
portsout("\n\r\n\r");
strcpy(buf128, TMPFILE);
strcat(buf128, port_id);
cmd_p(buf128);
portsout("\n\r\n\r");
}
msgck()
{
portsout("A control-k will terminate the listing\n");
}
file_l()
{
int result;
int zz;
char timeptr[30];
char *fileptr;
int lnctx, xp;
lnctx = 1;
if (xpert)
xp = 10;
else
xp = 5;
xyy = atol(yy);
strcpy(buf128, f_pathname);
strcat(buf128, FILES);
if ((rdstatbuf = fopen(buf128, "r")) == NULL) {
portsout("\n\rThe are NO files available!\n\r");
return;
}
msgck();
portsout(CRLF);
strcpy(buf128, TMPFILE);
strcat(buf128, port_id);
while (fscanf(rdstatbuf, "%14s", x_filename) != EOF) {
zz = 0;
if (x_filename[0] == '~') {
goto finis; /* Special case so that that
* following files are not displayed
* - can be used to disallow uploads
* from being shown until they are
* validated. */
}
if (x_filename[0] == '+') {
fileptr = x_filename + 1;
strcpy(work_msg, fileptr);
(void) fgets(buf128, 80, rdstatbuf);
strcat(work_msg, buf128);
strip(work_msg);
goto arond;
}
if (x_filename[0] == '.') {
strcpy(x_filename, " ");
strcpy(who_am_i, " ");
strcpy(who_am_I, " ");
zz++;
}
if (result = fgets(buf128, 55, rdstatbuf) == NULL) {
if (!zz)
strcpy(buf128, " ***** No description on file *****");
}
strip(buf128);
if (!zz)
term_space(buf128);
result = strlen(buf128);
if (result == 0) {
if (!zz)
strcpy(buf128, " ***** No description on file *****");
}
if (!zz) {
strcpy(x_pathandfile, f_pathname);
strcat(x_pathandfile, x_filename);
result = stat(x_pathandfile, &statbuf);
if (result != 0) {
strcpy(who_am_i, "OFFLINE");
strcpy(who_am_I, " ");
goto around;
}
xmm = statbuf.st_size;
sprintf(who_am_i, "%6ld", xmm);
xmm = statbuf.st_mtime;
strcpy(timeptr, ctime(&xmm));
substr(timeptr, bufx, 5, 6);
substr(timeptr, z_dd, 23, 2);
xmm = atol(z_dd);
if (xyy > xmm) {
substr(timeptr, bufx, 5, 3);
strcat(bufx, "-");
strcat(bufx, z_dd);
}
strcpy(who_am_I, bufx);
}
around:
sprintf(work_msg, "%-15s%-7s%-6s%-50s", x_filename, who_am_i, who_am_I, buf128);
arond:
strip(work_msg);
term_space(work_msg);
sprintf(buf128, "%s\n\r", work_msg);
portsout(buf128);
if (stop_that) {
fclose(rdstatbuf);
stop_that = FALSE;
return;
}
if (toggle) {
lnctx++;
if (lnctx == 23) {
portsout(CRLF);
portsout("*** Depress a key to continue ( control-k to quit ) ........ ");
jnk[0] = portin();
if (jnk[0] == CTL_K || stop_that) {
stop_that = FALSE;
fclose(rdstatbuf);
return;
}
portsout(CRLF);
lnctx = 1;
}
}
}
finis:
fclose(rdstatbuf);
finisl:
if (toggle && lnctx > xp) {
portsout(CRLF);
portsout("*** Depress a key to continue ........ ");
jnk[0] = portin();
portsout(CRLF);
}
portsout(CRLF);
portsout(CRLF);
}