Moved getrfcchrs function into mbselib.a

This commit is contained in:
Michiel Broek 2005-08-14 09:38:06 +00:00
parent c11ba79455
commit b07cd6b675
5 changed files with 14 additions and 59 deletions

View File

@ -3,7 +3,7 @@
* $Id$ * $Id$
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -106,28 +106,6 @@ char *make_msgid(char *msgid)
char *getrfcchrs(int val)
{
switch (val) {
case FTNC_NONE: return (char *)"iso-8859-1";
case FTNC_CP437: return (char *)"cp437";
case FTNC_CP850: return (char *)"cp850";
case FTNC_CP865: return (char *)"cp865";
case FTNC_CP866: return (char *)"cp866";
case FTNC_CP852: return (char *)"cp852";
case FTNC_CP895: return (char *)"cp895";
case FTNC_LATIN_1: return (char *)"iso-8859-1";
case FTNC_LATIN_2: return (char *)"iso-8859-2";
case FTNC_LATIN_5: return (char *)"iso-8859-5";
case FTNC_MAC: return (char *)"MAC 2";
case FTNC_KOI8_R: return (char *)"koi8-r";
case FTNC_CP936: return (char *)"hz-gb-2312";
default: return (char *)"iso-8859-1";
}
}
/* /*
* ARTICLE * ARTICLE
* BODY * BODY

View File

@ -4,7 +4,7 @@
* Purpose ...............: Change user settings * Purpose ...............: Change user settings
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -1014,7 +1014,7 @@ void Chg_Charset()
temp = calloc(81, sizeof(char)); temp = calloc(81, sizeof(char));
ReadExitinfo(); ReadExitinfo();
Syslog('+', "Old character set %s", getchrs(exitinfo.Charset)); Syslog('+', "Old character set %s", getftnchrs(exitinfo.Charset));
while(TRUE) { while(TRUE) {
Enter(1); Enter(1);
@ -1028,7 +1028,7 @@ void Chg_Charset()
sprintf(temp, "%2d ", i); sprintf(temp, "%2d ", i);
PUTSTR(temp); PUTSTR(temp);
colour(LIGHTCYAN, BLACK); colour(LIGHTCYAN, BLACK);
sprintf(temp, "%-9s ", getchrs(i)); sprintf(temp, "%-9s ", getftnchrs(i));
PUTSTR(temp); PUTSTR(temp);
colour(LIGHTMAGENTA, BLACK); colour(LIGHTMAGENTA, BLACK);
sprintf(temp, "%s\r\n", getchrsdesc(i)); sprintf(temp, "%s\r\n", getchrsdesc(i));
@ -1050,14 +1050,14 @@ void Chg_Charset()
if ((i > FTNC_NONE) && (i <= FTNC_MAXCHARS)) { if ((i > FTNC_NONE) && (i <= FTNC_MAXCHARS)) {
exitinfo.Charset = i; exitinfo.Charset = i;
Syslog('+', "New character set %s", getchrs(exitinfo.Charset)); Syslog('+', "New character set %s", getftnchrs(exitinfo.Charset));
WriteExitinfo(); WriteExitinfo();
setlocale(LC_CTYPE, getlocale(exitinfo.Charset)); setlocale(LC_CTYPE, getlocale(exitinfo.Charset));
Syslog('b', "setlocale(LC_CTYPE, NULL) returns \"%s\"", printable(setlocale(LC_CTYPE, NULL), 0)); Syslog('b', "setlocale(LC_CTYPE, NULL) returns \"%s\"", printable(setlocale(LC_CTYPE, NULL), 0));
Enter(2); Enter(2);
colour(LIGHTGREEN, BLACK); colour(LIGHTGREEN, BLACK);
/* Character set now set to: */ /* Character set now set to: */
sprintf(temp, "%s%s", (char *) Language(25), getchrs(i)); sprintf(temp, "%s%s", (char *) Language(25), getftnchrs(i));
PUTSTR(temp); PUTSTR(temp);
free(temp); free(temp);
Enter(2); Enter(2);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Display ANSI/ASCII textfiles * Purpose ...............: Display ANSI/ASCII textfiles
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -555,7 +555,7 @@ void ControlCodeU(int ch)
break; break;
case '9': case '9':
sprintf(temp, "%s", getchrs(exitinfo.Charset)); sprintf(temp, "%s", getftnchrs(exitinfo.Charset));
break; break;
default: default:

