Code cleanup

This commit is contained in:
Michiel Broek 2005-08-19 20:48:54 +00:00
parent ccc8390ad3
commit 9e51c6dba7
29 changed files with 448 additions and 459 deletions

View File

@ -4,6 +4,7 @@ v0.71.5 18-Aug-2005
mbfido: mbfido:
Removed debug logging for solved crash. Removed debug logging for solved crash.
Code cleanup.
mbdiff: mbdiff:
Code cleanup. Code cleanup.
@ -17,6 +18,15 @@ v0.71.5 18-Aug-2005
mbuser: mbuser:
Code cleanup. Code cleanup.
mbfile:
Code cleanup.
mbmsg:
Code cleanup and removed dead code.
mbout:
Code cleanup.
v0.71.4 12-Aug-2005 - 18-Aug-2005 v0.71.4 12-Aug-2005 - 18-Aug-2005

View File

@ -4,7 +4,7 @@
* Purpose ...............: Global message base functions * Purpose ...............: Global message base functions
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -389,9 +389,9 @@ int Msg_Link(char *Path, int do_quiet, int slow_util)
} }
if (!do_quiet) { if (!do_quiet) {
msg_colour(12, 0); msg_colour(LIGHTRED, BLACK);
printf(" (linking)"); printf(" (linking)");
msg_colour(13, 0); msg_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: ReArc an archive. * Purpose ...............: ReArc an archive.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -44,7 +44,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
Syslog('f', "rearc(%s, %s)", filename, arctype); Syslog('f', "rearc(%s, %s)", filename, arctype);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(12, 0); mbse_colour(LIGHTRED, BLACK);
printf(" ReArc file %s ", filename); printf(" ReArc file %s ", filename);
fflush(stdout); fflush(stdout);
} }
@ -145,7 +145,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
} }
if (!do_quiet) { if (!do_quiet) {
mbse_colour(11, 0); mbse_colour(LIGHTCYAN, BLACK);
printf("\rUnpacking file %s ", filename); printf("\rUnpacking file %s ", filename);
fflush(stdout); fflush(stdout);
} }
@ -165,7 +165,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
} }
if (!do_quiet) { if (!do_quiet) {
mbse_colour(10, 0); mbse_colour(LIGHTGREEN, BLACK);
printf("\r Packing file %s ", newname); printf("\r Packing file %s ", newname);
} }

View File

