Filefind setup now has CHRS selection

This commit is contained in:
Michiel Broek 2007-03-05 12:25:18 +00:00
parent 57f5762412
commit ca5eee75e6
9 changed files with 29 additions and 48 deletions

View File

@ -46,9 +46,9 @@ v0.91.5 18-Feb-2007
The make web stat produces UTF-8 webpages. The make web stat produces UTF-8 webpages.
mbaff: mbaff:
For each newfile report there is now a CHRS kludge setting. For each newfileis and filefind report there is now a CHRS
Reports will be converted to the selected charset. Origin kludge setting. Reports will be converted to the selected
characterset is CP437 for now. charset. Origin characterset is CP437 for now.
mball: mball:
Now also creates allfiles.utf and newfiles.utf with UTF-8 Now also creates allfiles.utf and newfiles.utf with UTF-8
@ -63,8 +63,8 @@ v0.91.5 18-Feb-2007
Fixed a too low memory allocation in clencode. Fixed a too low memory allocation in clencode.
mbsetup: mbsetup:
In newfiles reports the Hi-ASCII setting is gone and a CHRS In newfiles and filefind reports the Hi-ASCII setting is gone
kludge selection is added. Defaults to CP437 2. and a CHRS kludge selection is added. Defaults to CP437 2.
lang: lang:
Language prompts 44, 75 and 76 are obsolete. Language prompts 44, 75 and 76 are obsolete.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -14,7 +14,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<div align='right'><h5>Last update 17-Mar-2004</h5></div> <div align='right'><h5>Last update 05-Mar-2007</h5></div>
<div align='center'><H1>MBSE BBS Setup - Filefind Areas.</H1></div> <div align='center'><H1>MBSE BBS Setup - Filefind Areas.</H1></div>
<H3>Introduction.</H3> <H3>Introduction.</H3>
@ -43,7 +43,7 @@ for.
<strong>Active </strong>If this area is active. <strong>Active </strong>If this area is active.
<strong>Deleted </strong>If this area must be deleted. <strong>Deleted </strong>If this area must be deleted.
<strong>Net. reply </strong>If the reply will be sent by netmail. <strong>Net. reply </strong>If the reply will be sent by netmail.
<strong>Hi ACSII </strong>If high ASCII is allowed in the replies. <strong>CHRS kludge </strong>The CHRS kludge and encoding to use.
<strong>Keywrd len </strong>The minimum keyword length allowed in search. <strong>Keywrd len </strong>The minimum keyword length allowed in search.
</pre> </pre>
<P> <P>

View File

@ -14,7 +14,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<div align='right'><h5>Last update 30-Jan-2001</h5></div> <div align='right'><h5>Last update 05-Mar-2007</h5></div>
<div align='center'><H1>MBSE BBS Setup - Newfiles Reports.</H1></div> <div align='center'><H1>MBSE BBS Setup - Newfiles Reports.</H1></div>
<H3>Introduction.</H3> <H3>Introduction.</H3>
@ -38,8 +38,8 @@ specified by the newfiles groups you can include or exclude for announcement.
<strong>Aka to use </strong>The Fidonet aka to use in this area. <strong>Aka to use </strong>The Fidonet aka to use in this area.
<strong>Active </strong>If this report is active. <strong>Active </strong>If this report is active.
<strong>Deleted </strong>If this report must be deleted. <strong>Deleted </strong>If this report must be deleted.
<strong>High ASCII </strong>Allow high ASCII in this area.
<strong>New groups </strong>The screen to define the groups to include. <strong>New groups </strong>The screen to define the groups to include.
<strong>CHRS kludge </strong>The CHRS kludge an encoding to use.
</pre> </pre>
<P> <P>

View File

