Code cleanup

This commit is contained in:
Michiel Broek 2005-08-20 12:27:08 +00:00
parent 603713f9cc
commit 2514a3ea85
11 changed files with 77 additions and 79 deletions

View File

@ -28,6 +28,9 @@ v0.71.5 18-Aug-2005
mbout:
Code cleanup.
mbsebbs:
Code cleanup.
v0.71.4 12-Aug-2005 - 18-Aug-2005

View File

@ -73,16 +73,16 @@ int Chg_Language(int NewMode)
PUTSTR(temp);
iLang = 6;
colour(9,0);
colour(LIGHTBLUE, BLACK);
while (fread(&lang, langhdr.recsize, 1, pLang) == 1)
if (lang.Available) {
colour(13, 0);
colour(LIGHTMAGENTA, BLACK);
sprintf(temp, "(%s)", lang.LangKey);
PUTSTR(temp);
colour(8,0);
colour(DARKGRAY, BLACK);
sprintf(temp, " %c ", 46);
PUTSTR(temp);
colour(3,0);
colour(CYAN, BLACK);
sprintf(temp, "%-29s ", lang.Name);
PUTSTR(temp);
@ -120,7 +120,7 @@ int Chg_Language(int NewMode)
if(!iFoundLang) {
Enter(2);
/* Invalid selection, please try again! */
pout(10, 0, (char *) Language(265));
pout(LIGHTGREEN, BLACK, (char *) Language(265));
Enter(2);
} else {
exitinfo.iLanguage = iLang;
@ -128,7 +128,7 @@ int Chg_Language(int NewMode)
Free_Language();
InitLanguage();
colour(10, 0);
colour(LIGHTGREEN, BLACK);
/* Language now set to" */
sprintf(temp, "\r\n\r\n%s%s\r\n\r\n", (char *) Language(380), lang.Name);
PUTSTR(temp);
@ -161,7 +161,7 @@ void Chg_Password()
Enter(1);
/* Old password: */
language(15, 0, 120);
language(WHITE, BLACK, 120);
colour(CFG.InputColourF, CFG.InputColourB);
Getpass(temp1);
@ -169,25 +169,25 @@ void Chg_Password()
while (TRUE) {
Enter(1);
/* New password: */
language(9, 0, 121);
language(LIGHTBLUE, BLACK, 121);
colour(CFG.InputColourF, CFG.InputColourB);
Getpass(temp1);
if((strlen(temp1)) >= CFG.password_length) {
Enter(1);
/* Confirm new password: */
language(9, 0, 122);
language(LIGHTBLUE, BLACK, 122);
colour(CFG.InputColourF, CFG.InputColourB);
Getpass(temp2);
if(( strcmp(temp1,temp2)) != 0) {
/* Passwords do not match! */
Enter(2);
language(12, 0, 123);
language(LIGHTRED, BLACK, 123);
Enter(1);
} else {
break;
}
} else {
colour(12, 0);
colour(LIGHTRED, BLACK);
/* Your password must contain at least %d characters! Try again.*/
sprintf(temp2, "\r\n%s%d %s\r\n\r\n", (char *) Language(42), CFG.password_length, (char *) Language(43));
PUTSTR(temp2);
@ -211,14 +211,14 @@ void Chg_Password()
exitinfo.tLastPwdChange = time(NULL);
Enter(1);
/* Password Change Successful */
language(10, 0, 124);
language(LIGHTGREEN, BLACK, 124);
Syslog('+', "User changed his password");
WriteExitinfo();
}
} else {
Enter(1);
/* Old password incorrect! */
language(12, 0, 125);
language(LIGHTRED, BLACK, 125);
}
free(temp1);
@ -277,7 +277,7 @@ void Chg_Handle()
while (TRUE) {
Enter(1);
/* Enter a handle (Enter to Quit): */
pout(9, 0, (char *) Language(412));
pout(LIGHTBLUE, BLACK, (char *) Language(412));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(temp, 34);
@ -289,14 +289,14 @@ void Chg_Handle()
strcpy(Handle, tlcap(temp));
if (CheckHandle(Handle) || CheckUnixNames(Handle)) {
pout(12, 0, (char *)"\r\nThat handle is already been used\r\n");
pout(LIGHTRED, BLACK, (char *)"\r\nThat handle is already been used\r\n");
} else if (CheckName(Handle)) {
pout(12, 0, (char *)"\r\nThat name is already been used\r\n");
pout(LIGHTRED, BLACK, (char *)"\r\nThat name is already been used\r\n");
} else if((strcasecmp(Handle, "sysop")) == 0) {
pout(12, 0, (char *)"\r\nYou cannot use Sysop as a handle\r\n");
pout(LIGHTRED, BLACK, (char *)"\r\nYou cannot use Sysop as a handle\r\n");
} else if(strcmp(temp, "") != 0) {
Setup(exitinfo.sHandle, temp);
pout(10, 0, (char *)"\r\nHandle Changed!\r\n\r\n");
pout(LIGHTGREEN, BLACK, (char *)"\r\nHandle Changed!\r\n\r\n");
Syslog('+', "New handle \"%s\"", exitinfo.sHandle);
break;
}
@ -320,11 +320,11 @@ void Chg_Hotkeys()
if (exitinfo.HotKeys) {
exitinfo.HotKeys = FALSE;
/* Hotkeys are now OFF */
pout(10, 0, (char *) Language(146));
pout(LIGHTGREEN, BLACK, (char *) Language(146));
} else {
exitinfo.HotKeys = TRUE;
/* Hotkeys are now ON */
pout(10, 0, (char *) Language(145));
pout(LIGHTGREEN, BLACK, (char *) Language(145));
}
Enter(2);
@ -346,11 +346,11 @@ void Chg_MailCheck()
if (exitinfo.MailScan) {
exitinfo.MailScan = FALSE;
/* New Mail check is now OFF */
pout(10, 0, (char *) Language(367));
pout(LIGHTGREEN, BLACK, (char *) Language(367));
} else {
exitinfo.MailScan = TRUE;
/* New Mail check is now ON */
pout(10, 0, (char *) Language(366));
pout(LIGHTGREEN, BLACK, (char *) Language(366));
}
Enter(2);
@ -372,11 +372,11 @@ void Chg_FileCheck()
if (exitinfo.ieFILE) {
exitinfo.ieFILE = FALSE;
/* New Files check is now OFF */
pout(10, 0, (char *) Language(371));
pout(LIGHTGREEN, BLACK, (char *) Language(371));
} else {
exitinfo.ieFILE = TRUE;
/* New Files check is now ON */
pout(10, 0, (char *) Language(370));
pout(LIGHTGREEN, BLACK, (char *) Language(370));
}
Enter(2);
@ -457,11 +457,11 @@ void Chg_FsMsgedKeys()
if (exitinfo.FSemacs) {
exitinfo.FSemacs = FALSE;
/* Fullscreen Editor shortcut keys set to Wordstar */
pout(10, 0, (char *) Language(473));
pout(LIGHTGREEN, BLACK, (char *) Language(473));
} else {
exitinfo.FSemacs = TRUE;
/* Fullscreen Editor shortcut keys set to Emacs */
pout(10, 0, (char *) Language(472));
pout(LIGHTGREEN, BLACK, (char *) Language(472));
}
Enter(2);
sleep(2);
@ -482,11 +482,11 @@ void Chg_Disturb()
if(exitinfo.DoNotDisturb) {
exitinfo.DoNotDisturb = FALSE;
/* Do not disturb turned OFF */
pout(10, 0, (char *) Language(416));
pout(LIGHTGREEN, BLACK, (char *) Language(416));
} else {
exitinfo.DoNotDisturb = TRUE;
/* Do not disturb turned ON */
pout(10, 0, (char *) Language(417));
pout(LIGHTGREEN, BLACK, (char *) Language(417));
}
Enter(2);
@ -509,11 +509,11 @@ void Chg_Location()
/* Old Location: */
Enter(1);
/* Old location: */
pout(15, 0, (char *) Language(73));
pout(WHITE, BLACK, (char *) Language(73));
pout(9, 0, exitinfo.sLocation);
Enter(2);
/* Please enter your location: */
pout(14, 0, (char *) Language(49));
pout(YELLOW, BLACK, (char *) Language(49));
colour(CFG.InputColourF, CFG.InputColourB);
if (CFG.iCapLocation) {
@ -528,7 +528,7 @@ void Chg_Location()
if(( strlen(temp)) < CFG.CityLen) {
Enter(1);
/* Please enter a longer location (min */
colour(12, 0);
colour(LIGHTRED, BLACK);
sprintf(temp, "%s%d)", (char *) Language(74), CFG.CityLen);
PUTSTR(temp);
Enter(1);
@ -608,11 +608,11 @@ void Chg_Graphics()
if (exitinfo.GraphMode) {
exitinfo.GraphMode = FALSE;
/* Ansi Mode turned OFF */
pout(15, 0, (char *) Language(76));
pout(WHITE, BLACK, (char *) Language(76));
} else {
exitinfo.GraphMode = TRUE;
/* Ansi Mode turned ON */
pout(15, 0, (char *) Language(75));
pout(WHITE, BLACK, (char *) Language(75));
}
Syslog('+', "Graphics mode now %s", exitinfo.GraphMode?"On":"Off");
@ -634,16 +634,16 @@ void Chg_VoicePhone()
while (TRUE) {
Enter(1);
/* Please enter you Voice Number */
pout(10, 0, (char *) Language(45));
pout(LIGHTGREEN, BLACK, (char *) Language(45));
Enter(1);
pout(10, 0, (char *)": ");
pout(LIGHTGREEN, BLACK, (char *)": ");
colour(CFG.InputColourF, CFG.InputColourB);
GetPhone(temp, 16);
if (strlen(temp) < 6) {
Enter(1);
/* Please enter a proper phone number */
pout(12, 0, (char *) Language(47));
pout(LIGHTRED, BLACK, (char *) Language(47));
Enter(1);
} else {
strcpy(exitinfo.sVoicePhone, temp);
@ -667,16 +667,16 @@ void Chg_DataPhone()
while (1) {
Enter(1);
/* Please enter you Data Number */
pout(10, 0, (char *) Language(48));
pout(LIGHTGREEN, BLACK, (char *) Language(48));
Enter(1);
pout(10, 0, (char *)": ");
pout(LIGHTGREEN, BLACK, (char *)": ");
colour(CFG.InputColourF, CFG.InputColourB);
GetPhone(temp, 16);
if( strlen(temp) < 6) {
Enter(1);
/* Please enter a proper phone number */
pout(12, 0, (char *) Language(47));
pout(LIGHTRED, BLACK, (char *) Language(47));
Enter(1);
} else {
strcpy(exitinfo.sDataPhone, temp);
@ -698,11 +698,11 @@ void Chg_News()
if (exitinfo.ieNEWS) {
exitinfo.ieNEWS = FALSE;
/* News bulletins turned OFF */
pout(10, 0, (char *) Language(79));
pout(LIGHTGREEN, BLACK, (char *) Language(79));
} else {
exitinfo.ieNEWS = TRUE;
/* News bulletins turned ON */
pout(10, 0, (char *) Language(78));
pout(LIGHTGREEN, BLACK, (char *) Language(78));
}
Enter(2);
@ -723,7 +723,7 @@ void Chg_ScreenLen()
Enter(1);
/* Please enter your Screen Length? [24]: */
pout(13, 0, (char *) Language(64));
pout(LIGHTMAGENTA, BLACK, (char *) Language(64));
colour(CFG.InputColourF, CFG.InputColourB);
Getnum(temp, 2);
@ -768,7 +768,7 @@ int Test_DOB(char *DOB)
if (strlen(DOB) != 10) {
Syslog('!', "Date format length %d characters", strlen(DOB));
/* Please enter the correct date format */
language(14, 0, 83);
language(YELLOW, BLACK, 83);
return FALSE;
}
@ -822,7 +822,7 @@ void Chg_DOB()
while (TRUE) {
Enter(1);
/* Please enter your Date of Birth DD-MM-YYYY: */
pout(3, 0, (char *) Language(56));
pout(CYAN, BLACK, (char *) Language(56));
colour(CFG.InputColourF, CFG.InputColourB);
GetDate(temp, 10);
if (Test_DOB(temp)) {
@ -916,14 +916,14 @@ void Chg_Protocol()
} else {
if (!iFoundProt) {
Enter(2);
pout(10, 0, (char *) Language(265));
pout(LIGHTGREEN, BLACK, (char *) Language(265));
Enter(2);
/* Loop for new attempt */
} else {
Setup(exitinfo.sProtocol, sProtName);
Enter(1);
/* Protocol now set to: */
pout(10, 0, (char *) Language(266));
pout(LIGHTGREEN, BLACK, (char *) Language(266));
PUTSTR(sProtName);
Enter(2);
Pause();

View File

@ -340,7 +340,7 @@ int DisplayFileEnter(char *File)
rc = DisplayFile(File);
Enter(1);
/* Press ENTER to continue */
language(13, 0, 436);
language(LIGHTMAGENTA, BLACK, 436);
alarm_on();
Readkey();
return rc;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Run external door
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -153,7 +153,7 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu
if ((strstr(Program, "/A")) != NULL) {
Enter(1);
colour(3, 0);
colour(CYAN, BLACK);
if ((String = strstr(Program, "/T=")) != NULL) {
String1 = String + 3;
PUTSTR(String1);

View File

@ -94,19 +94,19 @@ void ShowEmailHdr(void)
clear();
sprintf(temp, " %-70s", sMailbox);
pout(1, 7, temp);
pout(BLUE, LIGHTGRAY, temp);
sprintf(temp, "#%-5lu", Msg.Id);
pout(4, 7, temp);
pout(RED, LIGHTGRAY, temp);
Enter(1);
/* Date : */
pout(14, 0, (char *) Language(206));
pout(YELLOW, BLACK, (char *) Language(206));
tm = gmtime(&Msg.Written);
sprintf(temp, "%02d-%02d-%d %02d:%02d:%02d", tm->tm_mday, tm->tm_mon+1,
tm->tm_year+1900, tm->tm_hour, tm->tm_min, tm->tm_sec);
pout(10, 0, temp);
colour(12, 0);
pout(LIGHTGREEN, BLACK, temp);
colour(LIGHTRED, BLACK);
if (Msg.Local) PUTSTR((char *)" Local");
if (Msg.Intransit) PUTSTR((char *)" Transit");
if (Msg.Private) PUTSTR((char *)" Priv.");
@ -141,18 +141,18 @@ void ShowEmailHdr(void)
Enter(1);
/* From : */
pout(14,0, (char *) Language(209));
pout(10, 0, Msg.From);
pout(YELLOW, BLACK, (char *) Language(209));
pout(LIGHTGREEN, BLACK, Msg.From);
Enter(1);
/* To : */
pout(14,0, (char *) Language(208));
pout(10, 0, Msg.To);
pout(YELLOW, BLACK, (char *) Language(208));
pout(LIGHTGREEN, BLACK, Msg.To);
Enter(1);
/* Subject : */
pout(14,0, (char *) Language(210));
pout(10, 0, Msg.Subject);
pout(YELLOW, BLACK, (char *) Language(210));
pout(LIGHTGREEN, BLACK, Msg.Subject);
Enter(1);
if (Msg.Reply)
@ -161,7 +161,7 @@ void ShowEmailHdr(void)
sprintf(Buf2, " \"-\" %s %lu", (char *)Language(212), Msg.Original);
sprintf(Buf3, "%s%s ", Buf1, Buf2);
sprintf(temp, "%78s ", Buf3);
pout(14, 1, temp);
pout(YELLOW, BLUE, temp);
Enter(1);
}
@ -584,7 +584,7 @@ int EmailPanel(void)
}
} else {
/* Next */
pout(15, 0, (char *) Language(216));
pout(WHITE, BLACK, (char *) Language(216));
if (LastNum < EmailBase.Highest)
LastNum++;
else
@ -835,7 +835,7 @@ void Write_Email(void)
Msg_New();
Enter(1);
colour(9, 0);
colour(LIGHTBLUE, BLACK);
/* Posting message in area: */
pout(LIGHTBLUE, BLACK, (char *) Language(156));
PUTSTR((char *)"\"mailbox\"");
@ -1014,9 +1014,9 @@ void Choose_Mailbox(char *Option)
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(231));
Enter(2);
pout(15, 0, (char *)" 1"); pout(9, 0, (char *)" . "); pout(3, 0, (char *) Language(467)); Enter(1);
pout(15, 0, (char *)" 2"); pout(9, 0, (char *)" . "); pout(3, 0, (char *) Language(468)); Enter(1);
pout(15, 0, (char *)" 3"); pout(9, 0, (char *)" . "); pout(3, 0, (char *) Language(469)); Enter(1);
pout(WHITE, BLACK, (char *)" 1"); pout(LIGHTBLUE, BLACK, (char *)" . "); pout(CYAN, BLACK, (char *) Language(467)); Enter(1);
pout(WHITE, BLACK, (char *)" 2"); pout(LIGHTBLUE, BLACK, (char *)" . "); pout(CYAN, BLACK, (char *) Language(468)); Enter(1);
pout(WHITE, BLACK, (char *)" 3"); pout(LIGHTBLUE, BLACK, (char *)" . "); pout(CYAN, BLACK, (char *) Language(469)); Enter(1);
pout(CFG.MoreF, CFG.MoreB, (char *) Language(470));
colour(CFG.InputColourF, CFG.InputColourB);

View File

@ -4,7 +4,7 @@
* Purpose ...............: All the file functions.
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -1118,7 +1118,7 @@ void Delete_Home()
Enter(1);
/* Please enter filename to delete: */
pout(9, 0, (char *) Language(292));
pout(LIGHTBLUE, BLACK, (char *) Language(292));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(temp1, 80);
@ -1131,7 +1131,7 @@ void Delete_Home()
if (temp1[0] == '.') {
Enter(1);
/* Sorry you may not delete hidden files ...*/
pout(12, 0, (char *) Language(293));
pout(LIGHTRED, BLACK, (char *) Language(293));
} else {
strcat(temp, temp1);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Input functions, also for some utils.
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -52,7 +52,6 @@ int Waitchar(unsigned char *ch, int wtime)
rc = GETCHAR(0);
if (tty_status == STAT_SUCCESS) {
*ch = (unsigned char)rc;
// memcpy(ch, &rc, sizeof(unsigned char)); /* doesn't work on bigendian machines */
return 1;
}
if (tty_status != STAT_TIMEOUT) {

View File

@ -4,7 +4,7 @@
* Purpose ...............: Display and handle the menus.
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -685,7 +685,7 @@ void DoMenu(int Type)
default:
Enter(1);
pout(15, 0, (char *) Language(339));
pout(WHITE, BLACK, (char *) Language(339));
Enter(2);
Syslog('?', "Option: %s -> Unknown Menu Type: %d on %s", menus.MenuKey, Type, Menus[MenuLevel]);
Pause();

View File

@ -4,7 +4,7 @@
* Purpose ...............: Misc functions
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -123,7 +123,6 @@ void DisplayLogo()
WriteError("$DisplayLogo: Can't open %s", temp);
else {
while (Fgets(sString, 1023, pLogo) != NULL) {
// Striplf(sString);
PUTSTR(sString);
Enter(1);
}

View File

@ -315,8 +315,6 @@ int zrdata(register char *buf, int length)
register char *end;
register int d;
Syslog('Z', "zrdata: len=%d, Crc32r=%s", length, Crc32r ? "true":"false");
if (Crc32r)
return zrdat32(buf, length);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Zmodem sender
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -522,7 +522,6 @@ to:
Txwcnt = 0; e = ZCRCQ;
} else
e = ZCRCG;
Syslog('Z', "%7ld ZMODEM%s ", Txpos, Crc32t?" CRC-32":"");
Nopper();
alarm_on();
zsdata(txbuf, n, e);