@ -4,7 +4,7 @@
* Purpose: MBSE BBS Outbound Manager * Purpose: MBSE BBS Outbound Manager
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -56,13 +56,13 @@ time_t t_end; /* End time */
void ProgName(void); void ProgName(void);
void ProgName() void ProgName()
{ {
if (do_quiet) if (do_quiet)
return; return;
mbse_colour(15, 0); mbse_colour(WHITE, BLACK);
printf("\nMBOUT: MBSE BBS %s Outbound Manager\n", VERSION); printf("\nMBOUT: MBSE BBS %s Outbound Manager\n", VERSION);
mbse_colour(14, 0); mbse_colour(YELLOW, BLACK);
printf(" %s\n", COPYRIGHT); printf(" %s\n", COPYRIGHT);
} }
@ -97,7 +97,7 @@ void die(int onsig)
do_quiet = FALSE; do_quiet = FALSE;
if (!do_quiet) if (!do_quiet)
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
if (onsig) { if (onsig) {
if (onsig <= NSIG) if (onsig <= NSIG)
@ -110,7 +110,7 @@ void die(int onsig)
Syslog(' ', "MBOUT finished in %s", t_elapsed(t_start, t_end)); Syslog(' ', "MBOUT finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) { if (!do_quiet) {
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
printf("\n"); printf("\n");
} }
ExitClient(onsig); ExitClient(onsig);
@ -121,30 +121,30 @@ void die(int onsig)
void Help(void); void Help(void);
void Help() void Help()
{ {
do_quiet = FALSE; do_quiet = FALSE;
ProgName(); ProgName();
mbse_colour(11, 0); mbse_colour(LIGHTCYAN, BLACK);
printf("\nUsage: mbout [command] <params> <options>\n\n"); printf("\nUsage: mbout [command] <params> <options>\n\n");
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf(" Commands are:\n\n"); printf(" Commands are:\n\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf(" a att <node> <flavor> <file> Attach a file to a node\n"); printf(" a att <node> <flavor> <file> Attach a file to a node\n");
printf(" n node <node> Show nodelist information\n"); printf(" n node <node> Show nodelist information\n");
printf(" p poll <node> [node..node] Poll node(s) (always crash)\n"); printf(" p poll <node> [node..node] Poll node(s) (always crash)\n");
printf(" req req <node> <file> [file..file] Request file(s) from node\n"); printf(" req req <node> <file> [file..file] Request file(s) from node\n");
printf(" res reset <node> [node..node] Reset node(s) \"try\" counter\n"); printf(" res reset <node> [node..node] Reset node(s) \"try\" counter\n");
printf(" sta stat Show outbound status\n"); printf(" sta stat Show outbound status\n");
printf(" sto stop <node> [node..node] Stop polling node(s)\n"); printf(" sto stop <node> [node..node] Stop polling node(s)\n");
printf("\n"); printf("\n");
printf(" <node> Should be in domain form, e.g. f16.n2801.z2.domain\n"); printf(" <node> Should be in domain form, e.g. f16.n2801.z2.domain\n");
printf(" <flavor> Flavor's are: crash | immediate | normal | hold\n"); printf(" <flavor> Flavor's are: crash | immediate | normal | hold\n");
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("\n Options are:\n\n"); printf("\n Options are:\n\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf(" -quiet Quiet mode\n"); printf(" -quiet Quiet mode\n");
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
die(MBERR_OK); die(MBERR_OK);
} }
@ -154,7 +154,7 @@ void Fatal(char *msg, int error)
{ {
show_log = TRUE; show_log = TRUE;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(12, 0); mbse_colour(LIGHTRED, BLACK);
printf("%s\n", msg); printf("%s\n", msg);
} }
WriteError(msg); WriteError(msg);
@ -234,7 +234,7 @@ int main(int argc, char *argv[])
free(cmd); free(cmd);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\n"); printf("\n");
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Outbound Manager - show node info * Purpose ...............: MBSE BBS Outbound Manager - show node info
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -50,7 +50,7 @@ int nlinfo(faddr *addr)
nlent = getnlent(addr); nlent = getnlent(addr);
if (nlent->pflag != NL_DUMMY) { if (nlent->pflag != NL_DUMMY) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("System : %s\n", nlent->name); printf("System : %s\n", nlent->name);
printf("Sysop : %s@%s\n", nlent->sysop, ascinode(addr, 0x3f)); printf("Sysop : %s@%s\n", nlent->sysop, ascinode(addr, 0x3f));
printf("Location : %s\n", nlent->location); printf("Location : %s\n", nlent->location);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Show mail outbound status * Purpose ...............: Show mail outbound status
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -151,7 +151,7 @@ int outstat()
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/nodes.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/nodes.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r")) == NULL) { if ((fp = fopen(temp, "r")) == NULL) {
WriteError("Error open %s, aborting", temp); WriteError("$Error open %s, aborting", temp);
free(temp); free(temp);
return MBERR_OUTBOUND_SCAN; return MBERR_OUTBOUND_SCAN;
} }
@ -282,9 +282,9 @@ int outstat()
} }
if (!do_quiet) { if (!do_quiet) {
mbse_colour(10, 0); mbse_colour(LIGHTGREEN, BLACK);
printf("flavor try size age address\n"); printf("flavor try size age address\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
} }
Syslog('+', "Flavor Try Size Age Address"); Syslog('+', "Flavor Try Size Age Address");
@ -422,7 +422,7 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
} }
fclose(fp); fclose(fp);
} else } else
WriteError("Can't open %s", fname); WriteError("$Can't open %s", fname);
} else if (isflo == OUT_PKT) { } else if (isflo == OUT_PKT) {
(*tmp)->size += st.st_size; (*tmp)->size += st.st_size;
@ -562,8 +562,6 @@ int freq(faddr *addr, char *fname)
char *req; char *req;
FILE *fp; FILE *fp;
Syslog('o', "Freq %s %s", ascfnode(addr, 0x1f), fname);
/* /*
* Append filename to .req file * Append filename to .req file
*/ */

View File

@ -4,7 +4,7 @@
* Purpose ...............: Announce new files and FileFind * Purpose ...............: Announce new files and FileFind
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -67,7 +67,7 @@ void Uploads()
IsDoing("Check uploads"); IsDoing("Check uploads");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf(" Checking uploads...\n"); printf(" Checking uploads...\n");
} }
@ -373,7 +373,7 @@ int Announce()
int i, groups, any; int i, groups, any;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Announce new files\n"); printf("Announce new files\n");
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Announce new files and FileFind * Purpose ...............: Announce new files and FileFind
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -94,11 +94,11 @@ void ScanArea(ff_list **ffl)
unsigned long Number, Highest; unsigned long Number, Highest;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r %-40s", scanmgr.Comment); printf("\r %-40s", scanmgr.Comment);
mbse_colour(12, 0); mbse_colour(LIGHTRED, BLACK);
printf(" (Scanning) "); printf(" (Scanning) ");
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }
Syslog('+', "Scanning %s", scanmgr.Comment); Syslog('+', "Scanning %s", scanmgr.Comment);
@ -267,12 +267,12 @@ void ScanFiles(ff_list *tmp)
Syslog('+', "ff: %s [%s]", temp, tmp->subject); Syslog('+', "ff: %s [%s]", temp, tmp->subject);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
temp[40] = '\0'; temp[40] = '\0';
printf("\r %-40s", temp); printf("\r %-40s", temp);
mbse_colour(12, 0); mbse_colour(LIGHTRED, BLACK);
printf(" (Searching)"); printf(" (Searching)");
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -363,7 +363,7 @@ void ScanFiles(ff_list *tmp)
if (found) { if (found) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(14, 0); mbse_colour(YELLOW, BLACK);
printf(" (Replying)"); printf(" (Replying)");
fflush(stdout); fflush(stdout);
} }
@ -488,7 +488,7 @@ int Filefind()
IsDoing("FileFind"); IsDoing("FileFind");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Processing FileFind requests\n"); printf("Processing FileFind requests\n");
} }
Syslog('+', "Processing FileFind requests"); Syslog('+', "Processing FileFind requests");
@ -520,7 +520,7 @@ int Filefind()
if (Replies) if (Replies)
rc = TRUE; rc = TRUE;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Processed %d requests, created %d replies\n", Requests, Replies); printf("Processed %d requests, created %d replies\n", Requests, Replies);
} }
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Announce new files and FileFind * Purpose ...............: Announce new files and FileFind
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -53,9 +53,9 @@ void ProgName(void)
if (do_quiet) if (do_quiet)
return; return;
mbse_colour(15, 0); mbse_colour(WHITE, BLACK);
printf("\nMBAFF: MBSE BBS %s Announce new files and FileFind\n", VERSION); printf("\nMBAFF: MBSE BBS %s Announce new files and FileFind\n", VERSION);
mbse_colour(14, 0); mbse_colour(YELLOW, BLACK);
printf(" %s\n", COPYRIGHT); printf(" %s\n", COPYRIGHT);
} }
@ -77,7 +77,7 @@ void die(int onsig)
Syslog(' ', "MBAFF finished in %s", t_elapsed(t_start, t_end)); Syslog(' ', "MBAFF finished in %s", t_elapsed(t_start, t_end));
if (!do_quiet) { if (!do_quiet) {
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
printf("\n"); printf("\n");
} }
ExitClient(onsig); ExitClient(onsig);
@ -178,18 +178,18 @@ void Help(void)
do_quiet = FALSE; do_quiet = FALSE;
ProgName(); ProgName();
mbse_colour(11, 0); mbse_colour(LIGHTMAGENTA, BLACK);
printf("\nUsage: mbaff [command] <options>\n\n"); printf("\nUsage: mbaff [command] <options>\n\n");
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf(" Commands are:\n\n"); printf(" Commands are:\n\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf(" a announce Announce new files\n"); printf(" a announce Announce new files\n");
printf(" f filefind FileFind service\n"); printf(" f filefind FileFind service\n");
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("\n Options are:\n\n"); printf("\n Options are:\n\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf(" -q -quiet Quiet mode\n"); printf(" -q -quiet Quiet mode\n");
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
printf("\n"); printf("\n");
die(MBERR_COMMANDLINE); die(MBERR_COMMANDLINE);
} }

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance - Check filebase * Purpose: File Database Maintenance - Check filebase
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -80,7 +80,7 @@ void Check(long AreaNr)
newdir = calloc(PATH_MAX, sizeof(char)); newdir = calloc(PATH_MAX, sizeof(char));
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Checking file database...\n"); printf("Checking file database...\n");
} }

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance - Build index for request processor * Purpose: File Database Maintenance - Build index for request processor
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -328,7 +328,7 @@ void ReqIndex(void)
IsDoing("Index files"); IsDoing("Index files");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Create index files...\n"); printf("Create index files...\n");
} }
@ -513,7 +513,7 @@ void HtmlIndex(char *Lang)
IsDoing("Create html"); IsDoing("Create html");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\rCreate html pages... \n"); printf("\rCreate html pages... \n");
} }

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance, kill or move old files * Purpose: File Database Maintenance, kill or move old files
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -63,7 +63,7 @@ void Kill(void)
IsDoing("Kill files"); IsDoing("Kill files");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Kill/move files...\n"); printf("Kill/move files...\n");
} }

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance - Pack filebase * Purpose: File Database Maintenance - Pack filebase
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -57,7 +57,7 @@ void PackFileBase(void)
IsDoing("Pack filebase"); IsDoing("Pack filebase");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Packing file database...\n"); printf("Packing file database...\n");
} }

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance - ReArc file(s) * Purpose: File Database Maintenance - ReArc file(s)
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -99,7 +99,7 @@ void ReArc(int Area, char *File)
* Success, update the file entry * Success, update the file entry
*/ */
if (!do_quiet) { if (!do_quiet) {
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("\r Update file %s ", temp); printf("\r Update file %s ", temp);
fflush(stdout); fflush(stdout);
} }
@ -197,7 +197,7 @@ void ReArc(int Area, char *File)
break; // stop when something goes wrong break; // stop when something goes wrong
} }
if (!do_quiet) { if (!do_quiet) {
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
printf("\r"); printf("\r");
for (i = 0; i < (strlen(temp) + 20); i++) for (i = 0; i < (strlen(temp) + 20); i++)
printf(" "); printf(" ");

View File

@ -4,7 +4,7 @@
* Purpose: File Database Maintenance - Sort filebase * Purpose: File Database Maintenance - Sort filebase
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -56,7 +56,7 @@ void SortFileBase(int Area)
IsDoing("Sort filebase"); IsDoing("Sort filebase");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
} }
sprintf(sAreas, "%s/etc/fareas.data", getenv("MBSE_ROOT")); sprintf(sAreas, "%s/etc/fareas.data", getenv("MBSE_ROOT"));

