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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -53,7 +53,7 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
mbse_CleanSubject(Subj);
if (!do_quiet) {
mbse_colour(3, 0);
mbse_colour(CYAN, BLACK);
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));
if (!do_quiet) {
mbse_colour(10, 0);
mbse_colour(LIGHTGREEN, BLACK);
printf("Checking \b\b\b\b\b\b\b\b\b\b");
fflush(stdout);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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