Code cleanup
This commit is contained in:
parent
ccc8390ad3
commit
9e51c6dba7
10
ChangeLog
10
ChangeLog
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
@ -59,9 +59,9 @@ void ProgName()
|
||||
if (do_quiet)
|
||||
return;
|
||||
|
||||
mbse_colour(15, 0);
|
||||
mbse_colour(WHITE, BLACK);
|
||||
printf("\nMBOUT: MBSE BBS %s Outbound Manager\n", VERSION);
|
||||
mbse_colour(14, 0);
|
||||
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);
|
||||
@ -124,11 +124,11 @@ void Help()
|
||||
do_quiet = FALSE;
|
||||
ProgName();
|
||||
|
||||
mbse_colour(11, 0);
|
||||
mbse_colour(LIGHTCYAN, BLACK);
|
||||
printf("\nUsage: mbout [command] <params> <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 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");
|
||||
@ -139,11 +139,11 @@ void Help()
|
||||
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);
|
||||
mbse_colour(LIGHTBLUE, BLACK);
|
||||
printf("\n Options are:\n\n");
|
||||
mbse_colour(3, 0);
|
||||
mbse_colour(CYAN, BLACK);
|
||||
printf(" -quiet Quiet mode\n");
|
||||
mbse_colour(7, 0);
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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(" ");
|
||||
|
@ -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"));
|
||||
|
@ -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 */
|
||||
@ -67,11 +66,11 @@ void ProgName()
|
||||
if (do_quiet)
|
||||
return;
|
||||
|
||||
mbse_colour(15, 0);
|
||||
mbse_colour(WHITE, BLACK);
|
||||
printf("\nMBMSG: MBSE BBS %s - Message Base Maintenance Utility\n", VERSION);
|
||||
mbse_colour(14, 0);
|
||||
mbse_colour(YELLOW, BLACK);
|
||||
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, 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();
|
||||
}
|
||||
@ -183,19 +180,18 @@ void Help()
|
||||
do_quiet = FALSE;
|
||||
ProgName();
|
||||
|
||||
mbse_colour(12, 0);
|
||||
mbse_colour(LIGHTCYAN, BLACK);
|
||||
printf("\n Usage: mbmsg [command(s)] <options>\n\n");
|
||||
mbse_colour(9, 0);
|
||||
mbse_colour(LIGHTBLUE, BLACK);
|
||||
printf(" Commands are:\n\n");
|
||||
mbse_colour(3, 0);
|
||||
// printf(" i index Create new index files\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(9, 0);
|
||||
mbse_colour(LIGHTBLUE, BLACK);
|
||||
printf(" Options are:\n\n");
|
||||
mbse_colour(3, 0);
|
||||
mbse_colour(CYAN, BLACK);
|
||||
printf(" -a -area <#> Process area <#> only\n");
|
||||
printf(" -q -quiet Quiet mode\n");
|
||||
|
||||
@ -210,7 +206,7 @@ void die(int onsig)
|
||||
signal(onsig, SIG_IGN);
|
||||
if (!do_quiet) {
|
||||
printf("\r");
|
||||
mbse_colour(3, 0);
|
||||
mbse_colour(CYAN, BLACK);
|
||||
}
|
||||
|
||||
if (MsgBase.Locked)
|
||||
@ -238,7 +234,7 @@ void die(int onsig)
|
||||
|
||||
umask(oldmask);
|
||||
if (!do_quiet) {
|
||||
mbse_colour(7, 0);
|
||||
mbse_colour(LIGHTGRAY, BLACK);
|
||||
printf("\r \n");
|
||||
}
|
||||
ExitClient(onsig);
|
||||
@ -253,8 +249,8 @@ void DoMsgBase()
|
||||
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");
|
||||
|
||||
@ -270,8 +266,8 @@ void DoMsgBase()
|
||||
|
||||
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);
|
||||
WriteError("$Can't open %s", sAreas);
|
||||
die(MBERR_GENERAL);
|
||||
}
|
||||
fread(&msgshdr, sizeof(msgshdr), 1, pAreas);
|
||||
|
||||
@ -284,7 +280,7 @@ void DoMsgBase()
|
||||
die(MBERR_DISK_FULL);
|
||||
|
||||
if (!do_quiet) {
|
||||
mbse_colour(3, 0);
|
||||
mbse_colour(CYAN, BLACK);
|
||||
printf("\r%5ld .. %-40s", do_area, msgs.Name);
|
||||
fflush(stdout);
|
||||
}
|
||||
@ -294,8 +290,6 @@ void DoMsgBase()
|
||||
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)
|
||||
@ -314,7 +308,7 @@ void DoMsgBase()
|
||||
|
||||
Nopper();
|
||||
if (!do_quiet) {
|
||||
mbse_colour(3, 0);
|
||||
mbse_colour(CYAN, BLACK);
|
||||
printf("\r%5ld .. %-40s", arearec, msgs.Name);
|
||||
fflush(stdout);
|
||||
}
|
||||
@ -327,8 +321,6 @@ void DoMsgBase()
|
||||
PackArea(msgs.Base, arearec);
|
||||
}
|
||||
Del = msg_del;
|
||||
if (do_index)
|
||||
IndexArea(msgs.Base, arearec);
|
||||
if (do_link)
|
||||
LinkArea(msgs.Base, arearec);
|
||||
if (processed)
|
||||
@ -341,8 +333,8 @@ void DoMsgBase()
|
||||
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);
|
||||
WriteError("$Can't open %s", sAreas);
|
||||
die(MBERR_GENERAL);
|
||||
}
|
||||
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pAreas);
|
||||
|
||||
@ -351,7 +343,7 @@ void DoMsgBase()
|
||||
Nopper();
|
||||
sprintf(Name, "User %s email area: mailbox", usrconfig.Name);
|
||||
if (!do_quiet) {
|
||||
mbse_colour(3, 0);
|
||||
mbse_colour(CYAN, BLACK);
|
||||
printf("\r .. %-40s", Name);
|
||||
fflush(stdout);
|
||||
}
|
||||
@ -364,8 +356,6 @@ void DoMsgBase()
|
||||
PackArea(sAreas, 0);
|
||||
}
|
||||
Del = msg_del;
|
||||
if (do_index)
|
||||
IndexArea(sAreas, 0);
|
||||
if (do_link)
|
||||
LinkArea(sAreas, 0);
|
||||
if (processed)
|
||||
@ -379,8 +369,6 @@ void DoMsgBase()
|
||||
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)
|
||||
@ -394,8 +382,6 @@ void DoMsgBase()
|
||||
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)
|
||||
@ -447,9 +433,9 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
|
||||
if (Msg_Open(Path)) {
|
||||
|
||||
if (!do_quiet) {
|
||||
mbse_colour(12, 0);
|
||||
mbse_colour(LIGHTRED, BLACK);
|
||||
printf(" (Killing)");
|
||||
mbse_colour(13, 0);
|
||||
mbse_colour(LIGHTMAGENTA, BLACK);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
@ -550,12 +536,6 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
|
||||
|
||||
|
||||
|
||||
void IndexArea(char *Path, long Areanr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Pack message area if there are deleted messages.
|
||||
*/
|
||||
@ -565,7 +545,7 @@ void PackArea(char *Path, long Areanr)
|
||||
if (Msg_Open(Path)) {
|
||||
|
||||
if (!do_quiet) {
|
||||
mbse_colour(12, 0);
|
||||
mbse_colour(LIGHTRED, BLACK);
|
||||
printf(" (Packing)");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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(" ");
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user