View File

@ -4,7 +4,7 @@
* Purpose ...............: Message Base Maintenance * Purpose ...............: Message Base Maintenance
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -40,7 +40,6 @@
int do_pack = FALSE; /* Pack flag */ int do_pack = FALSE; /* Pack flag */
int do_kill = FALSE; /* Kill flag (age and maxmsgs) */ int do_kill = FALSE; /* Kill flag (age and maxmsgs) */
int do_index = FALSE; /* Index flag */
int do_link = FALSE; /* Link messages */ int do_link = FALSE; /* Link messages */
int do_post = FALSE; /* Post a Message */ int do_post = FALSE; /* Post a Message */
extern int do_quiet; /* Quiet flag */ extern int do_quiet; /* Quiet flag */
@ -64,14 +63,14 @@ int oldmask;
*/ */
void ProgName() void ProgName()
{ {
if (do_quiet) if (do_quiet)
return; return;
mbse_colour(15, 0); mbse_colour(WHITE, BLACK);
printf("\nMBMSG: MBSE BBS %s - Message Base Maintenance Utility\n", VERSION); printf("\nMBMSG: MBSE BBS %s - Message Base Maintenance Utility\n", VERSION);
mbse_colour(14, 0); mbse_colour(YELLOW, BLACK);
printf(" %s\n", COPYRIGHT); printf(" %s\n", COPYRIGHT);
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
} }
@ -108,8 +107,6 @@ int main(int argc, char **argv)
cmd = xstrcat(cmd, (char *)" "); cmd = xstrcat(cmd, (char *)" ");
cmd = xstrcat(cmd, argv[i]); cmd = xstrcat(cmd, argv[i]);
if (strncasecmp(argv[i], "i", 1) == 0)
do_index = TRUE;
if (strncasecmp(argv[i], "l", 1) == 0) if (strncasecmp(argv[i], "l", 1) == 0)
do_link = TRUE; do_link = TRUE;
if (strncasecmp(argv[i], "k", 1) == 0) if (strncasecmp(argv[i], "k", 1) == 0)
@ -144,7 +141,7 @@ int main(int argc, char **argv)
do_quiet = TRUE; do_quiet = TRUE;
} }
if (!(do_index || do_link || do_kill || do_pack || do_post)) if (!(do_link || do_kill || do_pack || do_post))
Help(); Help();
ProgName(); ProgName();
@ -159,10 +156,10 @@ int main(int argc, char **argv)
if (!do_quiet) { if (!do_quiet) {
printf("\n"); printf("\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
} }
if (do_index || do_link || do_kill || do_pack) { if (do_link || do_kill || do_pack) {
memset(&MsgBase, 0, sizeof(MsgBase)); memset(&MsgBase, 0, sizeof(MsgBase));
DoMsgBase(); DoMsgBase();
} }
@ -180,239 +177,228 @@ int main(int argc, char **argv)
void Help() void Help()
{ {
do_quiet = FALSE; do_quiet = FALSE;
ProgName(); ProgName();
mbse_colour(12, 0); mbse_colour(LIGHTCYAN, BLACK);
printf("\n Usage: mbmsg [command(s)] <options>\n\n"); printf("\n Usage: mbmsg [command(s)] <options>\n\n");
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf(" Commands are:\n\n"); printf(" Commands are:\n\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
// printf(" i index Create new index files\n"); printf(" l link Link messages by subject\n");
printf(" l link Link messages by subject\n"); printf(" k kill Kill messages (age & count)\n");
printf(" k kill Kill messages (age & count)\n"); printf(" pa pack Pack deleted messages\n");
printf(" pa pack Pack deleted messages\n"); printf(" po post <to> <#> <subj> <file> <flavor> Post file in message area #\n\n");
printf(" po post <to> <#> <subj> <file> <flavor> Post file in message area #\n\n"); mbse_colour(LIGHTBLUE, BLACK);
mbse_colour(9, 0); printf(" Options are:\n\n");
printf(" Options are:\n\n"); mbse_colour(CYAN, BLACK);
mbse_colour(3, 0); printf(" -a -area <#> Process area <#> only\n");
printf(" -a -area <#> Process area <#> only\n"); printf(" -q -quiet Quiet mode\n");
printf(" -q -quiet Quiet mode\n");
printf("\n"); printf("\n");
die(MBERR_COMMANDLINE); die(MBERR_COMMANDLINE);
} }
void die(int onsig) void die(int onsig)
{ {
signal(onsig, SIG_IGN); signal(onsig, SIG_IGN);
if (!do_quiet) { if (!do_quiet) {
printf("\r"); printf("\r");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
} }
if (MsgBase.Locked) if (MsgBase.Locked)
Msg_UnLock(); Msg_UnLock();
if (MsgBase.Open) if (MsgBase.Open)
Msg_Close(); Msg_Close();
if (onsig) { if (onsig) {
if (onsig <= NSIG) if (onsig <= NSIG)
WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]); WriteError("Terminated on signal %d (%s)", onsig, SigName[onsig]);
else else
WriteError("Terminated with error %d", onsig); WriteError("Terminated with error %d", onsig);
} }
if (onsig == SIGSEGV) if (onsig == SIGSEGV)
Syslog('+', "Last msg area %s", msgs.Name); Syslog('+', "Last msg area %s", msgs.Name);
if (are_tot || are_proc || msg_link) if (are_tot || are_proc || msg_link)
Syslog('+', "Areas [%6d] Processed [%6d] Linked [%6d]", are_tot, are_proc, msg_link); Syslog('+', "Areas [%6d] Processed [%6d] Linked [%6d]", are_tot, are_proc, msg_link);
if (msg_tot || msg_del) if (msg_tot || msg_del)
Syslog('+', "Msgs [%6d] Deleted [%6d]", msg_tot, msg_del); Syslog('+', "Msgs [%6d] Deleted [%6d]", msg_tot, msg_del);
t_end = time(NULL); t_end = time(NULL);
Syslog(' ', "MBMSG finished in %s", t_elapsed(t_start, t_end)); Syslog(' ', "MBMSG finished in %s", t_elapsed(t_start, t_end));
umask(oldmask); umask(oldmask);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
printf("\r \n"); printf("\r \n");
} }
ExitClient(onsig); ExitClient(onsig);
} }
void DoMsgBase() void DoMsgBase()
{ {
FILE *pAreas; FILE *pAreas;
char *sAreas, *Name; char *sAreas, *Name;
long arearec; long arearec;
int Del = 0; int Del = 0;
sAreas = calloc(81, sizeof(char)); sAreas = calloc(PATH_MAX, sizeof(char));
Name = calloc(81, sizeof(char )); Name = calloc(PATH_MAX, sizeof(char ));
IsDoing("Msg Maintenance"); IsDoing("Msg Maintenance");
if (do_area) if (do_area)
Syslog('+', "Processing message area %ld", do_area); Syslog('+', "Processing message area %ld", do_area);
else else
Syslog('+', "Processing all message areas"); Syslog('+', "Processing all message areas");
if (do_kill) { if (do_kill) {
Syslog('-', " Total Max. Days/Killed Max. Nr/Killed Area name"); Syslog('-', " Total Max. Days/Killed Max. Nr/Killed Area name");
Syslog('-', "------ ------ ------ ------ ------ ----------------------------------"); Syslog('-', "------ ------ ------ ------ ------ ----------------------------------");
} }
sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT")); sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if(( pAreas = fopen (sAreas, "r")) == NULL) { if(( pAreas = fopen (sAreas, "r")) == NULL) {
WriteError("$Can't open Messages Areas File."); WriteError("$Can't open %s", sAreas);
die(MBERR_INIT_ERROR); die(MBERR_GENERAL);
} }
fread(&msgshdr, sizeof(msgshdr), 1, pAreas); fread(&msgshdr, sizeof(msgshdr), 1, pAreas);
if (do_area) { if (do_area) {
if (fseek(pAreas, (msgshdr.recsize + msgshdr.syssize) * (do_area - 1), SEEK_CUR) == 0) { if (fseek(pAreas, (msgshdr.recsize + msgshdr.syssize) * (do_area - 1), SEEK_CUR) == 0) {
fread(&msgs, msgshdr.recsize, 1, pAreas); fread(&msgs, msgshdr.recsize, 1, pAreas);
if (msgs.Active) { if (msgs.Active) {
if (enoughspace(CFG.freespace) == 0) if (enoughspace(CFG.freespace) == 0)
die(MBERR_DISK_FULL); die(MBERR_DISK_FULL);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", do_area, msgs.Name); printf("\r%5ld .. %-40s", do_area, msgs.Name);
fflush(stdout); fflush(stdout);
}
are_tot++;
mkdirs(msgs.Base, 0770);
if (do_kill)
KillArea(msgs.Base, msgs.Name, msgs.DaysOld, msgs.MaxMsgs, do_area);
if (do_pack || msg_del)
PackArea(msgs.Base, do_area);
if (do_index)
IndexArea(msgs.Base, do_area);
if (do_link)
LinkArea(msgs.Base, do_area);
if (processed)
are_proc++;
}
}
} else {
arearec = 0;
while (fread(&msgs, msgshdr.recsize, 1, pAreas) == 1) {
fseek(pAreas, msgshdr.syssize, SEEK_CUR);
arearec++;
if (msgs.Active) {
if (enoughspace(CFG.freespace) == 0)
die(MBERR_DISK_FULL);
Nopper();
if (!do_quiet) {
mbse_colour(3, 0);
printf("\r%5ld .. %-40s", arearec, msgs.Name);
fflush(stdout);
}
are_tot++;
mkdirs(msgs.Base, 0770);
processed = FALSE;
if (do_kill)
KillArea(msgs.Base, msgs.Name, msgs.DaysOld, msgs.MaxMsgs, arearec);
if (do_pack || (Del != msg_del)) {
PackArea(msgs.Base, arearec);
}
Del = msg_del;
if (do_index)
IndexArea(msgs.Base, arearec);
if (do_link)
LinkArea(msgs.Base, arearec);
if (processed)
are_proc++;
}
} }
are_tot++;
mkdirs(msgs.Base, 0770);
if (do_kill)
KillArea(msgs.Base, msgs.Name, msgs.DaysOld, msgs.MaxMsgs, do_area);
if (do_pack || msg_del)
PackArea(msgs.Base, do_area);
if (do_link)
LinkArea(msgs.Base, do_area);
if (processed)
are_proc++;
}
} }
} else {
arearec = 0;
while (fread(&msgs, msgshdr.recsize, 1, pAreas) == 1) {
fseek(pAreas, msgshdr.syssize, SEEK_CUR);
arearec++;
if (msgs.Active) {
if (enoughspace(CFG.freespace) == 0)
die(MBERR_DISK_FULL);
Nopper();
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", arearec, msgs.Name);
fflush(stdout);
}
are_tot++;
mkdirs(msgs.Base, 0770);
processed = FALSE;
if (do_kill)
KillArea(msgs.Base, msgs.Name, msgs.DaysOld, msgs.MaxMsgs, arearec);
if (do_pack || (Del != msg_del)) {
PackArea(msgs.Base, arearec);
}
Del = msg_del;
if (do_link)
LinkArea(msgs.Base, arearec);
if (processed)
are_proc++;
}
}
}
fclose(pAreas);
if (!do_area) {
sprintf(sAreas, "%s/etc/users.data", getenv("MBSE_ROOT"));
if ((pAreas = fopen (sAreas, "r")) == NULL) {
WriteError("$Can't open %s", sAreas);
die(MBERR_GENERAL);
}
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pAreas);
while (fread(&usrconfig, usrconfighdr.recsize, 1, pAreas) == 1) {
if (usrconfig.Email && strlen(usrconfig.Name)) {
Nopper();
sprintf(Name, "User %s email area: mailbox", usrconfig.Name);
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r .. %-40s", Name);
fflush(stdout);
}
sprintf(sAreas, "%s/%s/mailbox", CFG.bbs_usersdir, usrconfig.Name);
are_tot++;
processed = FALSE;
if (do_kill)
KillArea(sAreas, Name, 0, CFG.defmsgs, 0);
if (do_pack || (Del != msg_del)) {
PackArea(sAreas, 0);
}
Del = msg_del;
if (do_link)
LinkArea(sAreas, 0);
if (processed)
are_proc++;
sprintf(sAreas, "%s/%s/archive", CFG.bbs_usersdir, usrconfig.Name);
sprintf(Name, "User %s email area: archive", usrconfig.Name);
are_tot++;
processed = FALSE;
if (do_kill)
KillArea(sAreas, Name, 0, CFG.defmsgs, 0);
if (do_pack || (Del != msg_del))
PackArea(sAreas, 0);
Del = msg_del;
if (do_link)
LinkArea(sAreas, 0);
if (processed)
are_proc++;
sprintf(sAreas, "%s/%s/trash", CFG.bbs_usersdir, usrconfig.Name);
sprintf(Name, "User %s email area: trash", usrconfig.Name);
are_tot++;
processed = FALSE;
if (do_kill)
KillArea(sAreas, Name, CFG.defdays, CFG.defmsgs, 0);
if (do_pack || (Del != msg_del))
PackArea(sAreas, 0);
Del = msg_del;
if (do_link)
LinkArea(sAreas, 0);
if (processed)
are_proc++;
}
}
fclose(pAreas); fclose(pAreas);
}
if (!do_area) { if (do_link)
sprintf(sAreas, "%s/etc/users.data", getenv("MBSE_ROOT")); RemoveSema((char *)"msglink");
if ((pAreas = fopen (sAreas, "r")) == NULL) {
WriteError("$Can't open Messages Areas File.");
die(SIGILL);
}
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pAreas);
while (fread(&usrconfig, usrconfighdr.recsize, 1, pAreas) == 1) { free(sAreas);
if (usrconfig.Email && strlen(usrconfig.Name)) { free(Name);
Nopper(); die(MBERR_OK);
sprintf(Name, "User %s email area: mailbox", usrconfig.Name);
if (!do_quiet) {
mbse_colour(3, 0);
printf("\r .. %-40s", Name);
fflush(stdout);
}
sprintf(sAreas, "%s/%s/mailbox", CFG.bbs_usersdir, usrconfig.Name);
are_tot++;
processed = FALSE;
if (do_kill)
KillArea(sAreas, Name, 0, CFG.defmsgs, 0);
if (do_pack || (Del != msg_del)) {
PackArea(sAreas, 0);
}
Del = msg_del;
if (do_index)
IndexArea(sAreas, 0);
if (do_link)
LinkArea(sAreas, 0);
if (processed)
are_proc++;
sprintf(sAreas, "%s/%s/archive", CFG.bbs_usersdir, usrconfig.Name);
sprintf(Name, "User %s email area: archive", usrconfig.Name);
are_tot++;
processed = FALSE;
if (do_kill)
KillArea(sAreas, Name, 0, CFG.defmsgs, 0);
if (do_pack || (Del != msg_del))
PackArea(sAreas, 0);
Del = msg_del;
if (do_index)
IndexArea(sAreas, 0);
if (do_link)
LinkArea(sAreas, 0);
if (processed)
are_proc++;
sprintf(sAreas, "%s/%s/trash", CFG.bbs_usersdir, usrconfig.Name);
sprintf(Name, "User %s email area: trash", usrconfig.Name);
are_tot++;
processed = FALSE;
if (do_kill)
KillArea(sAreas, Name, CFG.defdays, CFG.defmsgs, 0);
if (do_pack || (Del != msg_del))
PackArea(sAreas, 0);
Del = msg_del;
if (do_index)
IndexArea(sAreas, 0);
if (do_link)
LinkArea(sAreas, 0);
if (processed)
are_proc++;
}
}
fclose(pAreas);
}
if (do_link)
RemoveSema((char *)"msglink");
free(sAreas);
free(Name);
die(MBERR_OK);
} }
@ -437,121 +423,115 @@ void LinkArea(char *Path, long Areanr)
*/ */
void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr) void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
{ {
unsigned long Number, TotalMsgs = 0, Highest, *Active, Counter = 0; unsigned long Number, TotalMsgs = 0, Highest, *Active, Counter = 0;
int i, DelCount = 0, DelAge = 0, Done; int i, DelCount = 0, DelAge = 0, Done;
time_t Today, MsgDate; time_t Today, MsgDate;
IsDoing("Killing %ld", Areanr); IsDoing("Killing %ld", Areanr);
Today = time(NULL) / 86400L; Today = time(NULL) / 86400L;
if (Msg_Open(Path)) { if (Msg_Open(Path)) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(12, 0); mbse_colour(LIGHTRED, BLACK);
printf(" (Killing)"); printf(" (Killing)");
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
}
if (Msg_Lock(30L)) {
TotalMsgs = Msg_Number();
if (TotalMsgs) {
if ((Active = (unsigned long *)malloc((size_t)((TotalMsgs + 100L) * sizeof(unsigned long)))) != NULL) {
i = 0;
Number = Msg_Lowest();
do {
Active[i++] = Number;
} while (Msg_Next(&Number) == TRUE);
} }
} else
Active = NULL;
if (Msg_Lock(30L)) { Number = Msg_Lowest();
Highest = Msg_Highest();
TotalMsgs = Msg_Number(); do {
if (CFG.slow_util && do_quiet)
msleep(1);
if (TotalMsgs) { if ((!do_quiet) && ((Counter % 10L) == 0)) {
if ((Active = (unsigned long *)malloc((size_t)((TotalMsgs + 100L) * sizeof(unsigned long)))) != NULL) { printf("%6lu / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", Counter, TotalMsgs);
i = 0; fflush(stdout);
Number = Msg_Lowest(); }
do { if ((Counter % 10L) == 0)
Active[i++] = Number; DoNop();
} while (Msg_Next(&Number) == TRUE);
Counter++;
msg_tot++;
if (Msg_ReadHeader(Number) == TRUE) {
Done = FALSE;
if (DaysOld) {
/*
* GoldED doesn't fill the Msg.Arrived field, use the
* written date instead.
*/
if (Msg.Arrived == 0L)
MsgDate = Msg.Written / 86400L;
else
MsgDate = Msg.Arrived / 86400L;
if ((Today - MsgDate) > DaysOld) {
Msg_Delete(Number);
Done = TRUE;
DelAge++;
msg_del++;
if (Active != NULL) {
for (i = 0; i < TotalMsgs; i++) {
if (Active[i] == Number)
Active[i] = 0L;
} }
} else }
Active = NULL; }
}
Number = Msg_Lowest(); if (Done == FALSE && (MaxMsgs) && Msg_Number() > MaxMsgs) {
Highest = Msg_Highest(); Msg_Delete(Number);
DelCount++;
msg_del++;
if (Active != NULL) {
for (i = 0; i < TotalMsgs; i++) {
if (Active[i] == Number)
Active[i] = 0L;
}
}
}
}
} while (Msg_Next(&Number) == TRUE);
do { if (Active != NULL)
if (CFG.slow_util && do_quiet) free(Active);
msleep(1); Msg_UnLock();
} else {
Syslog('+', "Can't lock msgbase %s", Path);
}
if ((!do_quiet) && ((Counter % 10L) == 0)) { if (!do_quiet) {
printf("%6lu / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", Counter, TotalMsgs); printf(" \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
fflush(stdout); fflush(stdout);
} }
if ((Counter % 10L) == 0)
DoNop();
Counter++; Msg_Close();
msg_tot++; Syslog('-', "%6d %6d %6d %6d %6d %s", TotalMsgs, DaysOld, DelAge, MaxMsgs, DelCount, Name);
if (Msg_ReadHeader(Number) == TRUE) { if (!do_quiet) {
Done = FALSE; printf("\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b");
if (DaysOld) { fflush(stdout);
/* }
* GoldED doesn't fill the Msg.Arrived field, use the } else
* written date instead. Syslog('+', "Failed to open %s", Path);
*/
if (Msg.Arrived == 0L)
MsgDate = Msg.Written / 86400L;
else
MsgDate = Msg.Arrived / 86400L;
if ((Today - MsgDate) > DaysOld) {
Msg_Delete(Number);
Done = TRUE;
DelAge++;
msg_del++;
if (Active != NULL) {
for (i = 0; i < TotalMsgs; i++) {
if (Active[i] == Number)
Active[i] = 0L;
}
}
}
}
if (Done == FALSE && (MaxMsgs) && Msg_Number() > MaxMsgs) {
Msg_Delete(Number);
DelCount++;
msg_del++;
if (Active != NULL) {
for (i = 0; i < TotalMsgs; i++) {
if (Active[i] == Number)
Active[i] = 0L;
}
}
}
}
} while (Msg_Next(&Number) == TRUE);
if (Active != NULL)
free(Active);
Msg_UnLock();
} else {
Syslog('+', "Can't lock msgbase %s", Path);
}
if (!do_quiet) {
printf(" \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
fflush(stdout);
}
Msg_Close();
Syslog('-', "%6d %6d %6d %6d %6d %s", TotalMsgs, DaysOld, DelAge, MaxMsgs, DelCount, Name);
if (!do_quiet) {
printf("\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b");
fflush(stdout);
}
} else
Syslog('+', "Failed to open %s", Path);
}
void IndexArea(char *Path, long Areanr)
{
} }
@ -561,31 +541,31 @@ void IndexArea(char *Path, long Areanr)
*/ */
void PackArea(char *Path, long Areanr) void PackArea(char *Path, long Areanr)
{ {
IsDoing("Packing %ld", Areanr); IsDoing("Packing %ld", Areanr);
if (Msg_Open(Path)) { if (Msg_Open(Path)) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(12, 0); mbse_colour(LIGHTRED, BLACK);
printf(" (Packing)"); printf(" (Packing)");
fflush(stdout); fflush(stdout);
}
if (Msg_Lock(30L)) {
Msg_Pack();
Msg_UnLock();
} else
Syslog('+', "Can't lock %s", Path);
Msg_Close();
if (!do_quiet) {
printf("\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b");
fflush(stdout);
}
} }
if (CFG.slow_util && do_quiet) if (Msg_Lock(30L)) {
msleep(1); Msg_Pack();
Msg_UnLock();
} else
Syslog('+', "Can't lock %s", Path);
Msg_Close();
if (!do_quiet) {
printf("\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b");
fflush(stdout);
}
}
if (CFG.slow_util && do_quiet)
msleep(1);
} }

