diff --git a/ChangeLog b/ChangeLog index 8959c0e6..ee60a0c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,15 @@ $Id$ -v0.91.4 17-Feb-2007 +v0.91.5 18-Feb-2007 + + WARNING: do not configure with --enable-experiment this will break! + You own the pieces and the troubles, you have been warned. + + + + +v0.91.4 17-Feb-2007 - 18-Feb-2007 upgrade: Because some directories will be moved, a special upgrade diff --git a/TODO b/TODO index 56a756d3..b2d24df5 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ $Id$ - MBSE BBS V0.91.4 TODO list. + MBSE BBS V0.91.5 TODO list. --------------------------- These are a list of things that must be implemented one way or diff --git a/configure b/configure index 8533405b..58588cad 100755 --- a/configure +++ b/configure @@ -1718,7 +1718,7 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbutils mbnntp mbtask mbsetup unix lang PACKAGE="mbsebbs" MAJOR="0" MINOR="91" -REVISION="4" +REVISION="5" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2007 Michiel Broek, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2007 M. Broek" diff --git a/configure.in b/configure.in index c2e67127..dc43f9df 100644 --- a/configure.in +++ b/configure.in @@ -13,7 +13,7 @@ dnl PACKAGE="mbsebbs" MAJOR="0" MINOR="91" -REVISION="4" +REVISION="5" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2007 Michiel Broek, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2007 M. Broek" diff --git a/lib/charset.c b/lib/charset.c index 24e28780..9130bba6 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -4,7 +4,7 @@ * Purpose ...............: Characterset functions * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -31,6 +31,7 @@ #include "../config.h" #include "mbselib.h" +#ifndef USE_EXPERIMENT #define BUF_APPEND(d,s) str_append(d,sizeof(d),s) @@ -105,6 +106,7 @@ char *str_copy(char *d, size_t n, char *s) #define BUF_COPY(d,s) str_copy (d,sizeof(d),s) +#endif char *getftnchrs(int val) { @@ -202,6 +204,7 @@ char *getchrsdesc(int val) } +#ifndef USE_EXPERIMENT /* * Alloc new CharsetTable and put into linked list @@ -481,4 +484,5 @@ int charset_set_in_out(char *in, char *out) return FALSE; } +#endif diff --git a/lib/mbcharsetc.c b/lib/mbcharsetc.c index 65b7f00c..d88070da 100644 --- a/lib/mbcharsetc.c +++ b/lib/mbcharsetc.c @@ -5,7 +5,7 @@ * Author ................: Martin Junius, for Fidogate * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -60,6 +60,9 @@ #include "../config.h" #include "mbselib.h" + +#ifndef USE_EXPERIMENT + #include "mbcharsetc.h" @@ -386,3 +389,14 @@ int main(int argc, char **argv) exit(ret); } +#else + + +int main(int argc, char **argv) +{ + printf("program disabled by configure option\n"); + exit(0); +} + +#endif + diff --git a/lib/mbselib.h b/lib/mbselib.h index af66dc50..aa72d612 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -2578,6 +2578,8 @@ int create_tmpwork(void); /* Create tmp workdir */ * Charset mapping */ +#ifndef USE_EXPERIMENT + #define MAX_CHARSET_NAME 16 #define MAX_CHARSET_IN 128 #define MAX_CHARSET_OUT 4 @@ -2599,11 +2601,16 @@ typedef struct st_charset_table { struct st_charset_table *next; } CharsetTable; +#endif + char *getftnchrs(int); /* Return FTN characterset name */ char *getrfcchrs(int); /* Return RFC characterset name */ char *getlocale(int); /* Return locale name */ char *getchrsdesc(int); /* Return characterset description */ + +#ifndef USE_EXPERIMENT + CharsetTable *charset_table_new(void); /* Add table to linked list */ CharsetAlias *charset_alias_new(void); /* Add alias to linked list */ int charset_write_bin(char *); /* Save charset.bin */ @@ -2614,6 +2621,7 @@ char *charset_alias_fsc(char *); /* Search FSC alias */ char *charset_alias_rfc(char *); /* Search RFC alias */ int charset_set_in_out(char *, char *); /* Setup mapping */ +#endif /**************************************************************************** diff --git a/mbfido/ftn2rfc.c b/mbfido/ftn2rfc.c index 2ac7c181..e2636aab 100644 --- a/mbfido/ftn2rfc.c +++ b/mbfido/ftn2rfc.c @@ -4,7 +4,7 @@ * Purpose ...............: Gate netmail->email or echomail->news * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -693,10 +693,12 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl Syslog('m', "Prepare is ready"); } +#ifndef USE_EXPERIMENT /* * Setup charset conversion */ charset_set_in_out(charset, getrfcchrs(msgs.Charset)); +#endif if (newsmode) { /* diff --git a/mbfido/mbfindex.c b/mbfido/mbfindex.c index 4574f9da..87acfc7e 100644 --- a/mbfido/mbfindex.c +++ b/mbfido/mbfindex.c @@ -4,7 +4,7 @@ * Purpose: File Database Maintenance - Build index for request processor * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -61,6 +61,31 @@ static char *months[]= {(char *)"Jan",(char *)"Feb",(char *)"Mar", (char *)"Jul",(char *)"Aug",(char *)"Sep", (char *)"Oct",(char *)"Nov",(char *)"Dec"}; +#ifdef USE_EXPERIMENT + +/* + * Translation table from Hi-USA-ANSI to low ASCII and HTML codes, + */ +char htmltab[] = { +"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" +"\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +"\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057" +"\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077" +"\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117" +"\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137" +"\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157" +"\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177" +"\103\374\351\342\344\340\345\143\352\353\350\357\357\354\304\305" /* done */ +"\311\346\306\364\366\362\374\371\171\326\334\244\243\245\120\146" /* done */ +"\341\355\363\372\361\321\141\157\277\055\055\275\274\241\074\076" /* done */ +"\043\043\043\174\053\053\053\053\053\043\174\043\043\053\053\053" /* done */ +"\053\053\053\053\053\053\053\053\043\043\043\043\043\075\043\053" /* done */ +"\053\053\053\053\053\053\053\053\053\053\053\043\043\043\043\043" /* done */ +"\141\102\114\156\105\157\265\370\060\060\060\157\070\330\145\156" /* doesn't look good */ +"\075\261\076\074\146\146\367\075\260\267\267\126\262\262\267\040" /* almost */ +}; + +#endif /* @@ -71,10 +96,17 @@ char *To_Html(char *inp) { static char temp[256]; int i; +#ifndef USE_EXPERIMENT char *xl; +#endif memset(&temp, 0, sizeof(temp)); +#ifdef USE_EXPERIMENT + strncpy(temp, inp, 80); + for (i = 0; i < strlen(temp); i++) + temp[i] = htmltab[temp[i] & 0xff]; +#else for (i = 0; i < strlen(inp); i++) { if (inp[i] & 0x80) { if ((xl = charset_map_c(inp[i], FALSE))) { @@ -87,6 +119,7 @@ char *To_Html(char *inp) } else temp[i] = inp[i]; } +#endif return temp; } @@ -598,11 +631,13 @@ void HtmlIndex(char *Lang) fileptr = ftell(fi); } +#ifndef USE_EXPERIMENT /* * Setup the correct table to produce file listings for the www. * This make ANSI grafics look a bit nicer with browsers. */ charset_set_in_out((char *)"cp437", (char *)"iso-8859-1"); +#endif for (i = 1; i <= iAreas; i++) { diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index ac17b6cd..4a70278a 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -4,7 +4,7 @@ * Purpose ...............: Convert RFC to FTN * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -83,7 +83,9 @@ int needputrfc(rfcmsg *, int); int charwrite(char *s, FILE *fp) { +#ifndef USE_EXPERIMENT char *o; +#endif if ((strlen(s) >= 3) && (strncmp(s,"---",3) == 0) && (s[3] != '-')) { putc('-',fp); @@ -91,11 +93,15 @@ int charwrite(char *s, FILE *fp) } while (*s) { +#ifdef USE_EXPERIMENT + putc(*s, fp); +#else o = s; if (s[0] &0x080) { o = charset_map_c(s[0], 0); } putc(*o, fp); +#endif s++; } return 0; @@ -337,10 +343,12 @@ int rfc2ftn(FILE *fp, faddr *recipient) if (fmsg->to) hdrsize += (fmsg->to->name)?strlen(fmsg->to->name):0; +#ifndef USE_EXPERIMENT /* * Setup charset conversion */ charset_set_in_out(charset,getrfcchrs(msgs.Charset)); +#endif do { Syslog('m', "rfc2ftn: split loop, splitpart = %d", splitpart); diff --git a/mbnntp/commands.c b/mbnntp/commands.c index 4997ff69..d61d62a5 100644 --- a/mbnntp/commands.c +++ b/mbnntp/commands.c @@ -3,7 +3,7 @@ * $Id$ * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -51,8 +51,10 @@ extern char *ttystat[]; void send_xlat(char *); +#ifndef USE_EXPERIMENT static CharsetAlias *charset_alias_list; static CharsetTable *charset_table_list; +#endif #define POST_MAXSIZE 10000 @@ -63,12 +65,16 @@ static CharsetTable *charset_table_list; */ void send_xlat(char *inp) { - char *xl, temp[1024]; + char temp[1024]; int i; +#ifndef USE_EXPERIMENT + char *xl; +#endif memset(&temp, 0, sizeof(temp)); for (i = 0; i < strlen(inp); i++) { +#ifndef USE_EXPERIMENT if (inp[i] & 0x80) { if ((xl = charset_map_c(inp[i], FALSE))) { while (*xl) { @@ -80,6 +86,9 @@ void send_xlat(char *inp) } else { temp[i] = inp[i]; } +#else + temp[i] = inp[i]; +#endif } Syslog('n', "> \"%s\"", printable(temp, 0)); @@ -116,7 +125,10 @@ void command_abhs(char *buf) { char *p, *cmd, *opt, *subj, *charset = NULL; unsigned int art = 0L; - int i, found; + int found; +#ifndef USE_EXPERIMENT + int i; +#endif Syslog('+', "%s", buf); cmd = strtok(buf, " \0"); @@ -195,6 +207,7 @@ void command_abhs(char *buf) } } while ((p = (char *)MsgText_Next()) != NULL); } +#ifndef USE_EXPERIMENT if (charset) { if ((charset_alias_list == NULL) || (charset_table_list == NULL)) charset_read_bin(); @@ -205,7 +218,8 @@ void command_abhs(char *buf) } } } - +#endif + // We don't do translation to the users charset, the news reader must do that. // charset_set_in_out(getrfcchrs(msgs.Charset),getrfcchrs(usercharset)); @@ -231,8 +245,10 @@ void command_abhs(char *buf) */ send_nntp("MIME-Version: 1.0"); if (charset) { +#ifndef USE_EXPERIMENT send_nntp("Content-Type: text/plain; charset=%s", charset_alias_rfc(charset)); } else if (msgs.Charset != FTNC_NONE) { +#endif send_nntp("Content-Type: text/plain; charset=%s", getrfcchrs(msgs.Charset)); } else if (usercharset != FTNC_NONE) { send_nntp("Content-Type: text/plain; charset=%s", getrfcchrs(usercharset)); diff --git a/mbnntp/rfc2ftn.c b/mbnntp/rfc2ftn.c index aab21cff..f2a4d61e 100644 --- a/mbnntp/rfc2ftn.c +++ b/mbnntp/rfc2ftn.c @@ -4,7 +4,7 @@ * Purpose ...............: Convert RFC to FTN * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -79,19 +79,25 @@ int needputrfc(rfcmsg *, int); int charwrite(char *, FILE *); int charwrite(char *s, FILE *fp) { +#ifndef USE_EXPERIMENT char *o; +#endif if ((strlen(s) >= 3) && (strncmp(s,"---",3) == 0) && (s[3] != '-')) { putc('-',fp); putc(' ',fp); } while (*s) { +#ifdef USE_EXPERIMENT + putc(*s, fp); +#else o=s; if (s[0] &0x080) { o=charset_map_c(s[0],0); } // putc(*s, fp); putc (*o,fp); +#endif s++; } return 0; @@ -286,7 +292,9 @@ int rfc2ftn(FILE *fp) Syslog('m', "No charset, setting default to iso-8859-1"); } +#ifndef USE_EXPERIMENT charset_set_in_out(charset,getrfcchrs(msgs.Charset)); +#endif if ((p = hdr((char *)"Message-ID",msg))) { if (!removemsgid) diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index fff448a4..3d7a422b 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -79,7 +79,11 @@ extern int rows; /* * Internal prototypes */ +#ifdef USE_EXPERIMENT +void ShowMsgHdr(void); /* Show message header */ +#else void ShowMsgHdr(int Conv); /* Show message header */ +#endif int Read_a_Msg(unsigned int Num, int);/* Read a message */ int Export_a_Msg(unsigned int Num);/* Export message to homedir */ int ReadPanel(void); /* Read panel bar */ @@ -893,13 +897,20 @@ int Save_Msg(int IsReply, faddr *Dest) /* * Show message header screen top for reading messages. */ +#ifdef USE_EXPERIMENT +void ShowMsgHdr(void) +#else void ShowMsgHdr(int Conv) +#endif { static char Buf1[35], Buf2[35], Buf3[81]; char msg[81]; struct tm *tm; time_t now; - int color, i; + int color; +#ifndef USE_EXPERIMENT + int i; +#endif Buf1[0] = '\0'; Buf2[0] = '\0'; @@ -987,6 +998,9 @@ void ShowMsgHdr(int Conv) /* Subject : */ pout(YELLOW, BLACK, (char *) Language(210)); +#ifdef USE_EXPERIMENT + pout(GREEN, BLACK, Msg.Subject); +#else colour(GREEN, BLACK); if (Conv) { @@ -999,6 +1013,7 @@ void ShowMsgHdr(int Conv) } else { PUTSTR(Msg.Subject); } +#endif Enter(1); colour(CFG.HiliteF, CFG.HiliteB); @@ -1171,8 +1186,11 @@ int Export_a_Msg(unsigned int Num) int Read_a_Msg(unsigned int Num, int UpdateLR) { char *p = NULL, *fn, *charset = NULL, *charsin = NULL, *charsout = NULL; - int i, ShowMsg = TRUE, UseIconv = FALSE; + int ShowMsg = TRUE, UseIconv = FALSE; lastread LR; +#ifndef USE_EXPERIMENT + int i; +#endif LastNum = Num; iLineCount = 7; @@ -1270,6 +1288,7 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) /* * Try to setup charset mapping if the charactersets are different. */ +#ifndef USE_EXPERIMENT if (charsin && charsout && strcmp(charsout, charsin)) { UseIconv = charset_set_in_out(charsin, charsout); } @@ -1277,6 +1296,9 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) * Show message header with charset mapping if needed. */ ShowMsgHdr(UseIconv); +#else + ShowMsgHdr(); +#endif /* * Show message text @@ -1297,6 +1319,10 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) if (strchr(p, '>') != NULL) if ((strlen(p) - strlen(strchr(p, '>'))) < 10) colour(CFG.HiliteF, CFG.HiliteB); +#ifdef USE_EXPERIMENT + PUTSTR(p); + Enter(1); +#else if (UseIconv) { /* * Try to translate character sets @@ -1309,6 +1335,7 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) PUTSTR(p); Enter(1); } +#endif if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE, UseIconv)) break; @@ -1975,7 +2002,11 @@ int CheckLine(int FG, int BG, int Email, int Conv) if (Email) ShowEmailHdr(); else +#ifdef USE_EXPERIMENT + ShowMsgHdr(); +#else ShowMsgHdr(Conv); +#endif colour(FG, BG); } return FALSE; diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index ebf2a53d..7888754e 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -371,6 +371,13 @@ int main(int argc, char **argv) Enter(1); } + /* + * Some debugging for me + */ + Syslog('b', "setlocale(LANG, NULL) returns \"%s\"", printable(setlocale(LANG, NULL), 0)); + Syslog('b', "setlocale(LC_CTYPE, NULL) returns \"%s\"", printable(setlocale(LC_CTYPE, NULL), 0)); + Syslog('b', "setlocale(LC_ALL, NULL) returns \"%s\"", printable(setlocale(LC_ALL, NULL), 0)); + snprintf(sMailbox, 21, "mailbox"); colour(LIGHTGRAY, BLACK); user();