Added experimental support for MsgEd

This commit is contained in:
Michiel Broek 2002-11-06 20:38:51 +00:00
parent b4d817cb15
commit 5112d57589
4 changed files with 115 additions and 43 deletions

View File

@ -50,6 +50,8 @@ v0.35.05 19-Oct-2002
In node setup the pack netmail switch is renamed and is now In node setup the pack netmail switch is renamed and is now
for all mail. Default for new records is Yes. for all mail. Default for new records is Yes.
Added length check when importing taglines. Added length check when importing taglines.
Now writes also ~/etc/msg.txt for MsgEd after messagebase is
updated.
mbfido: mbfido:
With ticfile processing, the KeepDate setup setting now works. With ticfile processing, the KeepDate setup setting now works.

View File

@ -1615,6 +1615,59 @@ int NodeInMarea(fidoaddr A)
void msged_areas(FILE *fp)
{
char *temp, *aka;
FILE *no;
int i = 0;
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((no = fopen(temp, "r")) == NULL)
return;
fread(&msgshdr, sizeof(msgshdr), 1, no);
fseek(no, 0, SEEK_SET);
fread(&msgshdr, msgshdr.hdrsize, 1, no);
while (fread(&msgs, msgshdr.recsize, 1, no) == 1) {
i++;
if (msgs.Active) {
fprintf(fp, "Jam ");
switch (msgs.Type) {
case LOCALMAIL: fprintf(fp, "l"); break;
case NETMAIL: fprintf(fp, "mp"); break;
case ECHOMAIL: fprintf(fp, "e"); break;
case NEWS: fprintf(fp, "e"); break;
}
if (((msgs.Type == NEWS) || (msgs.Type == ECHOMAIL)) && strlen(msgs.Tag) && strlen(msgs.Newsgroup)) {
fprintf(fp, "u");
}
fprintf(fp, "8");
fprintf(fp, " \"%s\" %s", msgs.Name, msgs.Base);
if (msgs.Type == ECHOMAIL)
fprintf(fp, " %s", msgs.Tag);
if (msgs.Type != LOCALMAIL) {
aka = xstrcpy(strtok(aka2str(msgs.Aka), "@"));
fprintf(fp, " %s", aka);
free(aka);
}
fprintf(fp, "\n");
}
fseek(no, msgshdr.syssize, SEEK_CUR);
}
fclose(no);
free(temp);
fprintf(fp, "\n");
}
void gold_areas(FILE *fp) void gold_areas(FILE *fp)
{ {
char *temp, *aka; char *temp, *aka;

View File

@ -1,6 +1,7 @@
#ifndef _MAREA_H #ifndef _MAREA_H
#define _MAREA_H #define _MAREA_H
/* $Id$ */
int OpenMsgarea(void); int OpenMsgarea(void);
void CloseMsgarea(int); void CloseMsgarea(int);
@ -10,6 +11,7 @@ int CountMsgarea(void);
void EditMsgarea(void); void EditMsgarea(void);
void InitMsgarea(void); void InitMsgarea(void);
void gold_areas(FILE *); void gold_areas(FILE *);
void msged_areas(FILE *);
int mail_area_doc(FILE *, FILE *, int); int mail_area_doc(FILE *, FILE *, int);
char *PickMsgarea(char *); char *PickMsgarea(char *);

View File

@ -93,9 +93,24 @@ static void die(int onsig)
screen_stop(); screen_stop();
if (exp_golded && (config_read() != -1)) { if (exp_golded && (config_read() != -1)) {
temp = calloc(128, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));
/*
* Export ~/etc/msg.txt for MsgEd.
*/
sprintf(temp, "%s/etc/msg.txt", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "w")) != NULL) {
msged_areas(fp);
fclose(fp);
Syslog('+', "Created new %s", temp);
} else {
WriteError("$Could not create %s", temp);
}
/*
* Export ~/etc/golded.inc for GoldED
*/
sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "w")) != NULL) { if ((fp = fopen(temp, "w")) != NULL) {
fprintf(fp, "; GoldED.inc -- Automatic created by mbsetup %s -- Do not edit!\n\n", VERSION); fprintf(fp, "; GoldED.inc -- Automatic created by mbsetup %s -- Do not edit!\n\n", VERSION);
fprintf(fp, "; Basic information\n;\n"); fprintf(fp, "; Basic information\n;\n");