View File

@ -1,13 +1,14 @@
#ifndef _MBMSG_H #ifndef _MBMSG_H
#define _MBMSG_H #define _MBMSG_H
/* $Id$ */
void ProgName(void); void ProgName(void);
void Help(void); void Help(void);
void die(int); void die(int);
void DoMsgBase(void); void DoMsgBase(void);
void PackArea(char *, long); void PackArea(char *, long);
void LinkArea(char *, long); void LinkArea(char *, long);
void IndexArea(char *, long);
void KillArea(char *, char *, int, int, long); void KillArea(char *, char *, int, int, long);
#endif #endif

View File

@ -535,7 +535,7 @@ int Areas(void)
Mgrlog("Process areas taglists"); Mgrlog("Process areas taglists");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Processing areas taglists...\n"); printf("Processing areas taglists...\n");
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Write notify messages. * Purpose ...............: Write notify messages.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -62,9 +62,9 @@ int Notify(char *Options)
Syslog('+', "Notify \"%s\"", Options); Syslog('+', "Notify \"%s\"", Options);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("Writing notify messages\n"); printf("Writing notify messages\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
} }
if (strlen(Options)) { if (strlen(Options)) {

View File

@ -53,7 +53,7 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
mbse_CleanSubject(Subj); mbse_CleanSubject(Subj);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("Post \"%s\" to \"%s\" in area %ld\n", File, To, Area); printf("Post \"%s\" to \"%s\" in area %ld\n", File, To, Area);
} }