View File

@ -5,7 +5,7 @@
* Todo ..................: Implement message groups. * Todo ..................: Implement message groups.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -1261,11 +1261,10 @@ int Read_a_Msg(unsigned long Num, int UpdateLR)
/* /*
* No charset marked in the message, use the area charset * No charset marked in the message, use the area charset
*/ */
charset = xstrcpy(getchrs(msgs.Charset)); charset = xstrcpy(getftnchrs(msgs.Charset));
} }
charsin = xstrcpy(charset); charsin = xstrcpy(charset);
charsout = xstrcpy(getchrs(exitinfo.Charset)); charsout = xstrcpy(getftnchrs(exitinfo.Charset));
Syslog('b', "Stage 3: charset %s, translate %s to %s", MBSE_SS(charset), MBSE_SS(charsin), MBSE_SS(charsout));
/* /*
* Try to setup charset mapping if the charactersets are different. * Try to setup charset mapping if the charactersets are different.

View File

@ -152,34 +152,12 @@ void Close_Msgbase(char *Base)
} }
char *getrfcchrs(int val)
{
switch (val) {
case FTNC_NONE: return (char *)"iso-8859-1";
case FTNC_CP437: return (char *)"cp437";
case FTNC_CP850: return (char *)"cp850";
case FTNC_CP865: return (char *)"cp865";
case FTNC_CP866: return (char *)"cp866";
case FTNC_CP852: return (char *)"cp852";
case FTNC_CP895: return (char *)"cp895";
case FTNC_LATIN_1: return (char *)"iso-8859-1";
case FTNC_LATIN_2: return (char *)"iso-8859-2";
case FTNC_LATIN_5: return (char *)"iso-8859-5";
case FTNC_MAC: return (char *)"MAC 2";
case FTNC_KOI8_R: return (char *)"koi8-r";
case FTNC_CP936: return (char *)"hz-gb-2312";
default: return (char *)"iso-8859-1";
}
}
void Add_Headkludges(faddr *dest, int IsReply) void Add_Headkludges(faddr *dest, int IsReply)
{ {
char *temp; char *temp;
unsigned long crc = -1; unsigned long crc = -1;
time_t tt; time_t tt;
int i;
faddr *Node; faddr *Node;
temp = calloc(128, sizeof(char)); temp = calloc(128, sizeof(char));
@ -246,11 +224,11 @@ void Add_Headkludges(faddr *dest, int IsReply)
* Set the right charset kludge * Set the right charset kludge
*/ */
if (exitinfo.Charset != FTNC_NONE) { if (exitinfo.Charset != FTNC_NONE) {
sprintf(temp, "\001CHRS: %s", getchrs(exitinfo.Charset)); sprintf(temp, "\001CHRS: %s", getftnchrs(exitinfo.Charset));
} else if (msgs.Charset != FTNC_NONE) { } else if (msgs.Charset != FTNC_NONE) {
sprintf(temp, "\001CHRS: %s", getchrs(msgs.Charset)); sprintf(temp, "\001CHRS: %s", getftnchrs(msgs.Charset));
} else { } else {
sprintf(temp, "\001CHRS: %s", getchrs(FTNC_LATIN_1)); sprintf(temp, "\001CHRS: %s", getftnchrs(FTNC_LATIN_1));
} }
MsgText_Add2(temp); MsgText_Add2(temp);
sprintf(temp, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer()); sprintf(temp, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer());