void TERMWINDOWMEMBER showRoomDescription(void) { OC.SetOutFlag(OUTOK); label DescFile; CurrentRoom->GetDescFile(DescFile, sizeof(DescFile)); if (CurrentUser->IsViewRoomDesc() && *DescFile && !Talley->Visited(thisRoom) && IsFilenameLegal(DescFile, NULL)) { char pathToRoomDesc[128]; sprintf(pathToRoomDesc, sbs, cfg.roompath, DescFile); if (filexists(pathToRoomDesc)) { if (!CurrentUser->IsExpert()) { CRmPrintfCR(getmsg(577)); } dumpf(pathToRoomDesc, TRUE, 0); doCR(); OC.SetOutFlag(OUTOK); } else { mPrintfCR(getmsg(427), cfg.Lroom_nym, DescFile); } doCR(); } }
/* -------------------------------------------------------------------- */ int dump(char *filename) { FILE *fbuf; int c, returnval = TRUE; /* last itteration might have been N>exted */ outFlag = OUTOK; setio(whichIO, echo, outFlag); doCR(); if ( (fbuf = fopen(filename, "r")) == NULL) { mPrintf(" No file %s", filename); return(ERROR); } /* looks like a kludge, but we need speed!! */ while ( (c = getc(fbuf) ) != ERROR && (c != 26 /* CPMEOF */ ) && (outFlag != OUTNEXT) && (outFlag != OUTSKIP) && !mAbort(FALSE) ) { if (c == '\n') doCR(); else oChar((char)c); } if ( outFlag == OUTSKIP) returnval = ERROR; fclose(fbuf); return returnval; }
/* ** printdir() prints out one filename and size, for a dir listing */ static int printdir (struct dirList *fn) { char *desc; extern char *getTag(); extern char *monthTab[]; if (fn->fd_name[0] != '$') /* $dir is the directory file */ { outFlag = OUTOK; if (FDextended) { desc = getTag(fn->fd_name); CRfill = (termWidth > 62) ? "%13c| " : " "; mPrintf("%-13s|%7ld ", fn->fd_name,fn->fd_size); mPrintf("%02d%s%02d ", fn->fd_date._year, monthTab[fn->fd_date._month], fn->fd_date._day); if (desc) { if (termWidth <= 62) doCR(); mFormat(desc); } CRfill = NULL; doCR(); } else mPrintf("%-14s%7ld ", fn->fd_name, fn->fd_size); FDSectCount += fn->fd_size; mAbort(); /* chance to next(!)/pause/skip */ } return (outFlag != OUTSKIP); }
/* -------------------------------------------------------------------- */ void echocharacter(char c) { setio(whichIO, echo, outFlag); if (echo == NEITHER) { if (echoChar != '\0') { echo = BOTH; if (c == '\b') doBS(); else if (c == '\t') doTAB(); else if (c == '\n') { echo = CALLER; doCR(); } else oChar(echoChar); echo = NEITHER; } } else if (c == '\b') doBS(); else if (c == '\n') doCR(); else oChar(c); }
void greeting(void) { int messages; char dtstr[80]; if (loggedIn) terminate(FALSE, FALSE); echo = BOTH; setdefaultconfig(); initroomgen(); cleargroupgen(); if (cfg.accounting) unlogthisAccount(); delay(100); if (newCarrier) hello(); mPrintf("\n Welcome to %s, %s", cfg.nodeTitle, cfg.nodeRegion); mPrintf("\n Running %s v%s", softname, version); # ifdef ALPHA_TEST mPrintf("\n Alpha Test Site"); # endif # ifdef BETA_TEST mPrintf("\n Beta Test Site"); # endif #ifdef FLOPPY mPrintf("\n Floppy edition"); #endif doCR(); doCR(); cit_strftime(dtstr, 79, cfg.vdatestamp, 0L); mPrintf(" %s", dtstr); if (!cfg.forcelogin) { mPrintf("\n H for Help"); mPrintf("\n ? for Menu"); mPrintf("\n L to Login"); } getRoom(LOBBY); messages = talleyBuf.room[thisRoom].messages; doCR(); mPrintf(" %d %s ", messages, (messages == 1) ? "message" : "messages"); doCR(); while (MIReady()) getMod(); logBuf.linesScreen = 23; }
/* -------------------------------------------------------------------- */ void setlbvisit(void) { int i; /* see if the message base was cleared since last call */ for (i = 0; i < MAXROOMS; i++) { if (logBuf.newpointer[i] > cfg.newest) { for (i = 0; i < MAXROOMS; i++) logBuf.newpointer[i] = cfg.oldest; #ifdef GOODBYE logBuf.lbvisit[ 0 ]= cfg.newest; logBuf.lbvisit[ (MAXVISIT-1) ]= cfg.oldest; #endif doCR(); mPrintf("%s base destroyed since last call!", cfg.msg_nym); doCR(); mPrintf("All %s pointers reset.", cfg.msg_nym); doCR(); return; } } /* slide lbvisit array down and change lbgen entries to match: */ #ifdef GOODBYE for (i = (MAXVISIT - 2); i; i--) { logBuf.lbvisit[i] = logBuf.lbvisit[i-1]; } logBuf.lbvisit[(MAXVISIT - 1)] = cfg.oldest; logBuf.lbvisit[0 ] = cfg.newest; #endif for (i = 0; i < MAXROOMS; i++) { #ifdef GOODBYE if ((logBuf.lbroom[i].lvisit) < (MAXVISIT-2)) { logBuf.lbroom[i].lvisit++; } #endif logBuf.lbroom[i].bypass = FALSE; MessageRoom[i] = 0; } }
/* * FindFileComment() * * This will find a file comment for file: see SYSDEP.DOC. */ int FindFileComment(char *fileName, char extraneous) { char *c, Chatter = FALSE; int Last; if (fileTags == NULL) return FALSE; /* Check to see if already in buffer */ if (specCmpU(fileName, msgBuf.mbtext) == SAMESTRING) return TRUE; /* * No. If last search was successful, then we have to get the next * line right now. */ if (tagFound) { do { if ((c = fgets(msgBuf.mbtext, MAXTEXT-10, fileTags)) == NULL) break; if (msgBuf.mbtext[0] == ';') if (extraneous) { mFormat(msgBuf.mbtext + 1); Last = strLen(msgBuf.mbtext + 1); /* finicky check */ Chatter = TRUE; } } while (msgBuf.mbtext[0] == ';'); } if (Chatter && Last > 1)/* need this for ";" stuff -- allows normal */ doCR(); /* formatting without blank lines. */ tagFound = FALSE; while (c != NULL && specCmpU(fileName, msgBuf.mbtext) > SAMESTRING) { do { if ((c=fgets(msgBuf.mbtext, MAXTEXT-10, fileTags)) == NULL) break; if (msgBuf.mbtext[0] == ';') if (extraneous) { mFormat(msgBuf.mbtext + 1); doCR(); } } while (msgBuf.mbtext[0] == ';'); } if (c != NULL) tagFound = (specCmpU(fileName, msgBuf.mbtext) == SAMESTRING); return tagFound; }
char iChar() { char modIn(); char c; scrn = 0; if (ra.justLostCarrier) return 0; /* ugly patch */ blank_flag = FALSE; c = ra.filter[modIn()]; if (c==SPECIAL) c=' '; /* if(ra.textDownload) return(c);*/ switch (ra.echo) { case BOTH: if (ra.haveCarrier) { if (c == '\n') doCR(); else outMod(c); } if (c == '\n') cprintf ("\n\r"); else putch(c); break; case CALLER: if (ra.whichIO == MODEM) { if (c == '\n') doCR(); else outMod(c); } else { if (c == '\n') cprintf("\n\r"); else putch(c); } break; case ASTERISK: if (ra.haveCarrier) { if (c == '\n') doCR(); else outMod((c=='\b' ? '\b' : '*')); } if (c == '\n') cprintf ("\n\r"); else putch((c == '\b' ? '\b' : '*')); break; } return(c); }
/************************************************************************ config_menu() - displays current configuration ************************************************************************/ void config_menu() { doCR(); mPrintf("User Configuration. Press Letter to Change\n "); sprintf(format,"A) Terminal Width : %d\n ", ra.termWidth); mPrintf(format); sprintf(format,"B) Screen Height : %d\n ", ra.logBuf.pause_at & 0x7f); mPrintf(format); sprintf(format,"C) Add Linefeed to CR: %s\n ", (ra.termLF ? "Yes" : "No")); mPrintf(format); sprintf(format,"D) Expand Tabs : %s\n ", (ra.termTab ? "Yes" : "No")); mPrintf(format); sprintf(format,"E) Last Old with New : %s\n ", (ra.lasto ? "Yes" : "No")); mPrintf(format); sprintf(format,"F) Expert Mode : %s\n ", (ra.expert ? "Yes" : "No")); mPrintf(format); sprintf(format,"G) Screen Pause : %s\n ", (ra.termMore ? "Yes" : "No")); mPrintf(format); if(ra.termMore) { sprintf(format," Pause After Each Msg : %s\n ", (ra.logBuf.pause_at & 0x80 ? "yes" : "No")); mPrintf(format); } sprintf(format,"H) Controlled Typeout: %s\n ", (ra.nopace ? "No" : "Yes")); mPrintf(format); mPrintf("X) Exit Configuration\n "); }
/* -------------------------------------------------------------------- */ dumpf(char *filename) { FILE *fbuf; char line[MAXWORD]; int returnval = TRUE; /* last itteration might have been N>exted */ outFlag = OUTOK; setio(whichIO, echo, outFlag); doCR(); if ( (fbuf = fopen(filename, "r")) == NULL) { mPrintf(" No helpfile %s", filename); return(ERROR); } /* looks like a kludge, but we need speed!! */ while ( fgets(line, MAXWORD, fbuf) && (outFlag != OUTNEXT) && (outFlag != OUTSKIP) && !mAbort(FALSE) ) { mFormat(line); } if ( outFlag == OUTSKIP) returnval = ERROR; fclose(fbuf); return returnval; }
/* -------------------------------------------------------------------- */ void hallinfo() { uchar i; mPrintf(" Hallway %s", hallBuf->hall[thisHall].hallname); if (hallBuf->hall[thisHall].owned) { mPrintf(", owned by group %s", grpBuf->group[hallBuf->hall[thisHall].grpno].groupname); } if (hallBuf->hall[thisHall].mult_grp) { for(i=0; i<MAXGROUPS; i++) { if(debug) { if( grpBuf->group[i].g_inuse) { cPrintf("grpBuf=%d hallgrp=%d ", grpBuf->group[i].groupgen, hallgrp->hall[thisHall].grp[i].grpgen); } } if ( grpBuf->group[i].g_inuse && (hallgrp->hall[thisHall].grp[i].grpgen == grpBuf->group[i].groupgen)) { mPrintf(", shared by group %s", grpBuf->group[i].groupname); } } } doCR(); }
/* -------------------------------------------------------------------- */ void listhalls(void) { int i; doCR(); doCR(); prtList(LIST_START); for (i = 0; i < MAXHALLS; i++) { if (hallBuf->hall[i].h_inuse) { prtList(hallBuf->hall[i].hallname); } } prtList(LIST_END); }
/* * OutsideEditorWork() * * This will execute an outside editor for anyone. */ void OutsideEditorWork(char *EditLine) { char cmdline[90]; extern FILE *upfd; extern int outPut; doCR(); /* this gets crtColumn back to zero */ sprintf(cmdline, "%stempmsg.sys", cfg.DepData.EditArea); if (!redirect(cmdline, INPLACE_OF)) return; mFormat(msgBuf.mbtext, oChar, doCR); undirect(); MakeCmdLine(cmdline, EditLine, "", sizeof cmdline - 1); if (cfg.DepData.IBM) ModemShutdown(FALSE); CitSystem(TRUE, "%s %stempmsg.sys", cmdline, cfg.DepData.EditArea); if (cfg.DepData.IBM) { ModemOpen(FALSE); if (!gotCarrier() && strLen(cfg.DepData.sDisable) == 0) DisableModem(FALSE); } /* homeSpace(); */ /* Commented out for 120.692 */ msgBuf.mbtext[0] = 0; sprintf(cmdline, "%stempmsg.sys", cfg.DepData.EditArea); msgBuf.mbtext[0] = 0; ingestFile(cmdline, msgBuf.mbtext); unlink(cmdline); }
int TERMWINDOWMEMBER Brent(const char **Format, int *colCount, char *collect) { char thisFormat = **Format; char toOutput = thisFormat; if (thisFormat == '^') { toOutput = *(++(*Format)); if (toupper(toOutput) >= 'A' && toupper(toOutput) <= 'Z') { toOutput = (char) (toupper(toOutput) - 64); } } else if (thisFormat == '\\') { toOutput = *(++(*Format)); switch (toupper(toOutput)) { case 'N': { if (*colCount) { collect[*colCount] = 0; mFormat(collect); *colCount = 0; } OC.Formatting = TRUE; doCR(); OC.Formatting = FALSE; toOutput = 0; break; } case 'T': { toOutput = '\t'; break; } case 'B': { toOutput = '\b'; break; } } } if (toOutput) { collect[(*colCount)++] = toOutput; } return (**Format); }
void TERMWINDOWMEMBER dumpRoom(Bool infoLineAndAutoApp) { doCR(); if (infoLineAndAutoApp) { char Buffer[80]; if (*CurrentRoom->GetDescFile(Buffer, sizeof(Buffer)) && !Talley->Visited(thisRoom)) { showRoomDescription(); } else if (*CurrentRoom->GetInfoLine(Buffer, sizeof(Buffer)) && CurrentUser->IsViewRoomInfoLines()) { mPrintfCR(getmsg(634), Buffer); } } // hmmm... where to put this? if (infoLineAndAutoApp && CurrentRoom->IsApplication() && CurrentRoom->IsAutoApp() && !Talley->Visited(thisRoom)) { ExeAplic(); } if (CurrentUser->IsAide()) { mPrintf(getmsg(635), ltoac(Talley->TotalMessagesInRoom(thisRoom))); } const m_slot messages = Talley->MessagesInRoom(thisRoom); mPrintf(getmsg(636), ltoac(messages), (messages == 1) ? cfg.Lmsg_nym : cfg.Lmsgs_nym); const m_slot newMsgs = Talley->NewInRoom(thisRoom); if (newMsgs && loggedIn) { mPrintf(getmsg(637), ltoac(newMsgs)); } mPrintfCR(getmsg(433)); if (Talley->HasNewMail(thisRoom) && loggedIn) { mPrintfCR(getmsg(591)); } if (Talley->HasOldMail(thisRoom) && loggedIn) { mPrintfCR(getmsg(599)); } label NetID; RoomTab[thisRoom].GetNetID(NetID, sizeof(NetID)); // maybe IsRoomShared check? definitely not! if (*NetID && CurrentUser->IsSysop() && IsNetIDCorrupted(NetID)) { mPrintfCR(getmsg(464)); } }
/* -------------------------------------------------------------------- */ void putWord(char *st) { char *s; int newColumn; setio(whichIO, echo, outFlag); /* calculate word end */ for (newColumn = crtColumn, s = st; *s; s++) { if (*s == '\t') while ((++newColumn % 8) != 1); else if (*s == 1) --newColumn; /* don't count ANSI codes */ else if (*s > ' ') /* don't count what we don't print */ ++newColumn; } if (newColumn >= gl_term.termWidth) /* Wrap words that don't fit */ doCR(); for (; *st; ++st) { /* check for Ctrl-A codes */ if (*st == 1) { if (*++st) { /* must have something after ^A */ termCap(*st); continue; } else { break; } } /* worry about words longer than a line: */ if (crtColumn > gl_term.termWidth) doCR(); if ((prevChar != '\n') || (*st > ' ')) { oChar(*st); } else { /* end of paragraph: */ if (outFlag == OUTPARAGRAPH) { outFlag = OUTOK; } doCR(); oChar(*st); } } }
Bool CronC::Do(CronCallerE) { DEBUGCODE(MessageDat.Verify()); Bool done = FALSE; if (Events && !Pause) { CronEventListS *StartEvent = OnEvent; WAITFORm(CronMutex); do { if (OnEvent->Event.CanDo(forceevent)) { ExecutingEvent = OnEvent; repeatevent = !OnEvent->Event.Do() && repeatevent; ExecutingEvent = NULL; done = TRUE; } if (!repeatevent && (OnEvent = (CronEventListS *) getNextLL(OnEvent)) == NULL) { OnEvent = Events; } } while (!done && OnEvent != StartEvent); RELEASEm(CronMutex); } #ifndef WINCIT if (!done) { DebugOut(52); CITWINDOW *w = ScreenSaver.IsOn() ? NULL : CitWindowsMsg(NULL, getmsg(19)); Initport(); if (w) { destroyCitWindow(w, FALSE); } return (FALSE); } doCR(); #endif return (TRUE); }
/* -------------------------------------------------------------------- */ void systat(void) { unsigned int i; unsigned long average, work; char summary[256]; char dtstr[80]; int public = 0, private = 0, group = 0, problem = 0, moderated = 0; outFlag = OUTOK; /* even the name of the BBS program is not cast in concrete! */ mPrintf("%s @ %s, %s ", softname, cfg.nodeTitle, cfg.nodeRegion); doCR(); mPrintf(" Running Version %s Compiled on %s at %s", version, compdate, comptime); doCR(); cit_strftime(dtstr, 79, cfg.vdatestamp, 0l); mPrintf(" %s", dtstr); doCR(); mPrintf(" Up time: "); diffstamp(uptimestamp); if (gotCarrier()) { doCR(); mPrintf(" Connect time: "); diffstamp(conntimestamp); } if (loggedIn) { doCR(); mPrintf(" Logon time: "); diffstamp(logtimestamp); } doCR(); mPrintf(" Maximum of %d log entries,", cfg.MAXLOGTAB); mPrintf(" Call number %lu", cfg.callno); doCR(); mPrintf(" %ld messages, Last is %lu", cfg.newest - cfg.oldest + 1, cfg.newest); for (i = 0; i < sizetable(); ++i) { if (msgTab[i].mtmsgflags.PROBLEM) problem++; if (msgTab[i].mtmsgflags.MODERATED) moderated++; if (msgTab[i].mtmsgflags.LIMITED) group++; else if (msgTab[i].mtmsgflags.MAIL) private++; else public++; }
static void listExterns(void) { int i; int cmnds_visable=0; char *p; doCR(); if (onConsole && extCmd[0].name[0]) { cmnds_visable = 1; } else { for (i = 0; i < MAXEXTERN && extCmd[i].name[0]; ++i) if (!extCmd[i].local) { cmnds_visable = 1; break; } } outFlag = OUTOK; if (cmnds_visable) { mtPrintf(TERM_BOLD,"External Commands:"); doCR(); doCR(); for (i = 0; i < MAXEXTERN && extCmd[i].name[0]; ++i) { if (onConsole || !extCmd[i].local) { p = extCmd[i].name; mtPrintf(TERM_BOLD,"%c",*p); ++p; if (*p) mPrintf("%s", p); if (extCmd[i].local) mPrintf(" (local)"); doCR(); } } } else { mtPrintf(TERM_BOLD,"No external commands."); doCR(); } }
/* -------------------------------------------------------------------- */ void displaypw(char *name, char *in, char *pw) { mPrintf("\n nm: %s",name); mPrintf("\n in: "); echo = CALLER; mPrintf("%s", in); echo = BOTH; mPrintf("\n pw: "); echo = CALLER; mPrintf("%s",pw); echo = BOTH; doCR(); }
/* -------------------------------------------------------------------- */ void moveHall(int offset) { struct hall_buffer tmp; mPrintf("Move hall"); doCR(); doCR(); if ( (thisHall > (2) || offset == 1) && (thisHall < (MAXHALLS) || offset == -1) ) { tmp = hallBuf->hall[thisHall]; hallBuf->hall[thisHall] = hallBuf->hall[thisHall+offset]; hallBuf->hall[thisHall+offset] = tmp; thisHall += offset; mPrintf("Hall moved to just after %s.", hallBuf->hall[thisHall-1].hallname); doCR(); putHall(); } }
/* -------------------------------------------------------------------- */ BOOL getText(void) { char *buf; if (!gl_user.expert) { nextblurb("entry", &(cfg.cnt.ecount), 1); outFlag = OUTOK; doCR(); mPrintf(" You may enter up to %d characters.", cfg.maxtext); mPrintf("\n Please enter message. Use an empty line to end."); } outFlag = IMPERVIOUS; doCR(); putheader(); doCR(); outFlag = OUTOK; buf = msgBuf->mbtext; /* do text entry */ return (BOOL) editBuf(buf,cfg.maxtext-1); }
/* -------------------------------------------------------------------- */ void systat(char verbose) { union REGS r; int i; int tablesize; long average, work; char summary[250]; char dtstr[80]; int public = 0, private = 0, group = 0, problem = 0, moderated = 0; outFlag = OUTOK; mPrintf("%s %s, %s ", softname, cfg.nodeTitle, cfg.nodeRegion ); doCR(); mPrintf(" Running Version %s Compiled on %s at %s", version, cmpDate, cmpTime); doCR(); sstrftime(dtstr, 79, cfg.vdatestamp, 0l); mPrintf(" %s", dtstr); doCR(); mPrintf(" Up time: "); diffstamp(uptimestamp); if (gotCarrier()) { doCR(); mPrintf(" Connect time: "); diffstamp(conntimestamp); } doCR(); mPrintf(" Maximum of %d log entries,", cfg.MAXLOGTAB); mPrintf(" Call number %s", ltoac(cfg.callno)); doCR(); strcpy(dtstr, ltoac(cfg.newest - cfg.oldest + 1)); mPrintf(" %s %s, numbered %lu to %lu", dtstr, cfg.msgs_nym, cfg.oldest, cfg.newest); tablesize = (int)sizetable(); for( i = 0; i < tablesize; ++i) { if (msgTab1[i].mtmsgflags.PROBLEM ) problem++; if (msgTab1[i].mtmsgflags.MODERATED) moderated++; if (msgTab1[i].mtmsgflags.LIMITED ) group++ ; else if (msgTab1[i].mtmsgflags.MAIL ) private++; else public++ ; }
/* -------------------------------------------------------------------- */ void dospCR(void) { char oldecho; oldecho = echo; echo = BOTH; setio(whichIO, echo, outFlag); if (cfg.nopwecho == 1) doCR(); else { if (onConsole) { if (gotCarrier()) domcr(); } else doccr(); } echo = oldecho; }
/* -------------------------------------------------------------------- */ char *matchString(char *buf, char *pattern, char *bufEnd, char ver) { char *loc, *pc1, *pc2; char subbuf[11]; char foundIt; subbuf[10] = '\0'; for (loc = bufEnd, foundIt = FALSE; !foundIt && --loc >= buf;) { for (pc1 = pattern, pc2 = loc, foundIt = TRUE; *pc1 && foundIt;) { if (!(tolower(*pc1++) == tolower(*pc2++))) foundIt = FALSE; } if (ver && foundIt) { doCR(); strncpy(subbuf, buf + 10 > loc ? buf : loc - 10, (unsigned) (loc - buf) > 10 ? 10 : (unsigned) (loc - buf)); subbuf[(unsigned) (loc - buf) > 10 ? 10 : (unsigned) (loc - buf)] = 0; mPrintf("%s", subbuf); if (gl_term.ansiOn) termCap(TERM_BOLD); else mPrintf(">"); mPrintf("%s", pattern); if (gl_term.ansiOn) termCap(TERM_NORMAL); else mPrintf("<"); strncpy(subbuf, loc + strlen(pattern), 10); subbuf[10] = 0; mPrintf("%s", subbuf); if (!getYesNo("Replace", 0)) foundIt = FALSE; } } return foundIt ? loc : NULL; }
/* ** readdir() read the directory. */ static void readdir (char *fname) { int printdir(); long sectors, bytes; FDSectCount = 0L; if (FDextended) tagSetup(); doCR(); wildcard(printdir, strlen(fname) ? fname : "*.*"); if (FDextended) tagClose(); mPrintf("\n %s total.\n ", plural("byte", FDSectCount)); if (onConsole || cfg.diskusage) { diskSpaceLeft(roomBuf.rbdirname, §ors, &bytes); mPrintf("%s free in %s\n ", plural("byte", bytes), roomBuf.rbdirname); } FDextended = NO; }
/* -------------------------------------------------------------------- */ void force(void) { label hallname; int slot; getString("hallway", hallname, NAMESIZE, FALSE, ECHO, ""); slot = partialhall(hallname); if ( (slot == ERROR) || !strlen(hallname) ) { mPrintf("\n No such hall."); return; } thisHall = (unsigned char)slot; sprintf(msgBuf->mbtext, "Access forced to hallway %s", hallBuf->hall[thisHall].hallname ); mPrintf("%s", msgBuf->mbtext); doCR(); trap(msgBuf->mbtext, T_SYSOP); }
/* -------------------------------------------------------------------- */ void fkey(void) { char key; int oldIO, i, oldDowhat; label string; #define F1 59 #define F2 60 #define F3 61 #define F4 62 #define F5 63 #define F6 64 #define S_F6 89 #define A_F6 109 #define F7 65 #define F8 66 #define F9 67 #define F10 68 #define ALT_P 25 #define ALT_D 32 #define ALT_B 48 #define ALT_L 38 #define ALT_T 20 #define ALT_X 45 #define ALT_C 46 #define ALT_E 18 key = (char)getch(); if (strcmpi(cfg.f6pass, "f6disabled") != SAMESTRING) if (ConLock == TRUE && key == ALT_L && strcmpi(cfg.f6pass, "disabled") != SAMESTRING) { ConLock = FALSE; oldIO = whichIO; whichIO = CONSOLE; onConsole = TRUE; update25(); string[0] = 0; getNormStr("System Password", string, NAMESIZE, NO_ECHO); if (strcmpi(string, cfg.f6pass) != SAMESTRING) ConLock = TRUE; whichIO = (BOOL)oldIO; onConsole = (BOOL)(whichIO == CONSOLE); update25(); givePrompt(); return; } if (ConLock && !sysop && strcmpi(cfg.f6pass, "f6disabled") != SAMESTRING) return; switch(key) { case F1: drop_dtr(); detectflag = FALSE; break; case F2: Initport(); detectflag = FALSE; break; case F3: sysReq = (BOOL)(!sysReq); break; case F4: ScreenFree(); anyEcho = (BOOL)(!anyEcho); break; case F5: if (whichIO == CONSOLE) whichIO = MODEM; else whichIO = CONSOLE; onConsole = (BOOL)(whichIO == CONSOLE); break; case S_F6: if (!ConLock) aide = (BOOL)(!aide); break; case A_F6: if (!ConLock) sysop = (BOOL)(!sysop); break; case F6: if (sysop || !ConLock) sysopkey = TRUE; break; case F7: cfg.noBells = !cfg.noBells; break; case ALT_C: case F8: chatkey = (BOOL)(!chatkey); /* will go into chat from main() */ break; case F9: cfg.noChat = !cfg.noChat; chatReq = FALSE; break; case F10: help(); break; case ALT_B: backout = (BOOL)(!backout); break; case ALT_D: debug = (BOOL)(!debug); break; case ALT_E: eventkey = TRUE; break; case ALT_L: if (cfg.f6pass[0] && strcmpi(cfg.f6pass, "f6disabled") != SAMESTRING) ConLock = (BOOL)(!ConLock); break; case ALT_P: if (printing) { printing=FALSE; fclose(printfile); }else{ printfile=fopen(cfg.printer, "a"); if (printfile) { printing=TRUE; } else { printing=FALSE; fclose(printfile); } } break; case ALT_T: twit = (BOOL)(!twit); break; case ALT_X: if (dowhat == MAINMENU || dowhat == SYSOPMENU) { oldDowhat = dowhat; if (loggedIn) { i = getYesNo("Exit to MS-DOS", 0); } else { doCR(); doCR(); mPrintf("Exit to MS-DOS"); doCR(); i = TRUE; } dowhat = oldDowhat; if (!i) { if (dowhat == MAINMENU) { givePrompt(); }else{ doCR(); mPrintf("2Privileged function:0 "); } break; } ExitToMsdos = TRUE; } break; default: break; } update25(); }
void TERMWINDOWMEMBER GiveRoomPrompt(Bool JustDisplayedEvent) { static int roomCounter; label rn, gn, np, ex, hn; char rd[81]; char tm[128], dt[128]; int i; CommPort->FlushInput(); OC.User.Reset(); OC.Echo = BOTH; OC.setio(); OC.ansiattr = cfg.attr; doEvent(EVT_ROOMPROMPT); if (CurrentUser->IsYouAreHere()) { youAreHere(); } #ifdef WINCIT // if (!PendingSystemEvents) // { OC.SetOutFlag(PendingSystemEvents ? NOSTOP : IMPERVIOUS); // } // if (IdlePrompt) // { // return; // } if (!(CurrentUser->IsErasePrompt() && JustDisplayedEvent)) { doCR(); } if (JustDisplayedEvent) { numLines = 0; } #endif OC.Formatting = FALSE; roomCounter++; RoomTab[thisRoom].GetName(rn, sizeof(rn)); *gn = 0; if (RoomTab[thisRoom].IsGroupOnly()) { if (RoomTab[thisRoom].IsBooleanGroup()) { CopyStringToBuffer(gn, getmsg(471)); } else { GroupData[RoomTab[thisRoom].GetGroupNumber()].GetName(gn, sizeof(gn)); } } *np = 0; if (RoomTab[thisRoom].IsShared()) { label Buffer; CopyStringToBuffer(np, loggedIn ? CurrentUser->GetNetPrefix(Buffer, sizeof(Buffer)) : cfg.netPrefix); } *ex = 0; i = 0; if (RoomTab[thisRoom].IsMsDOSdir()) { if (CurrentUser->IsIBMRoom() && TermCap->IsIBMExtended()) { ex[i++] = roomCounter == 6969 ? '\xcc' : '\xb9'; } else { ex[i++] = roomCounter == 6969 ? '[' : ']'; } } if (RoomTab[thisRoom].IsGroupOnly()) { if (CurrentUser->IsIBMRoom() && TermCap->IsIBMExtended()) { ex[i++] = roomCounter == 6969 ? '\xba' : '\xb3'; } else { ex[i++] = roomCounter == 6969 ? ';' : ':'; } } if (RoomTab[thisRoom].IsHidden()) { ex[i++] = roomCounter == 6969 ? '(' : ')'; } if (RoomTab[thisRoom].IsBIO()) { ex[i++] = roomCounter == 6969 ? '{' : '}'; } else if (!RoomTab[thisRoom].IsGroupOnly() && !RoomTab[thisRoom].IsMsDOSdir() && !RoomTab[thisRoom].IsHidden()) { if (!(iswindow(thisRoom) && CurrentUser->IsIBMRoom() && TermCap->IsIBMExtended())) { ex[i++] = roomCounter == 6969 ? '<' : '>'; } } if (iswindow(thisRoom)) { if (CurrentUser->IsIBMRoom() && TermCap->IsIBMExtended()) { ex[i++] = roomCounter == 6969 ? '\xae' : '\xaf'; } else { ex[i++] = roomCounter == 6969 ? '<' : '>'; } } ex[i] = 0; HallData[thisHall].GetName(hn, sizeof(hn)); CurrentRoom->GetInfoLine(rd, sizeof(rd)); char Buffer[64]; strftime(tm, 127, (loggedIn) ? special_deansi(CurrentUser->GetDateStamp(Buffer, sizeof(Buffer)), TERM_TIME) : special_deansi(cfg.datestamp, TERM_TIME), 0l); strftime(dt, 127, (loggedIn) ? special_deansi(CurrentUser->GetVerboseDateStamp(Buffer, sizeof(Buffer)), TERM_DATE) : special_deansi(cfg.vdatestamp, TERM_DATE), 0l); Andy(loggedIn ? CurrentUser->GetPromptFormat(Buffer, sizeof(Buffer)) : cfg.prompt, getmsg(638), rn, gn, np, ex, hn, rd, tm, dt); OC.Formatting = TRUE; ansi(14); OC.MCI_goto = FALSE; termCap(TERM_NORMAL); mPrintf(spc); CursorIsAtPrompt = TRUE; OC.SetOutFlag(OUTOK); if (roomCounter == 6969) { roomCounter = 0; } }
Bool OutputControl::CheckInput(Bool Pause) #endif { if (User.Continuous) { Pause = FALSE; } if (User.ControlD) { tw()KBReady(); // for screenblanker SetOutFlag(OUTSKIP); // Auto-Stop everything return (TRUE); } // Cannot abort IMPERVIOUS if (User.GetOutFlag() == IMPERVIOUS) { tw()KBReady(); // for screenblanker return (FALSE); } // Carrier loss and not on Console if (!tw()HaveConnectionToUser()) { SetOutFlag(OUTSKIP); return (TRUE); } Bool toReturn = FALSE; // Check for keypress if (tw()BBSCharReady() || Pause) { int c; if (!Pause) { c = toupper(tw()iCharNE()); } if (Pause || c == 'P' || c == 19) // P or ^S (XOFF) - Pause { if (Pause) { char Buffer[80]; tw()CurrentUser->GetMorePrompt(Buffer, sizeof(Buffer)); if (!tw()outSpeech(TRUE, tw()loggedIn ? Buffer : cfg.moreprompt)) { tw()putWord((uchar *) (tw()loggedIn ? Buffer : cfg.moreprompt)); } } do { // wait to resume c = toupper(tw()iCharNE()); } while (!tw()CurrentUser->IsPUnPauses() && (c == 'P' || c == 19)); if (Pause) { char Buffer[80]; int i, backspace = strlen(tw()loggedIn ? tw()CurrentUser->GetMorePrompt(Buffer, sizeof(Buffer)) : cfg.moreprompt); for (i = 0; i < backspace; i++) { tw()doBS(); } } } if (User.GetOutFlag() == NOSTOP) { return (FALSE); } const Bool WasFormatting = Formatting; Formatting = TRUE; switch (c) { case CTRL_D: { User.ControlD = TRUE; SetOutFlag(OUTSKIP); toReturn = TRUE; break; } case '9': { if (tw()hitSix) { tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(69))) { tw()putWord((uchar *) getmsg(69)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); } break; } case 'J': // jump paragraph { tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(547))) { tw()putWord((uchar *) getmsg(547)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); SetOutFlag(OUTPARAGRAPH); break; } case 'K': // kill { if (User.CanK) { tw()MRO.DotoMessage = PULL_IT; tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(546))) { tw()putWord((uchar *) getmsg(546)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); SetOutFlag(OUTNEXT); toReturn = TRUE; } break; } case 'M': // mark { if (User.CanM) { tw()MRO.DotoMessage = MARK_IT; tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(543))) { tw()putWord((uchar *) getmsg(543)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); SetOutFlag(OUTNEXT); toReturn = TRUE; } break; } case '*': // censor { if (User.CanStar) { tw()MRO.DotoMessage = CENSOR_IT; tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(538))) { tw()putWord((uchar *) getmsg(538)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); SetOutFlag(OUTNEXT); toReturn = TRUE; } break; } case 'N': // next { tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(537))) { tw()putWord((uchar *) getmsg(537)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); SetOutFlag(OUTNEXT); toReturn = TRUE; break; } case 'S': // stop { tw()numLines = 0; // Don't pause for stop! tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(528))) { tw()putWord((uchar *) getmsg(528)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); SetOutFlag(OUTSKIP); toReturn = TRUE; break; } case 'C': // continuous { tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!User.Continuous) { if (!tw()outSpeech(TRUE, getmsg(527))) { tw()putWord((uchar *) getmsg(527)); } } else { if (!tw()outSpeech(TRUE, getmsg(526))) { tw()putWord((uchar *) getmsg(526)); } } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); User.Continuous = !User.Continuous; tw()doCR(); break; } case 'R': { if (User.CanR) { tw()MRO.DotoMessage = REVERSE_READ; SetOutFlag(OUTNEXT); } break; } case 'V': { tw()MRO.Verbose = !tw()MRO.Verbose; tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (tw()MRO.Verbose) { if (!tw()outSpeech(TRUE, getmsg(524))) { tw()putWord((uchar *) getmsg(524)); } } else { if (!tw()outSpeech(TRUE, getmsg(519))) { tw()putWord((uchar *) getmsg(519)); } } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); break; } case '!': { if (User.CanBang) { tw()MRO.Headerscan = !tw()MRO.Headerscan; tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (tw()MRO.Headerscan) { if (!tw()outSpeech(TRUE, getmsg(517))) { tw()putWord((uchar *) getmsg(517)); } } else { if (!tw()outSpeech(TRUE, getmsg(511))) { tw()putWord((uchar *) getmsg(511)); } } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); } break; } case '@': { if (User.CanAt) { tw()MRO.DotoMessage = REPLY; tw()doCR(); tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(327)); tw()termCap(TERM_BOLD); if (!tw()outSpeech(TRUE, getmsg(470))) { tw()putWord((uchar *) getmsg(470)); } tw()termCap(TERM_NORMAL); tw()putWord((const uchar *) getmsg(326)); tw()doCR(); } break; } } Formatting = WasFormatting; if (c == '6') { tw()hitSix = TRUE; } else { tw()hitSix = FALSE; } } return (toReturn); }