View File

@ -91,7 +91,7 @@ int ProcessTic(fa_list **sbl)
Temp = calloc(PATH_MAX, sizeof(char)); Temp = calloc(PATH_MAX, sizeof(char));
if (!do_quiet) { if (!do_quiet) {
mbse_colour(10, 0); mbse_colour(LIGHTGREEN, BLACK);
printf("Checking \b\b\b\b\b\b\b\b\b\b"); printf("Checking \b\b\b\b\b\b\b\b\b\b");
fflush(stdout); fflush(stdout);
} }

View File

@ -5,7 +5,7 @@
* Remarks ...............: Most of these functions are borrowed from inn. * Remarks ...............: Most of these functions are borrowed from inn.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -543,7 +543,7 @@ void NewsUUCP(void)
IsDoing((char *)"UUCP Batch"); IsDoing((char *)"UUCP Batch");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(10, 0); mbse_colour(LIGHTGREEN, BLACK);
printf("Process UUCP Newsbatch\n"); printf("Process UUCP Newsbatch\n");
} }

View File

@ -157,9 +157,9 @@ void ScanFull()
IsDoing("Scanning mail"); IsDoing("Scanning mail");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("Scanning mail\n"); printf("Scanning mail\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -173,9 +173,9 @@ void ScanFull()
Nopper(); Nopper();
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%8s %-40s", usrconfig.Name, usrconfig.sUserName); printf("\r%8s %-40s", usrconfig.Name, usrconfig.sUserName);
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -237,9 +237,9 @@ void ScanFull()
Nopper(); Nopper();
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", arearec, msgs.Name); printf("\r%5ld .. %-40s", arearec, msgs.Name);
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -352,9 +352,9 @@ void ScanOne(char *path, unsigned long MsgNum)
IsDoing("Scanning mail"); IsDoing("Scanning mail");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("Scanning mail\n"); printf("Scanning mail\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -405,9 +405,9 @@ void ScanOne(char *path, unsigned long MsgNum)
if ((msgs.Active) && (msgs.Type == ECHOMAIL || msgs.Type == NETMAIL || msgs.Type == NEWS)) { if ((msgs.Active) && (msgs.Type == ECHOMAIL || msgs.Type == NETMAIL || msgs.Type == NEWS)) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", Area, msgs.Name); printf("\r%5ld .. %-40s", Area, msgs.Name);
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -500,9 +500,9 @@ int RescanOne(faddr *L, char *marea, unsigned long Num)
IsDoing("ReScan mail"); IsDoing("ReScan mail");
if (!do_quiet) { if (!do_quiet) {
mbse_colour(9, 0); mbse_colour(LIGHTBLUE, BLACK);
printf("ReScan mail\n"); printf("ReScan mail\n");
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
fflush(stdout); fflush(stdout);
} }
@ -529,9 +529,9 @@ int RescanOne(faddr *L, char *marea, unsigned long Num)
if ((msgs.Active) && ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS) || (msgs.Type == LIST))) { if ((msgs.Active) && ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS) || (msgs.Type == LIST))) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", Area, msgs.Name); printf("\r%5ld .. %-40s", Area, msgs.Name);
mbse_colour(13, 0); mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout); fflush(stdout);
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Scan for new News * Purpose ...............: Scan for new News
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -191,7 +191,7 @@ void ScanNews(void)
} }
if (!do_quiet) { if (!do_quiet) {
mbse_colour(10, 0); mbse_colour(LIGHTGREEN, BLACK);
printf("Scan for new news articles\n"); printf("Scan for new news articles\n");
} }
@ -216,7 +216,7 @@ void ScanNews(void)
} }
Syslog('m', "Scan newsgroup: %s", Msgs.Newsgroup); Syslog('m', "Scan newsgroup: %s", Msgs.Newsgroup);
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%-40s", Msgs.Newsgroup); printf("\r%-40s", Msgs.Newsgroup);
fflush(stdout); fflush(stdout);
} }