@ -169,11 +169,12 @@ int StartReply(ff_list *ffl)
} }
Msg_New(); Msg_New();
chartran_init((char *)"CP437", get_ic_ftn(scanmgr.charset), 'f');
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
snprintf(Msg.From, 101, "%s", CFG.sysop_name); snprintf(Msg.From, 101, "%s", CFG.sysop_name);
snprintf(Msg.To, 101, "%s", ffl->from); snprintf(Msg.To, 101, "%s", chartran(ffl->from));
snprintf(Msg.Subject, 101, "Re: %s", ffl->subject); snprintf(Msg.Subject, 101, "Re: %s", chartran(ffl->subject));
snprintf(Msg.FromAddress, 101, "%s", aka2str(scanmgr.Aka)); snprintf(Msg.FromAddress, 101, "%s", aka2str(scanmgr.Aka));
Msg.Written = time(NULL); Msg.Written = time(NULL);
Msg.Arrived = time(NULL); Msg.Arrived = time(NULL);
@ -193,7 +194,7 @@ int StartReply(ff_list *ffl)
MsgText_Add2(temp); MsgText_Add2(temp);
Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp)); Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp));
free(temp); free(temp);
Msg_Pid(FTNC_NONE); Msg_Pid(scanmgr.charset);
return Msg_Top(scanmgr.template, scanmgr.Language, scanmgr.Aka); return Msg_Top(scanmgr.template, scanmgr.Language, scanmgr.Aka);
} }
@ -223,6 +224,8 @@ void FinishReply(int Reported, int Total, int filepos)
Msg_UnLock(); Msg_UnLock();
Syslog('+', "Posted message %ld", Msg.Id); Syslog('+', "Posted message %ld", Msg.Id);
chartran_close();
snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), scanmgr.NetReply?"net":"echo"); snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), scanmgr.NetReply?"net":"echo");
if ((fp = fopen(temp, "a")) != NULL) { if ((fp = fopen(temp, "a")) != NULL) {
if (strlen(scanmgr.ReplBoard)) if (strlen(scanmgr.ReplBoard))
@ -408,7 +411,7 @@ void ScanFiles(ff_list *tmp)
break; break;
mbsedb_CloseFDB(fdb_area); mbsedb_CloseFDB(fdb_area);
MacroVars("slbkdt", "ssddss", fdb.Name, fdb.LName, fdb.Size, fdb.Size / 1024, " ", MacroVars("slbkdt", "ssddss", fdb.Name, fdb.LName, fdb.Size, fdb.Size / 1024, " ",
To_Low(fdb.Desc[0],scanmgr.HiAscii)); chartran(fdb.Desc[0]));
fseek(fi, filepos1, SEEK_SET); fseek(fi, filepos1, SEEK_SET);
Msg_Macro(fi); Msg_Macro(fi);
filepos2 = ftell(fi); filepos2 = ftell(fi);
@ -419,7 +422,7 @@ void ScanFiles(ff_list *tmp)
* to prevent unnecesary long messages. * to prevent unnecesary long messages.
*/ */
for (i = 1; i < MAX_DESC_LINES; i++) { for (i = 1; i < MAX_DESC_LINES; i++) {
MacroVars("t", "s", To_Low(fdb.Desc[i],scanmgr.HiAscii)); MacroVars("t", "s", chartran(fdb.Desc[i]));
fseek(fi, filepos2, SEEK_SET); fseek(fi, filepos2, SEEK_SET);
if (strlen(fdb.Desc[i])) { if (strlen(fdb.Desc[i])) {
Msg_Macro(fi); Msg_Macro(fi);

View File

@ -270,30 +270,3 @@ void CountPosted(char *Base)
} }
char *To_Low(char *inp, int High)
{
static char temp[81];
int i;
memset(&temp, 0, sizeof(temp));
strncpy(temp, inp, 80);
/*
* Change " into ' because the diesel macro processor gets confused by
* the " characters.
*/
for (i = 0; i < strlen(temp); i++)
if (temp[i] == '"')
temp[i] = '\'';
if (High)
return temp;
for (i = 0; i < strlen(temp); i++)
temp[i] = lotab[temp[i] & 0xff];
return temp;
}

View File

@ -10,7 +10,6 @@ void Msg_Macro(FILE *);
int Msg_Top(char *, int, fidoaddr); int Msg_Top(char *, int, fidoaddr);
void Msg_Bot(fidoaddr, char *, char *); void Msg_Bot(fidoaddr, char *, char *);
void CountPosted(char *); void CountPosted(char *);
char *To_Low(char *, int);
#endif #endif

View File

@ -4,7 +4,7 @@
* Purpose ...............: Filefind Setup * Purpose ...............: Filefind Setup
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2005 * Copyright (C) 1997-2007
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -124,6 +124,10 @@ int OpenFilefind(void)
scanmgr.keywordlen = 3; scanmgr.keywordlen = 3;
FilefindUpdated = 1; FilefindUpdated = 1;
} }
if (scanmgr.charset == 0) {
scanmgr.charset = FTNC_CP437;
FilefindUpdated = 1;
}
fwrite(&scanmgr, sizeof(scanmgr), 1, fout); fwrite(&scanmgr, sizeof(scanmgr), 1, fout);
memset(&scanmgr, 0, sizeof(scanmgr)); memset(&scanmgr, 0, sizeof(scanmgr));
} }
@ -200,6 +204,7 @@ int AppendFilefind(void)
snprintf(scanmgr.template, 15, "filefind"); snprintf(scanmgr.template, 15, "filefind");
strncpy(scanmgr.Origin, CFG.origin, 50); strncpy(scanmgr.Origin, CFG.origin, 50);
scanmgr.keywordlen = 3; scanmgr.keywordlen = 3;
scanmgr.charset = FTNC_CP437;
fwrite(&scanmgr, sizeof(scanmgr), 1, fil); fwrite(&scanmgr, sizeof(scanmgr), 1, fil);
fclose(fil); fclose(fil);
FilefindUpdated = 1; FilefindUpdated = 1;
@ -226,7 +231,7 @@ void FFScreen(void)
mbse_mvprintw(14, 2, "8. Active"); mbse_mvprintw(14, 2, "8. Active");
mbse_mvprintw(15, 2, "9. Deleted"); mbse_mvprintw(15, 2, "9. Deleted");
mbse_mvprintw(16, 2, "10. Net. reply"); mbse_mvprintw(16, 2, "10. Net. reply");
mbse_mvprintw(17, 2, "11. Hi Ascii"); mbse_mvprintw(17, 2, "11. CHRS kludge");
mbse_mvprintw(18, 2, "12. Keywrd len"); mbse_mvprintw(18, 2, "12. Keywrd len");
} }
@ -279,7 +284,7 @@ int EditFfRec(int Area)
show_bool(14,18, scanmgr.Active); show_bool(14,18, scanmgr.Active);
show_bool(15,18, scanmgr.Deleted); show_bool(15,18, scanmgr.Deleted);
show_bool(16,18, scanmgr.NetReply); show_bool(16,18, scanmgr.NetReply);
show_bool(17,18, scanmgr.HiAscii); show_charset(17,18, scanmgr.charset);
show_int( 18,18, scanmgr.keywordlen); show_int( 18,18, scanmgr.keywordlen);
switch(select_menu(12)) { switch(select_menu(12)) {
@ -317,7 +322,8 @@ int EditFfRec(int Area)
case 8: E_BOOL(14,18, scanmgr.Active, "If this report is ^active^") case 8: E_BOOL(14,18, scanmgr.Active, "If this report is ^active^")
case 9: E_BOOL(15,18, scanmgr.Deleted, "If this record is ^deleted^") case 9: E_BOOL(15,18, scanmgr.Deleted, "If this record is ^deleted^")
case 10:E_BOOL(16,18, scanmgr.NetReply, "If reply's via ^netmail^ instead of echomail") case 10:E_BOOL(16,18, scanmgr.NetReply, "If reply's via ^netmail^ instead of echomail")
case 11:E_BOOL(17,18, scanmgr.HiAscii, "Allow ^Hi ASCII^ in this area") case 11:scanmgr.charset = edit_charset(17,18, scanmgr.charset);
break;
case 12:E_IRC( 18,18, scanmgr.keywordlen, 3, 8, "Minimum ^keyword length^ to allowed for search") case 12:E_IRC( 18,18, scanmgr.keywordlen, 3, 8, "Minimum ^keyword length^ to allowed for search")
} }
} }
@ -478,7 +484,7 @@ int ff_doc(FILE *fp, FILE *toc, int page)
add_webtable(wp, (char *)"Template file", scanmgr.template); add_webtable(wp, (char *)"Template file", scanmgr.template);
add_webtable(wp, (char *)"Active", getboolean(scanmgr.Active)); add_webtable(wp, (char *)"Active", getboolean(scanmgr.Active));
add_webtable(wp, (char *)"Netmail reply", getboolean(scanmgr.NetReply)); add_webtable(wp, (char *)"Netmail reply", getboolean(scanmgr.NetReply));
add_webtable(wp, (char *)"Allow Hi-ASCII", getboolean(scanmgr.HiAscii)); add_webtable(wp, (char *)"CHRS kludge", getftnchrs(scanmgr.charset));
add_webdigit(wp, (char *)"Keyword length", scanmgr.keywordlen); add_webdigit(wp, (char *)"Keyword length", scanmgr.keywordlen);
fprintf(wp, "</TBODY>\n"); fprintf(wp, "</TBODY>\n");
fprintf(wp, "</TABLE>\n"); fprintf(wp, "</TABLE>\n");
@ -523,7 +529,7 @@ int ff_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Template file %s\n", scanmgr.template); fprintf(fp, " Template file %s\n", scanmgr.template);
fprintf(fp, " Active %s\n", getboolean(scanmgr.Active)); fprintf(fp, " Active %s\n", getboolean(scanmgr.Active));
fprintf(fp, " Netmail reply %s\n", getboolean(scanmgr.NetReply)); fprintf(fp, " Netmail reply %s\n", getboolean(scanmgr.NetReply));
fprintf(fp, " Allow Hi-ASCII %s\n", getboolean(scanmgr.HiAscii)); fprintf(fp, " CHRS kludge %s\n", getftnchrs(scanmgr.charset));
fprintf(fp, " Keyword length %d\n", scanmgr.keywordlen); fprintf(fp, " Keyword length %d\n", scanmgr.keywordlen);
fprintf(fp, "\n\n"); fprintf(fp, "\n\n");
j++; j++;