View File

@ -106,7 +106,7 @@ int storeecho(faddr *f, faddr *t, time_t mdate, int flags, char *subj, char *msg
echo_imp++; echo_imp++;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r%6u => %-40s\r", echo_in, msgs.Name); printf("\r%6u => %-40s\r", echo_in, msgs.Name);
fflush(stdout); fflush(stdout);
} }

View File

@ -355,7 +355,7 @@ int LoadTic(char *inb, char *tfn)
* Show on screen what we are doing * Show on screen what we are doing
*/ */
if (!do_quiet) { if (!do_quiet) {
mbse_colour(3, 0); mbse_colour(CYAN, BLACK);
printf("\r"); printf("\r");
for (i = 0; i < 79; i++) for (i = 0; i < 79; i++)
printf(" "); printf(" ");

View File

@ -4,7 +4,7 @@
* Purpose ...............: Toss a single *.pkt file * Purpose ...............: Toss a single *.pkt file
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -268,7 +268,7 @@ int TossPkt(char *fn)
FILE *pkt; FILE *pkt;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(10, 0); mbse_colour(LIGHTGREEN, BLACK);
printf("Tossing packet %s\n", fn); printf("Tossing packet %s\n", fn);
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Netmail tracker / router * Purpose ...............: Netmail tracker / router
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -712,7 +712,7 @@ void TestTracker(faddr *dest)
addr.node = dest->node; addr.node = dest->node;
addr.point = dest->point; addr.point = dest->point;
mbse_colour(7, 0); mbse_colour(LIGHTGRAY, BLACK);
Syslog('+', "Test route to %s", aka2str(addr)); Syslog('+', "Test route to %s", aka2str(addr));
rc = TrackMail(addr, &result); rc = TrackMail(addr, &result);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Unpacker * Purpose ...............: Unpacker
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -70,7 +70,7 @@ int unpack(char *fn)
int rc = 0, ld; int rc = 0, ld;
if (!do_quiet) { if (!do_quiet) {
mbse_colour(11, 0); mbse_colour(LIGHTCYAN, BLACK);
printf("Unpacking file %s\n", fn); printf("Unpacking file %s\n", fn);
} }