From c5e7083debba4354e0e0afa38e6e8cbefcb83c68 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 25 Feb 2007 20:28:00 +0000 Subject: [PATCH] System update to UTF-8 --- ChangeLog | 43 ++++++- examples/templates-de.tar | Bin 81920 -> 81920 bytes examples/templates-en.tar | Bin 81920 -> 81920 bytes examples/templates-es.tar | Bin 81920 -> 81920 bytes examples/templates-nl.tar | Bin 81920 -> 81920 bytes examples/txtfiles-en.tar | Bin 81920 -> 40960 bytes examples/txtfiles-es.tar | Bin 71680 -> 40960 bytes html/menus/control.html | 4 +- lang/Language.xref | 6 +- lang/germandu.txt | 6 +- lang/source.de | 6 +- lang/source.en | 6 +- lang/source.es | 6 +- lang/source.fr | 6 +- lang/source.gl | 6 +- lang/source.nl | 6 +- lang/source.zh | 6 +- lib/charset.c | 89 +++++++++++-- lib/mbdiesel.c | 14 ++ lib/mbselib.h | 6 +- lib/users.h | 4 +- mbfido/ftn2rfc.c | 5 +- mbfido/makestat.c | 34 ++--- mbfido/mbfindex.c | 69 ++-------- mbfido/rfc2ftn.c | 61 ++------- mbnntp/commands.c | 2 +- mbnntp/rfc2ftn.c | 25 +--- mbsebbs/change.c | 28 +--- mbsebbs/change.h | 1 - mbsebbs/dispfile.c | 128 +++++++++---------- mbsebbs/dispfile.h | 6 +- mbsebbs/door.c | 6 +- mbsebbs/email.c | 6 +- mbsebbs/fsedit.c | 106 ++++++++------- mbsebbs/fsedit.h | 8 +- mbsebbs/lastcallers.c | 66 +++++----- mbsebbs/mail.c | 86 +++---------- mbsebbs/mail.h | 2 +- mbsebbs/mbnewusr.c | 8 +- mbsebbs/mbsebbs.c | 6 - mbsebbs/menu.c | 4 - mbsebbs/misc.c | 3 +- mbsebbs/newuser.c | 17 +-- mbsebbs/offline.c | 5 +- mbsebbs/pinfo.c | 190 ++++++++++++++++----------- mbsebbs/pinfo.h | 4 +- mbsebbs/term.c | 263 ++++++++++++++++++++++++-------------- mbsebbs/term.h | 11 +- mbsebbs/user.c | 12 +- mbsebbs/userlist.c | 38 ++++-- mbsebbs/whoson.c | 49 +++---- mbsetup/ledit.c | 1 - 52 files changed, 754 insertions(+), 710 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb8293e2..48d4cbde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,12 +3,45 @@ $Id$ 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. + With this version de default internal character encoding is + UTF-8. BBS users who have a UTF-8 terminal can use the bbs in + UTF-8 mode and should have no troubles at all reading and + writing messages in several language encodings. - Even BETTER: Do not use at all, currently there is unfinished code - and some things don't work right now. - FSP-1030 Unicode character set in FidoNet messages. + upgrade: + In all macro files html.* change the charset to UTF-8. + If you still have all default macro files thein in the source + directory mbsebbs/examples simply run "make macros" to install + the updated versions. + Run "mbfile index -f " once to regenerate all download html + index pages with UTF-8 encoding. Check the error.log for + errors. + + mbsebbs: + Added terminal setting UTF-8. + Removed setting ANSI/Textmode, allways graphic now. + All *.asc textfiles are now obsolete, only *.ans are valid. + Display ansi file converts to UTF-8 if the user has UTF-8. + Email and FTN mail reading now translates to the users + characterset using glibc iconv. + Changed menus lastcallers, whoson, userlist, pinfo, fsedit to + output UTF-8 code if the user has set that terminal setting. + + mbfile: + The index command produces UTF-8 webpages. + + mbfido: + The make web stat produces UTF-8 webpages. + + mbnntp: + Reading news outputs UTF-8 coded articles. + TODO: test posting and fix if needed. + + lang: + Language prompts 44, 75 and 76 are obsolete. + + examples: + Upgraded the html macro templates to produce UTF-8 web pages. diff --git a/examples/templates-de.tar b/examples/templates-de.tar index 34c15d8e9cbd5136496ab7d7658dce9a62845958..ef33e03ca580506b243e8a929792f9a7d4cb6eb2 100644 GIT binary patch delta 1133 zcmZXTy-OTH7{+hJ-96$PuwgDoJIdSc!#L*$5)|QRJQVyxW;=cc0(;%=5f6wVGF}d24CFloF+gCYOWL z2_a+gP;09v?GJ!T<$NAUeN-1dKTFGI2y@g?b6`knN(FE(OO#0=WhsKSN0*p3o&U=G zkB2(~umyrkY70affacmUR%s;w5U906y=;~(KOrf%$4y`vv@q_i8AqiXZz?N;;|R-T z7OP`QyXtwjjJEk)C+tTztit*s?g|!df#MWRAQqho4QvCLd!VI4Y{>{m?W`0x;neNhp z85;X>j()si(XUT_XY^S;1d*fFgST7m`KLUcRCdbS6Bk>734c`&X>Nkds^f)wc758L z@BQoDjE{8ML#*!bt(xKiA67p5uU;bC2Wa8i{$%J=QV&u8xN(8^4_S)4v)Ms1nm>H& Wwn}_IdA{nU!^Auw?S%aik?23QH$f@@ delta 1634 zcma)+ziSjh6vuZ$cJ~q_1_f`cu>U|{=DnGnXcG_%1yK)sE48o^|AIr@Lr#l07pAgG z5ky2VCkci$*NII!u@Nl9MmxpAU-;(Mz;43bbDLe3d7u5h_x%F9HBWVkX1r~~;DHV|2+}t1kisvs}y}Z1#Vooosq1gB_=brW2 z#Q_S9GK50Kqn>x_sKID|YuI}EHFmoVoQ4WVIh>yHy^D3+urqp^xYuPyqo}&n7Q(Zl z>9AeC*=w*y`)3mOw#;Zd5lcxlv;{(&pn=u(?qP%V=>4t4eJnGIZl%kBq3siNQL9Xk zpB~g%G4wxgBz{KJJkU7S_aByS z&kEBJNWh)Xb7C>^i=xa5JV=Q~6Lu&-!AaacAyym6&S-b%Ph0$s{gR-lBXUvS%tihe DFo=Os diff --git a/examples/templates-en.tar b/examples/templates-en.tar index c3a4b5bc8f1d95f3fd936c163899bc06c29607a9..81f0e9ef670b0ce82f11c782ff4e433f89e8f513 100644 GIT binary patch delta 1166 zcmZWoJxClu6uuGn){{fz0^U`!*av3b{Mnf_hlPbo(xsR zFI(g9Q~7KRR0QvHc^&bb`uGLJGo=IkQablYYDxu2pf$>*kcfeuiBkrt2Pi)SSyCZ{ zix6B0525lHv;hB8%Xu>fC=K0k-E_wB6hdoHaUE;HPy5WxQjyBw{e`Iol#hRTUyJnL zw}V>lfAFeG{l-tN&=oQZF>nzIH2OfMDvh_;3y8oy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??DXP3y#ig|-T~xYcssjArXKHM&v3#aJLZR>7sD zfcnfSxRPvBj!&^=IF}V4A+@@hSmQ`QY z{IC;pgO&~Q!#nnP#D3oLDpTHi2i{ndW*VJh4Z8PJE}Xx7VWrctr&eIt-F`CK+FaWo z9u1c41P6$8oM;Uioa6j{+^yk?@pl&uw>ITy_0uyMJ`a}se<=KNw~8E{{q~{= zJN=f!EL~S<=%w3|BwGH`{BgR*+xac?xK|LcZinY;9_PYViO;_t5Qp=4gpd}hHKXMw bW_(PXsUTmDPl#VKwgrv8MhB;JWa diff --git a/examples/templates-nl.tar b/examples/templates-nl.tar index c9916f2cd251103b084ac7151a1df1bfc7ef1d48..91e1cb1ed6271853a9d6dc665bae837f6944366e 100644 GIT binary patch delta 1156 zcmZWoziSjh6uwbrcN2~kJcx^h92R0D%NsC_RF7arFUatX~8za!`o8!EvEn`Ypt~-otr9n_k{<~CSjJ_NHz3Mjr z)dnc3!6OD3mkKKlGG2FiDulq(55`%`Pidyxa*tpcOyYP$*M(&$?D8ZmLn>tcEG)xf z^b5R^2T-VGvQB1KzX&Mlz^PRHjiF!#0G#UB0~#+e2bu2eCEBLH4$jYrMnR zvO>wBLM}ND_U>{*H;4D{tnY4IAs=T)`*&A%`n3A+`ntAOMttS@R$!ayV;b}G!&6E- z{;7`20tz}Gzy<+0rS`2Z9<~I!$G=lQz~{1nb8Fa2c(&&FNWUyv?3Z6ly1PgT@UuGm z_Nve-(lB0wUpVydbxY&Hk16#N{45I$YqJB`N2mb(7ze9FF9qh%;ite|BcZ^EZGt<)_jOQ^L2O@l fk5}g18{`jlw+I{-=jeahzfFqS*1ZX-dRzYh9LYq4 delta 1671 zcma)+ziSjh6vuaz-AxX;90+j{lp}~;VCK!dnX?jXyc8n&@fV1dwWL0f4RTn-IT$Td z1xs@)iCRc1OR=&ND+|e`2!S+W;hVc~@ou>t7nX%(-eM?jSj7Tl=8qKxk8JhJPZc=_j)V2rXy}NtsJ5RKhl8V9Ct1!wUzaU%dHmP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pUd8&0)giFre|n0r=FRoFT*JAY;fF*G``fdib~|o<6?w_UR)vwJ$G>T%KBlogbgMSW`bU zJ~O&7zBn}kJ9X>N*6>>p7RK*_zjT`^*fGD|^ptL!Un1}mXw-iChVY*x9BwvvPPJ># zZ?+zw7!KO_W}uPJTYqY=Zw}cYzuoMzK^|>>%LYlmK4ODx?}7a1b=8KWykV#MbJb$$tGE JA3nSX{|9=pnrHw3 diff --git a/html/menus/control.html b/html/menus/control.html index 29e0d3f9..291c1674 100644 --- a/html/menus/control.html +++ b/html/menus/control.html @@ -14,7 +14,7 @@
-
Last update 05-Mar-2006
+
Last update 25-Feb-2007

MBSE BBS Control Codes in ANSI and ASCII files


@@ -101,7 +101,7 @@ For example: ^B32000^BThis is the text^B
M User's screen length N User's first name O User's last name - P User's graphics mode (On/Off) + P User's graphics mode allways (On). Q User's news bulletins (On/Off) R User's hot-keys (On/Off) S User's daily time limit diff --git a/lang/Language.xref b/lang/Language.xref index 26f62000..352942b3 100644 --- a/lang/Language.xref +++ b/lang/Language.xref @@ -42,7 +42,7 @@ 41 newuser.c user.c |Your passwords do not match! Try again. 42 newuser.c change.c user.c |Your password must contain at least 43 newuser.c change.c user.c |characters! Try again. -44 newuser.c YN|Do you want ANSI and graphics mode [Y/n]: +44 | 45 newuser.c change.c |Please enter you Voice Number 46 mail.c |Message exported to your private directory as: 47 newuser.c change.c |Please enter a proper phone number @@ -73,8 +73,8 @@ 72 misc.c |Could not find 73 change.c |Old Location: 74 change.c |Please enter a longer location (min -75 change.c |Ansi Mode turned ON -76 change.c |Ansi Mode turned OFF +75 | +76 | 77 mail.c |Message doesn't exist 78 change.c |News bulletins turned ON 79 change.c |News bulletins turned OFF diff --git a/lang/germandu.txt b/lang/germandu.txt index 842784d4..00e33905 100644 --- a/lang/germandu.txt +++ b/lang/germandu.txt @@ -42,7 +42,7 @@ YN|Check for new files at login [Y/n]: |Die Passwoerter stimmen nicht ueberein! Bitte wiederholen. |Dein Passwort muss mindestens |Zeichen enthalten! Bitte wiederholen. -JN|Moechtest Du den ANSI Anzeigemodus verwenden [a/ein]: +| |Bitte gib Deine Telefonnummer an: |Die Mitteilung wurde in Dein privates Verzeichnis gespeichert als: |Bitte gib Deine vollstaendige Telefonnummer an: @@ -73,8 +73,8 @@ JN|Moechtest Du Menues mit "Hot-Keys" verwenden? [a/ein]: |Unbekannt |Bisheriger Ort: |Bitte gib eine laengere Bezeichung fuer den Ort ein (min -|Ansi Modus ist jetzt EIN -|Ansi Modus ist jetzt AUS +| +| |Die Mitteilung existiert nicht |System-Mitteilungen sind jetzt EIN |System-Mitteilungen sind jetzt AUS diff --git a/lang/source.de b/lang/source.de index c833af5f..77661d52 100644 --- a/lang/source.de +++ b/lang/source.de @@ -42,7 +42,7 @@ JN|Beim Login nach neuen Dateien suchen [J/n]: |Die Passwoerter stimmen nicht ueberein! Bitte wiederholen. |Ihr Passwort muss mindestens |Zeichen enthalten! Bitte wiederholen. -JN|Moechten Sie den ANSI Anzeigemodus verwenden [J/n]: +| |Bitte geben Sie Ihre Telefonnummer an: |Die Mitteilung wurde in Ihr privates Verzeichnis gespeichert als: |Bitte geben Sie eine vollstaendige Telefonnummer an: @@ -73,8 +73,8 @@ JN|Moechten Sie in den Menues "Hot-Keys" verwenden? [J/n]: |Unbekannt |Bisheriger Ort: |Bitte geben Sie eine laengere Bezeichung fuer den Ort ein (min -|Ansi Modus ist jetzt EIN -|Ansi Modus ist jetzt AUS +| +| |Die Mitteilung existiert nicht |System-Mitteilungen sind jetzt EIN |System-Mitteilungen sind jetzt AUS diff --git a/lang/source.en b/lang/source.en index 0641d2a9..fe59fb68 100644 --- a/lang/source.en +++ b/lang/source.en @@ -42,7 +42,7 @@ YN|Check for new files at login [Y/n]: |Your passwords do not match! Try again. |Your password must contain at least |characters! Try again. -YN|Do you want ANSI and graphics mode [Y/n]: +| |Please enter you Voice Number |Message exported to your private directory as: |Please enter a proper phone number @@ -73,8 +73,8 @@ YN|Would you like Hot-Keyed menus? [Y/n]: |Could not find |Old Location: |Please enter a longer location (min -|Ansi Mode turned ON -|Ansi Mode turned OFF +| +| |Message doesn't exist |News bulletins turned ON |News bulletins turned OFF diff --git a/lang/source.es b/lang/source.es index 849811bf..aa92a46f 100644 --- a/lang/source.es +++ b/lang/source.es @@ -42,7 +42,7 @@ YN|Check for new files at login [Y/n]: |­No coinciden! Vuelta a empezar... |El password debe tener como m¡nimo |caracteres. Vuelta a empezar... -SN|¨Quieres gr ficos ANSI [S/n]: +| |Teclea tu n£mero de tel‚fono de VOZ |Mensaje exportado a tu directorio privado como: |N£mero de tel‚fono incorrecto. Repite... @@ -73,8 +73,8 @@ SN| |No encuentro |Localidad anterior : |Localidad demasiado corta: (min. -|Modo ANSI activado -|Modo ANSI desactivado +| +| |No existe el mensaje |Noticias activadas |Noticias desactivadas diff --git a/lang/source.fr b/lang/source.fr index 5344f8cb..9658aab8 100644 --- a/lang/source.fr +++ b/lang/source.fr @@ -42,7 +42,7 @@ YN|Check for new files at login [Y/n]: |Vos mots de passe ne sont pas identiques. Essayez encore. |Votre mot de passe doit contenir au moins |caractères! Essayez encore. -ON|Voulez vous le mode graphique ANSI [O/n]: +| |Veuillez entrer votre numéro "voix" |Message exporté dans votre répertoire perso sous le nom: |Veuillez entrer un numéro de téléphone valable: @@ -73,8 +73,8 @@ ON|Voulez vous les menus Hot-Keyed ? [O/n]: |Ne peut pas trouver |Ancienne ville : |veuillez entrer un nom plus long (min -|Ansi Mode est ON -|Ansi Mode est OFF +| +| |Message n'existe pas |News bulletins est ON |News bulletins est OFF diff --git a/lang/source.gl b/lang/source.gl index 8fdb56e5..211cf51d 100644 --- a/lang/source.gl +++ b/lang/source.gl @@ -42,7 +42,7 @@ YN|Check for new files at login [Y/n]: |­Non coinciden! Volta a empezar... |A password debe ter como m¡nimo |caracteres. Volta a empezar... -SN|¨Queres gr ficos ANSI [S/n]: +| |Teclea o teu n£mero de tel‚fono de VOZ |Mensaxe exportado ¢ teu directorio privado como: |N£mero de tel‚fono incorrecto. Repite... @@ -73,8 +73,8 @@ SN| |Non topo |Localidade anterior : |Localidade demasiado curta: (min. -|Modo ANSI activado -|Modo ANSI desactivado +| +| |Non existe a mensaxe |Novas activadas |Novas desactivadas diff --git a/lang/source.nl b/lang/source.nl index a6a63ff6..5c9eef13 100644 --- a/lang/source.nl +++ b/lang/source.nl @@ -42,7 +42,7 @@ JN|Kijk voor nieuwe bestanden tijdens login [J/n]: |De wachtwoorden zijn niet gelijk! Opnieuw. |Uw wachtwoord moet minstens |karakters bevatten! Opnieuw. -JN|Wilt U ANSI karakters en kleuren [J/n]: +| |Geef Uw Spraak Telefoonnummer |Bericht weggeschreven naar Uw prive directory als: |Geef het nummer in een goed formaat @@ -73,8 +73,8 @@ JN|Wilt U sneltoets menus? [J/n]: |Niet gevonden |Oude woonplaats: |Geef een langere woonplaats naam (minimaal -|ANSI kleuren staan nu AAN -|ANSI kleuren staan nu UIT +| +| |Bericht bestaat niet |News berichten staan nu AAN |News berichten staan nu UIT diff --git a/lang/source.zh b/lang/source.zh index 6f6633b2..25a4df3a 100644 --- a/lang/source.zh +++ b/lang/source.zh @@ -42,7 +42,7 @@ YN|Check for new files at login [Y/n]: |Á½´ÎÊäÈëµÄÃÜÂ벻ͬ! ÖØÊÔ. |ÄãµÄÃÜÂ볤¶È²»ÄÜÉÙÓÚ |¸ö×Ö·û! ÖØÊÔ. -YN|Do you want ANSI and graphics mode [Y/n]: +| |Please enter you Voice Number |Message exported to your private directory as: |Please enter a proper phone number @@ -73,8 +73,8 @@ YN|Would you like Hot-Keyed menus? [Y/n]: |Could not find |Old Location: |Please enter a longer location (min -|Ansi Mode turned ON -|Ansi Mode turned OFF +| +| |Message doesn't exist |News bulletins turned ON |News bulletins turned OFF diff --git a/lib/charset.c b/lib/charset.c index 58d29c9d..ff9b7904 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -34,6 +34,7 @@ int use_tran1 = FALSE; /* Translate stage 1 active */ int use_tran2 = FALSE; /* Translate stage 2 active */ +int loglevel = '-'; /* Debug loglevel */ iconv_t cd1; /* Conversion descriptor 1 */ iconv_t cd2; /* Conversion descriptor 2 */ @@ -82,7 +83,7 @@ struct _charmap charmap[] = { {FTNC_CP850, (char *)"CP850 2", (char *)"iso-8859-1", (char *)"CP850", (char *)"ISO-8859-1", (char *)"en_US", (char *)"IBM codepage 850 (Latin-1)"}, {FTNC_LATIN_2,(char *)"LATIN-2 2",(char *)"iso-8859-2", (char *)"LATIN2", (char *)"ISO-8859-2", (char *)"cs_CZ", (char *)"ISO 8859-2 (Eastern European)"}, {FTNC_CP852, (char *)"CP852 2", (char *)"iso-8859-2", (char *)"CP852", (char *)"ISO-8859-2", (char *)"cs_CZ", (char *)"IBM codepage 852 (Czech, Latin-1)"}, - {FTNC_CP895, (char *)"CP895 2", (char *)"iso-8859-2", (char *)"CP895", (char *)"ISO-8859-2", (char *)"cs_CZ", (char *)"IBM codepage 895 (Czech, Kamenicky)"}, + {FTNC_CP895, (char *)"CP895 2", (char *)"iso-8859-2", (char *)"CP850", (char *)"ISO-8859-2", (char *)"cs_CZ", (char *)"IBM codepage 895 (Czech, Kamenicky)"}, {FTNC_LATIN_5,(char *)"LATIN-5 2",(char *)"iso-8859-5", (char *)"LATIN5", (char *)"ISO-8859-5", (char *)"turks", (char *)"ISO 8859-5 (Turkish)"}, {FTNC_CP866, (char *)"CP866 2", (char *)"iso-8859-5", (char *)"CP866", (char *)"ISO-8859-5", (char *)"ru_RU", (char *)"IBM codepage 866 (Russian)"}, {FTNC_LATIN_9,(char *)"LATIN-9 2",(char *)"iso-8859-15",(char *)"LATIN-9", (char *)"ISO-8859-15",(char *)"en_US", (char *)"ISO 8859-1 (Western European EURO)"}, @@ -104,7 +105,7 @@ int find_ftn_charset(char *ftnkludge) int j; char *ftn, *cmp; - Syslog('n', "find_ftn_charset(%s)", ftnkludge); + Syslog(loglevel, "find_ftn_charset(%s)", ftnkludge); ftn = calloc(80, sizeof(char)); cmp = calloc(80, sizeof(char)); @@ -123,7 +124,7 @@ int find_ftn_charset(char *ftnkludge) } if (charalias[i].alias != NULL) { - Syslog('n', "found alias %s", charalias[i].ftnkludge); + Syslog(loglevel, "found alias %s", charalias[i].ftnkludge); snprintf(ftn, 80, "%s", charalias[i].ftnkludge); } @@ -151,7 +152,7 @@ int find_ftn_charset(char *ftnkludge) return FTNC_ERROR; } - Syslog('n', "find_ftn_charset(%s) result %d", ftnkludge, i); + Syslog(loglevel, "find_ftn_charset(%s) result %d", ftnkludge, i); return i; } @@ -197,6 +198,46 @@ char *getrfcchrs(int val) +char *get_ic_ftn(int val) +{ + int i; + static char ic_ftnname[20]; + + for (i = 0; (charmap[i].ftncidx != FTNC_ERROR); i++) { + if (val == charmap[i].ftncidx) { + snprintf(ic_ftnname, 20, "%s", charmap[i].ic_ftn); + return ic_ftnname; + } + } + + /* + * Not found, return a default + */ + return (char *)"LATIN1"; +} + + + +char *get_ic_rfc(int val) +{ + int i; + static char ic_rfcname[20]; + + for (i = 0; (charmap[i].ftncidx != FTNC_ERROR); i++) { + if (val == charmap[i].ftncidx) { + snprintf(ic_rfcname, 20, "%s", charmap[i].ic_rfc); + return ic_rfcname; + } + } + + /* + * Not found, return a default + */ + return (char *)"iso-8859-1"; +} + + + /* * Experimental table that should translate from the user selected * charset to a locale. This is not the right way to do, the best @@ -249,17 +290,19 @@ char *getchrsdesc(int val) * charactersets are given, the translation is off. * On success return 0, on error return -1 and write errorlog. */ -int chartran_init(char *fromset, char *toset) +int chartran_init(char *fromset, char *toset, int logl) { + loglevel = logl; + if (use_tran1 || use_tran2) { WriteError("chartran_init() called while still open"); chartran_close(); } - Syslog('-', "chartran_init(%s, %s)", fromset, toset); + Syslog(loglevel, "chartran_init(%s, %s)", fromset, toset); if (strcmp(fromset, toset) == 0) { - Syslog('-', "nothing to translate"); + Syslog(loglevel, "nothing to translate"); return 0; } @@ -273,10 +316,13 @@ int chartran_init(char *fromset, char *toset) } if (strcmp(toset, (char *)"UTF-8")) { - cd2 = iconv_open(toset, (char *)"UTF-8"); - if (cd2 != (iconv_t)-1) { - WriteError("$chartran_init(%s, %s): iconv_open(%s, UTF-8s) error", fromset, toset, toset); - chartran_close(); + cd2 = iconv_open(toset, "UTF-8"); + if (cd2 == (iconv_t)-1) { + WriteError("$chartran_init(%s, %s): iconv_open(%s, UTF-8) error", fromset, toset, toset); + if (use_tran1) { + iconv_close(cd1); + use_tran1 = FALSE; + } return -1; } use_tran2 = TRUE; @@ -292,7 +338,7 @@ int chartran_init(char *fromset, char *toset) */ void chartran_close(void) { - Syslog('-', "chartran_close()"); + Syslog(loglevel, "chartran_close()"); if (use_tran1) { iconv_close(cd1); use_tran1 = FALSE; @@ -318,6 +364,7 @@ char *chartran(char *input) char *in, *out; memset(&outbuf, 0, sizeof(outbuf)); + memset(&temp, 0, sizeof(temp)); /* * Transparant @@ -340,6 +387,10 @@ char *chartran(char *input) WriteError("$iconv(%s) cd1", printable(input, 0)); strncpy(outbuf, input, sizeof(outbuf) -1); } + if (strcmp(input, outbuf)) { + Syslog(loglevel, "i %s", printable(input, 0)); + Syslog(loglevel, "u %s", printable(outbuf, 0)); + } return outbuf; } @@ -356,6 +407,10 @@ char *chartran(char *input) WriteError("$iconv(%s) cd2", printable(input, 0)); strncpy(outbuf, input, sizeof(outbuf) -1); } + if (strcmp(input, outbuf)) { + Syslog(loglevel, "u %s", printable(input, 0)); + Syslog(loglevel, "o %s", printable(outbuf, 0)); + } return outbuf; } @@ -372,6 +427,10 @@ char *chartran(char *input) strncpy(outbuf, input, sizeof(outbuf) -1); return outbuf; } + if (strcmp(input, temp)) { + Syslog(loglevel, "i %s", printable(input, 0)); + } + inSize = strlen(temp); outSize = sizeof(outbuf); in = temp; @@ -381,6 +440,12 @@ char *chartran(char *input) WriteError("$iconv(%s) cd2", printable(temp, 0)); strncpy(outbuf, input, sizeof(outbuf) -1); } + if (strcmp(input, temp) || strcmp(temp, outbuf)) { + Syslog(loglevel, "u %s", printable(temp, 0)); + } + if (strcmp(temp, outbuf)) { + Syslog(loglevel, "o %s", printable(outbuf, 0)); + } return outbuf; } diff --git a/lib/mbdiesel.c b/lib/mbdiesel.c index f80e896f..1d13a384 100644 --- a/lib/mbdiesel.c +++ b/lib/mbdiesel.c @@ -255,6 +255,7 @@ void html_massage(char *inbuf, char *outbuf, size_t size) case '&': snprintf(outptr, size, "&"); break; case '<': snprintf(outptr, size, "<"); break; case '>': snprintf(outptr, size, ">"); break; +/* Not needed for UTF-8 output. case 160: snprintf(outptr, size, " "); break; case 161: snprintf(outptr, size, "¡"); break; case 162: snprintf(outptr, size, "¢"); break; @@ -351,6 +352,7 @@ void html_massage(char *inbuf, char *outbuf, size_t size) case 253: snprintf(outptr, size, "ý"); break; case 254: snprintf(outptr, size, "þ"); break; case 255: snprintf(outptr, size, "ÿ"); break; +*/ default: *outptr++ = *inptr; *outptr = '\0'; break; } while (*outptr) @@ -410,6 +412,18 @@ FILE *OpenMacro(const char *filename, int Language, int htmlmode) if (fi == NULL) WriteError("OpenMacro(%s, %c): not found", filename, Language); else { + /* + * Check macro file for update correct charset. + */ + while (fgets(linebuf, sizeof(linebuf) -1, fi)) { + if (strcasestr(linebuf, (char *)"text/html")) { + if (! strcasestr(linebuf, (char *)"UTF-8")) { + WriteError("Macro file %s doesn't define 'Content-Type' content='text/html; charset=UTF-8'", temp); + } + } + } + rewind(fi); + snprintf(temp, PATH_MAX -1, "%s-%s", OsName(), OsCPU()); if (CFG.aka[0].point) snprintf(aka, 80, "%d:%d/%d.%d@%s", CFG.aka[0].zone, CFG.aka[0].net, CFG.aka[0].node, CFG.aka[0].point, CFG.aka[0].domain); diff --git a/lib/mbselib.h b/lib/mbselib.h index 2d3d4281..e3a1833e 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -1039,7 +1039,7 @@ struct sysconfig { securityrec newuser_access; /* New Users Access level */ int OLR_MaxMsgs; /* OLR Max nr Msgs download */ unsigned iCapUserName : 1; /* Capitalize Username */ - unsigned iAnsi : 1; /* Ask Ansi */ + unsigned xiAnsi : 1; unsigned iSex : 1; /* Ask Sex */ unsigned iDataPhone : 1; /* Ask Data Phone */ unsigned iVoicePhone : 1; /* Ask Voice Phone */ @@ -2604,7 +2604,9 @@ 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 */ -int chartran_init(char *, char *); /* Initialize chartran */ +char *get_ic_ftn(int); /* Return iconv name FTN side */ +char *get_ic_rfc(int); /* Return iconv name RFC side */ +int chartran_init(char *, char *, int); /* Initialize chartran */ void chartran_close(void); /* Deinit chartran */ char *chartran(char *); /* Translate string */ diff --git a/lib/users.h b/lib/users.h index b9373014..20cb80cd 100644 --- a/lib/users.h +++ b/lib/users.h @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Users Database structure * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -96,7 +96,7 @@ struct userrec { unsigned Hidden : 1; /* Hide User from Lists */ unsigned HotKeys : 1; /* Hot-Keys ON/OFF */ - unsigned GraphMode : 1; /* ANSI Mode ON/OFF */ + unsigned xGraphMode : 1; unsigned Deleted : 1; /* Deleted Status */ unsigned NeverDelete : 1; /* Never Delete User */ unsigned xChat : 1; diff --git a/mbfido/ftn2rfc.c b/mbfido/ftn2rfc.c index b54731c4..cbd69ea3 100644 --- a/mbfido/ftn2rfc.c +++ b/mbfido/ftn2rfc.c @@ -695,12 +695,10 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl Syslog('m', "ftn2rfc: charset in: %s charset out: %s", charset, getrfcchrs(msgs.Charset)); -#ifndef USE_EXPERIMENT /* * Setup charset conversion */ - charset_set_in_out(charset, getrfcchrs(msgs.Charset)); -#endif + chartran_init(charset, getrfcchrs(msgs.Charset), 'm'); if (newsmode) { /* @@ -1546,6 +1544,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl fprintf(nfp, ".\n"); } + chartran_close(); if (newsgroup) free(newsgroup); rbuf = NULL; diff --git a/mbfido/makestat.c b/mbfido/makestat.c index 774176a9..933d8993 100644 --- a/mbfido/makestat.c +++ b/mbfido/makestat.c @@ -4,7 +4,7 @@ * Purpose ...............: Make Web statistics * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -133,6 +133,8 @@ void MakeStat(void) else Lm = Miy -1; + chartran_init((char *)"CP437", (char *)"UTF-8", 'm'); + snprintf(name, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT")); if ((fg = fopen(name, "r")) == NULL) { WriteError("Can't open %s", name); @@ -147,9 +149,9 @@ void MakeStat(void) while ((fread(&mgroup, mgrouphdr.recsize, 1, fg)) == 1) { if (mgroup.Active) { fseek(fi, fileptr, SEEK_SET); - html_massage(mgroup.Name, name, PATH_MAX -1); + html_massage(chartran(mgroup.Name), name, PATH_MAX -1); MacroVars("b", "s", name); - html_massage(mgroup.Comment, name, PATH_MAX -1); + html_massage(chartran(mgroup.Comment), name, PATH_MAX -1); MacroVars("c", "s", name); MacroVars("d", "s", mgroup.UseAka.zone ? aka2str(mgroup.UseAka):" "); MacroVars("e", "s", adate(mgroup.LastDate)); @@ -196,11 +198,11 @@ void MakeStat(void) } fseek(fi, fileptr, SEEK_SET); MacroVars("b", "d", Area); - html_massage(msgs.Name, name, PATH_MAX -1); + html_massage(chartran(msgs.Name), name, PATH_MAX -1); MacroVars("c", "s", strlen(name) ? name:" "); - html_massage(msgs.Tag, name, PATH_MAX -1); + html_massage(chartran(msgs.Tag), name, PATH_MAX -1); MacroVars("d", "s", strlen(name) ? name:" "); - html_massage(msgs.Group, name, PATH_MAX -1); + html_massage(chartran(msgs.Group), name, PATH_MAX -1); MacroVars("e", "s", strlen(name) ? name:" "); MacroVars("f", "s", adate(msgs.LastRcvd)); MacroVars("g", "d", msgs.Received.lweek); @@ -238,9 +240,9 @@ void MakeStat(void) while ((fread(&fgroup, fgrouphdr.recsize, 1, fg)) == 1) { if (fgroup.Active) { fseek(fi, fileptr, SEEK_SET); - html_massage(fgroup.Name, name, PATH_MAX -1); + html_massage(chartran(fgroup.Name), name, PATH_MAX -1); MacroVars("b", "s", name); - html_massage(fgroup.Comment, name, PATH_MAX -1); + html_massage(chartran(fgroup.Comment), name, PATH_MAX -1); MacroVars("c", "s", name); MacroVars("d", "s", fgroup.UseAka.zone ? aka2str(fgroup.UseAka):" "); MacroVars("e", "s", adate(fgroup.LastDate)); @@ -278,11 +280,11 @@ void MakeStat(void) while ((fread(&tic, tichdr.recsize, 1, fg)) == 1) { if (tic.Active) { fseek(fi, fileptr, SEEK_SET); - html_massage(tic.Comment, name, PATH_MAX -1); + html_massage(chartran(tic.Comment), name, PATH_MAX -1); MacroVars("b", "s", name); - html_massage(tic.Name, name, PATH_MAX -1); + html_massage(chartran(tic.Name), name, PATH_MAX -1); MacroVars("c", "s", name); - html_massage(tic.Group, name, PATH_MAX -1); + html_massage(chartran(tic.Group), name, PATH_MAX -1); MacroVars("d", "s", name); MacroVars("e", "s", adate(tic.LastAction)); MacroVars("f", "d", tic.Files.lweek); @@ -328,7 +330,7 @@ void MakeStat(void) else q = xstrcpy((char *)"Normal"); MacroVars("b", "s", aka2str(nodes.Aka[0])); - html_massage(nodes.Sysop, name, PATH_MAX -1); + html_massage(chartran(nodes.Sysop), name, PATH_MAX -1); MacroVars("c", "s", name); MacroVars("d", "s", q); MacroVars("e", "s", p); @@ -376,11 +378,11 @@ void MakeStat(void) if (!strcmp(hist.aka.domain, "(null)")) hist.aka.domain[0] = '\0'; MacroVars("c", "s", hist.aka.zone ? aka2str(hist.aka):" "); - html_massage(hist.system_name, name, PATH_MAX -1); + html_massage(chartran(hist.system_name), name, PATH_MAX -1); MacroVars("d", "s", strlen(name) ? name:" "); - html_massage(hist.sysop, name, PATH_MAX -1); + html_massage(chartran(hist.sysop), name, PATH_MAX -1); MacroVars("e", "s", strlen(name) ? name:" "); - html_massage(hist.location, name, PATH_MAX -1); + html_massage(chartran(hist.location), name, PATH_MAX -1); MacroVars("f", "s", strlen(name) ? name:" "); MacroVars("g", "s", strlen(hist.tty) ? hist.tty:" "); MacroVars("h", "s", adate(hist.online)); @@ -435,6 +437,8 @@ void MakeStat(void) free(name); Syslog('+', "Finished making statistic HTML pages"); + chartran_close(); + if (!do_quiet) { printf("\r \r"); fflush(stdout); diff --git a/mbfido/mbfindex.c b/mbfido/mbfindex.c index 87acfc7e..42d3546c 100644 --- a/mbfido/mbfindex.c +++ b/mbfido/mbfindex.c @@ -39,6 +39,7 @@ extern int do_quiet; /* Suppress screen output */ +extern int do_force; /* Force update */ int lastfile; /* Last file number */ int gfilepos = 0; /* Global file position */ int TotalHtml = 0; /* Total html files */ @@ -61,69 +62,23 @@ 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 /* * Translate a string from ANSI to safe HTML characters */ +/* char *To_Html(char *); char *To_Html(char *inp) { - static char temp[256]; - int i; -#ifndef USE_EXPERIMENT - char *xl; -#endif + static char temp[1024]; 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))) { - while (*xl) { - temp[i] = *xl++; - if (*xl) - i++; - } - } - } else - temp[i] = inp[i]; - } -#endif + strncpy(temp, chartran(inp), sizeof(temp) -1); return temp; } - +*/ void tidy_index(Findex **); @@ -631,13 +586,11 @@ 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 + chartran_init((char *)"CP437", (char *)"UTF-8", 'f'); for (i = 1; i <= iAreas; i++) { @@ -679,7 +632,7 @@ void HtmlIndex(char *Lang) aTotal = 0; last = 0L; - if (obj_time < db_time) { + if ((obj_time < db_time) || do_force) { /* * If not up todate */ @@ -753,9 +706,10 @@ void HtmlIndex(char *Lang) snprintf(desc+k, 2, "\n"); k += 1; } - snprintf(linebuf, 1024, "%s", To_Html(fdb.Desc[j])); - html_massage(linebuf, outbuf, 1024); - snprintf(desc+k, 6400 -k, "%s", outbuf); + html_massage(fdb.Desc[j], linebuf, 1024); +// strncpy(linebuf, fdb.Desc[j], 1024); + strncpy(outbuf, chartran(linebuf), 1024); + strncat(desc, outbuf, 6400 -k); k += strlen(outbuf); } MacroVars("m", "s", desc); @@ -844,6 +798,7 @@ void HtmlIndex(char *Lang) } fclose(pAreas); + chartran_close(); if (!do_quiet) { printf("\r \r"); diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index 32ce6d46..549b94d3 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -78,36 +78,20 @@ extern int most_debug; * Internal functions */ int needputrfc(rfcmsg *, int); -#ifdef USE_EXPERIMENT -int use_iconv = FALSE; -iconv_t iconv_s; -#endif - int charwrite(char *s, FILE *fp) { -#ifndef USE_EXPERIMENT - char *o; -#endif - + char temp[2048]; + 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(*o, fp); -#endif - s++; + putc('-',fp); + putc(' ',fp); } + + strncpy(temp, chartran(s), sizeof(temp) -1); + fputs(temp, fp); + return 0; } @@ -348,25 +332,11 @@ int rfc2ftn(FILE *fp, faddr *recipient) hdrsize += (fmsg->to->name)?strlen(fmsg->to->name):0; Syslog('m', "rfc2ftn: charset in: %s charset out: %s", charset,getrfcchrs(msgs.Charset)); -#ifndef USE_EXPERIMENT + /* * Setup charset conversion */ - charset_set_in_out(charset,getrfcchrs(msgs.Charset)); -#endif -#ifdef USE_EXPERIMENT - if (strcmp(charset,getrfcchrs(msgs.Charset)) == 0) { - Syslog('m', "rfc2ftn: no need for iconv"); - } else { - iconv_s = iconv_open(getrfcchrs(msgs.Charset), charset); - if (iconv_s != (iconv_t)-1) { - Syslog('m', "rfc2ftn: activated iconv"); - use_iconv = TRUE; - } else { - Syslog('+', "rfc2ftn: iconv_open(%s, %s) failed", getrfcchrs(msgs.Charset), charset); - } - } -#endif + chartran_init(charset,getrfcchrs(msgs.Charset), 'm'); do { Syslog('m', "rfc2ftn: split loop, splitpart = %d", splitpart); @@ -767,16 +737,7 @@ int rfc2ftn(FILE *fp, faddr *recipient) } while (needsplit); Syslog('m', "rfc2ftn: out of splitloop"); - -#ifdef USE_EXPERIMENT - if (use_iconv) { - if (iconv_close(iconv_s)) - WriteError("$rfc2ftn: iconv_close()"); - else - Syslog('m', "rfc2ftn: inconv_close() success"); - use_iconv = FALSE; - } -#endif + chartran_close(); free(temp); if (charset) diff --git a/mbnntp/commands.c b/mbnntp/commands.c index 43fd5f97..67516d92 100644 --- a/mbnntp/commands.c +++ b/mbnntp/commands.c @@ -198,7 +198,7 @@ void command_abhs(char *buf) charindex = find_ftn_charset(charset); if (charindex != FTNC_ERROR) { - chartran_init(charmap[charindex].ic_ftn, (char *)"UTF-8"); + chartran_init(charmap[charindex].ic_ftn, (char *)"UTF-8", 'n'); } if ((strcasecmp(cmd, "ARTICLE") == 0) || (strcasecmp(cmd, "HEAD") == 0)) { diff --git a/mbnntp/rfc2ftn.c b/mbnntp/rfc2ftn.c index f2a4d61e..ff5c2925 100644 --- a/mbnntp/rfc2ftn.c +++ b/mbnntp/rfc2ftn.c @@ -79,27 +79,12 @@ 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++; - } + + fwrite(s, strlen(s), 1, fp); return 0; } @@ -291,10 +276,7 @@ int rfc2ftn(FILE *fp) charset = xstrcpy((char *)"iso-8859-1"); Syslog('m', "No charset, setting default to iso-8859-1"); } - -#ifndef USE_EXPERIMENT - charset_set_in_out(charset,getrfcchrs(msgs.Charset)); -#endif + chartran_init(charset,getrfcchrs(msgs.Charset), 'm'); if ((p = hdr((char *)"Message-ID",msg))) { if (!removemsgid) @@ -804,6 +786,7 @@ int rfc2ftn(FILE *fp) free(temp); if (charset) free(charset); + chartran_close(); tidyrfc(msg); tidy_ftnmsg(fmsg); UpdateMsgs(); diff --git a/mbsebbs/change.c b/mbsebbs/change.c index 505542a8..e8f52691 100644 --- a/mbsebbs/change.c +++ b/mbsebbs/change.c @@ -595,33 +595,6 @@ void Chg_Address() -/* - * Toggle Graphics - */ -void Chg_Graphics() -{ - ReadExitinfo(); - Enter(2); - - if (exitinfo.GraphMode) { - exitinfo.GraphMode = FALSE; - /* Ansi Mode turned OFF */ - pout(WHITE, BLACK, (char *) Language(76)); - } else { - exitinfo.GraphMode = TRUE; - /* Ansi Mode turned ON */ - pout(WHITE, BLACK, (char *) Language(75)); - } - - Syslog('+', "Graphics mode now %s", exitinfo.GraphMode?"On":"Off"); - Enter(2); - TermInit(exitinfo.GraphMode); - WriteExitinfo(); - sleep(2); -} - - - void Chg_VoicePhone() { char temp[81]; @@ -1111,6 +1084,7 @@ void Chg_Charset() Syslog('+', "New character set %s", getftnchrs(exitinfo.Charset)); WriteExitinfo(); setlocale(LC_CTYPE, getlocale(exitinfo.Charset)); + utf8 = (exitinfo.Charset == FTNC_UTF8); Syslog('b', "setlocale(LC_CTYPE, NULL) returns \"%s\"", printable(setlocale(LC_CTYPE, NULL), 0)); Enter(2); colour(LIGHTGREEN, BLACK); diff --git a/mbsebbs/change.h b/mbsebbs/change.h index e3c8e197..ef7bcad5 100644 --- a/mbsebbs/change.h +++ b/mbsebbs/change.h @@ -14,7 +14,6 @@ void Chg_FsMsged(void); /* Toggle Fullscreen Editor */ void Chg_FsMsgedKeys(void); /* Toggle FS editor shortcut keys */ void Chg_Location(void); /* Change location */ void Chg_Address(void); /* Change address */ -void Chg_Graphics(void); /* Toggle graphics */ void Chg_VoicePhone(void); /* Change voicephone */ void Chg_DataPhone(void); /* Change dataphone */ void Chg_News(void); /* Toggle News Bulletins */ diff --git a/mbsebbs/dispfile.c b/mbsebbs/dispfile.c index 64caf287..7e50ca3e 100644 --- a/mbsebbs/dispfile.c +++ b/mbsebbs/dispfile.c @@ -231,63 +231,49 @@ int DisplayTextFile(char *filename) */ int DisplayFile(char *filename) { - FILE *pFileName; + FILE *fp = NULL; int iSec = 0; - char *sFileName, *tmp, *tmp1, newfile[PATH_MAX]; - int i, x; + char tmp[256], tmp1[256], buf[256], out[1024], newfile[PATH_MAX]; + int x; unsigned char c; - sFileName = calloc(16385, sizeof(char)); - tmp = calloc(PATH_MAX, sizeof(char)); - tmp1 = calloc(PATH_MAX, sizeof(char)); - /* * Open the file in the following search order: - * 1 - if GraphMode -> users language .ans - * 2 - if GraphMode -> default language .ans - * 3 - users language .asc - * 4 - default language .asc - * 5 - Abort, there is no file to show. + * 1 - users language .ans + * 2 - default language .ans + * 3 - Abort, there is no file to show. */ - pFileName = NULL; - if (exitinfo.GraphMode) { - snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.ans", getenv("MBSE_ROOT"), lang.lc, filename); - if ((pFileName = fopen(newfile, "rb")) == NULL) { - snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.ans", getenv("MBSE_ROOT"), CFG.deflang, filename); - pFileName = fopen(newfile, "rb"); - } - } - if (pFileName == NULL) { - snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.asc", getenv("MBSE_ROOT"), lang.lc, filename); - if ((pFileName = fopen(newfile, "rb")) == NULL) { - snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.asc", getenv("MBSE_ROOT"), CFG.deflang, filename); - if ((pFileName = fopen(newfile, "rb")) == NULL) { - free(sFileName); - free(tmp); - free(tmp1); - return FALSE; - } + snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.ans", getenv("MBSE_ROOT"), lang.lc, filename); + if ((fp = fopen(newfile, "rb")) == NULL) { + snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.ans", getenv("MBSE_ROOT"), CFG.deflang, filename); + if ((fp = fopen(newfile, "rb")) == NULL) { + return FALSE; } } - Syslog('B', "Displayfile %s", newfile); + if (utf8) { + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); + } + Syslog('b', "Displayfile %s %s mode", newfile, utf8? "UTF-8":"CP437"); + memset(&out, 0, sizeof(out)); - while (!feof(pFileName)) { - i = fread(sFileName, sizeof(char), 16384, pFileName); + while (fgets(buf, sizeof(buf)-1, fp)) { - for (x = 0; x < i; x++) { - c = *(sFileName + x) & 0xff; + for (x = 0; x < strlen(buf); x++) { + c = buf[x] & 0xff; switch (c) { - case '': ControlCodeU(sFileName[++x]); + case '': strncat(out, ControlCodeU(buf[++x]), sizeof(out)-1); break; - case '': ControlCodeF(sFileName[++x]); + case '': strncat(out, ControlCodeF(buf[++x]), sizeof(out)-1); break; - case ' ': ControlCodeK(sFileName[++x]); + case ' ': strncat(out, ControlCodeK(buf[++x]), sizeof(out)-1); break; - case '': alarm_on(); + case '': PUTSTR(chartran(out)); + memset(&out, 0, sizeof(out)); + alarm_on(); Readkey(); break; @@ -300,38 +286,45 @@ int DisplayFile(char *filename) */ x++; strcpy(tmp1, ""); - while (*(sFileName + x) != '') { - snprintf(tmp, PATH_MAX, "%c", *(sFileName + x)); - strcat(tmp1, tmp); + while (buf[x] != '') { + snprintf(tmp, sizeof(tmp)-1, "%c", buf[x]); + strncat(tmp1, tmp, sizeof(tmp1)-1); x++; } x++; iSec = atoi(tmp1); - while ((x <= i) && (*(sFileName + x) != '')) { - if (exitinfo.Security.level >= iSec) - PUTCHAR(*(sFileName + x)); + while ((x <= strlen(buf)) && buf[x] != '') { + if (exitinfo.Security.level >= iSec) { + snprintf(tmp1, sizeof(tmp1) -1, "%c", buf[x]); + strncat(out, tmp1, sizeof(out)-1); + } x++; } break; - case '': sleep(1); + case '\r': break; + + case '\n': strncat(out, (char *)"\r\n", sizeof(out)); break; - case '\n': Enter(1); /* Insert , we are in raw mode */ + case '': PUTSTR(chartran(out)); + memset(&out, 0, sizeof(out)); + FLUSHOUT(); + sleep(1); break; - case '\r': break; /* If the file has chars (DOS), eat them */ - - default: PUTCHAR(*(sFileName + x)); - + default: snprintf(tmp1, sizeof(tmp1)-1, "%c", buf[x]); + strncat(out, tmp1, sizeof(out)); } /* switch */ } /* for */ - } /* while !eof */ - fclose(pFileName); - free(sFileName); - free(tmp); - free(tmp1); + PUTSTR(chartran(out)); + memset(&out, 0, sizeof(out)); + + } /* while fgets */ + + fclose(fp); + chartran_close(); return TRUE; } @@ -352,9 +345,9 @@ int DisplayFileEnter(char *File) -void ControlCodeF(int ch) +char *ControlCodeF(int ch) { - char temp[81]; + static char temp[81]; /* Update user info */ ReadExitinfo(); @@ -406,14 +399,15 @@ void ControlCodeF(int ch) default: snprintf(temp, 81, " "); } - PUTSTR(temp); + + return temp; } -void ControlCodeU(int ch) +char *ControlCodeU(int ch) { - char temp[81]; + static char temp[81]; /* * Update user info @@ -487,7 +481,7 @@ void ControlCodeU(int ch) break; case 'P': - snprintf(temp, 81, "%s", exitinfo.GraphMode ? (char *) Language(147) : (char *) Language(148)); + snprintf(temp, 81, "%s", (char *) Language(147)); break; case 'R': @@ -569,15 +563,17 @@ void ControlCodeU(int ch) default: snprintf(temp, 81, " "); } - PUTSTR(temp); + + return temp; } -void ControlCodeK(int ch) +char *ControlCodeK(int ch) { FILE *pCallerLog; - char sDataFile[PATH_MAX], temp[81]; + char sDataFile[PATH_MAX]; + static char temp[81]; lastread LR; switch (toupper(ch)) { @@ -680,7 +676,7 @@ void ControlCodeK(int ch) } - PUTSTR(temp); + return temp; } diff --git a/mbsebbs/dispfile.h b/mbsebbs/dispfile.h index 6c04018f..f4ea9af6 100644 --- a/mbsebbs/dispfile.h +++ b/mbsebbs/dispfile.h @@ -8,9 +8,9 @@ void DisplayRules(void); /* Display area rules */ int DisplayTextFile(char *); /* Display a flat textfile */ int DisplayFile(char *); /* Display .ans/.asc textfile */ int DisplayFileEnter(char *); /* Display .ans/.asc wait for Enter */ -void ControlCodeF(int); /* Check Control Codes in File */ -void ControlCodeU(int); /* Check Control Codes in File */ -void ControlCodeK(int); /* Check Control Codes in File */ +char *ControlCodeF(int); /* Check Control Codes in File */ +char *ControlCodeU(int); /* Check Control Codes in File */ +char *ControlCodeK(int); /* Check Control Codes in File */ #endif diff --git a/mbsebbs/door.c b/mbsebbs/door.c index c2df050e..319eaad9 100644 --- a/mbsebbs/door.c +++ b/mbsebbs/door.c @@ -4,7 +4,7 @@ * Purpose ...............: Run external door * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -220,7 +220,7 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu fprintf(fp, "%s\r\n", Gdate(exitinfo.tLastLoginDate, Y2Kdoorsys)); fprintf(fp, "%d\r\n", exitinfo.iTimeLeft * 60); /* Seconds */ fprintf(fp, "%d\r\n", exitinfo.iTimeLeft); /* Minutes */ - fprintf(fp, "%s\r\n", exitinfo.GraphMode?"GR":"NG"); /* Graphics GR,RIP,NG */ + fprintf(fp, "GR\r\n"); /* Graphics GR,RIP,NG */ fprintf(fp, "%d\r\n", rows); fprintf(fp, "N\r\n"); /* User mode, always N */ fprintf(fp, "\r\n"); /* Always blank */ @@ -285,7 +285,7 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu fprintf(fp, "%s\r\n", exitinfo.sHandle); /* User's handle */ fprintf(fp, "%d\r\n", exitinfo.Security.level); /* User's security level */ fprintf(fp, "%d\r\n", exitinfo.iTimeLeft); /* User's time left in minutes */ - fprintf(fp, "%s\r\n", exitinfo.GraphMode?"1":"0"); /* User's graphic mode */ + fprintf(fp, "1\r\n"); /* User's graphic mode */ fprintf(fp, "%d\r\n\032", iNode); /* Node number */ fclose(fp); } diff --git a/mbsebbs/email.c b/mbsebbs/email.c index 96b30130..37731b08 100644 --- a/mbsebbs/email.c +++ b/mbsebbs/email.c @@ -4,7 +4,7 @@ * Purpose ...............: Internet email * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -455,7 +455,7 @@ int Read_a_Email(unsigned int Num) if (Kludges) { pout(LIGHTGRAY, BLACK, p); Enter(1); - if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE, FALSE)) + if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE)) break; } } else { @@ -465,7 +465,7 @@ int Read_a_Email(unsigned int Num) colour(CFG.HiliteF, CFG.HiliteB); PUTSTR(p); Enter(1); - if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE, FALSE)) + if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE)) break; } } while ((p = (char *)MsgText_Next()) != NULL); diff --git a/mbsebbs/fsedit.c b/mbsebbs/fsedit.c index 7f574652..d7646aec 100644 --- a/mbsebbs/fsedit.c +++ b/mbsebbs/fsedit.c @@ -4,7 +4,7 @@ * Purpose ...............: FullScreen Message editor. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -45,6 +45,8 @@ extern int cols; extern int rows; +char hstr[81]; + void Show_Ins(void) { @@ -80,80 +82,83 @@ void Top_Menu(void) } -void Ls(int a, int y) +void Ls(int y) { - locate(y, 10); - PUTCHAR(a ? 179 : '|'); + strcpy(hstr, locate_str(y, 10)); + strncat(hstr, (char *)"\xB3", 80); } -void Rs(int a) +void Rs() { - colour(LIGHTGREEN, BLUE); - PUTCHAR(a ? 179 : '|'); + strncat(hstr, colour_str(LIGHTGREEN, BLUE), 80); + strncat(hstr, (char *)"\xB3", 80); } -void Ws(int a, int y) +void Ws(int y) { int i; - Ls(a, y); + Ls(y); for (i = 0; i < 58; i++) - PUTCHAR(' '); - Rs(a); + strncat(hstr, (char *)" ", 80); + Rs(); } -void Hl(int a, int y, char *txt) +void Hl(int y, char *txt) { - Ls(a, y); - colour(WHITE, BLUE); - PUTSTR(padleft(txt, 58, ' ')); - Rs(a); + Ls(y); + strncat(hstr, colour_str(WHITE, BLUE), 80); + strncat(hstr, padleft(txt, 58, ' '), 80); + Rs(); + PUTSTR(chartran(hstr)); } void Full_Help(void) { - int a, i; - - a = exitinfo.GraphMode; - - colour(LIGHTGREEN, BLUE); + strcpy(hstr, colour_str(LIGHTGREEN, BLUE)); /* Top row */ - locate(1, 10); - PUTCHAR(a ? 213 : '+'); - for (i = 0; i < 58; i++) - PUTCHAR(a ? 205 : '='); - PUTCHAR(a ? 184 : '+'); + strncat(hstr, locate_str(1, 10), 80); + strncat(hstr, (char *)"\xDA", 80); + strncat(hstr, hLine_str(58), 80); + strncat(hstr, (char *)"\xBF", 80); + PUTSTR(chartran(hstr)); - Ws(a, 2); + Ws(2); + PUTSTR(chartran(hstr)); - Ls(a, 3); - colour(YELLOW, BLUE); - PUTSTR(padleft((char *)" Editor Help", 58, ' ')); - Rs(a); + Ls(3); + strncat(hstr, colour_str(YELLOW, BLUE), 80); + strncat(hstr, padleft((char *)" Editor Help", 58, ' '), 80); + Rs(); + PUTSTR(chartran(hstr)); - Ws(a, 4); - Hl(a, 5, (char *)"Ctrl-S or LeftArrow - Cursor left"); - Hl(a, 6, (char *)"Ctrl-D or RightArrow - Cursor right"); - Hl(a, 7, (char *)"Ctrl-E or UpArrow - Cursor up"); - Hl(a, 8, (char *)"Ctrl-X or DownArrow - Cursor down"); - Hl(a, 9, (char *)"Ctrl-V or Insert - Insert or Overwrite"); - Hl(a, 10, (char *)"Ctrl-N - Insert line"); - Hl(a, 11, (char *)"Ctrl-Y - Delete line"); - Ws(a, 12); - Hl(a, 13, (char *)"Ctrl-L - Refresh screen"); - Hl(a, 14, (char *)"Ctrl-R - Read from file"); - Ws(a, 15); + Ws(4); + PUTSTR(chartran(hstr)); - locate(16,10); - PUTCHAR(a ? 212 : '+'); - for (i = 0; i < 58; i++) - PUTCHAR(a ? 205 : '='); - PUTCHAR(a ? 190 : '+'); + Hl( 5, (char *)"Ctrl-S or LeftArrow - Cursor left"); + Hl( 6, (char *)"Ctrl-D or RightArrow - Cursor right"); + Hl( 7, (char *)"Ctrl-E or UpArrow - Cursor up"); + Hl( 8, (char *)"Ctrl-X or DownArrow - Cursor down"); + Hl( 9, (char *)"Ctrl-V or Insert - Insert or Overwrite"); + Hl(10, (char *)"Ctrl-N - Insert line"); + Hl(11, (char *)"Ctrl-Y - Delete line"); + Ws(12); + PUTSTR(chartran(hstr)); + Hl(13, (char *)"Ctrl-L - Refresh screen"); + Hl(14, (char *)"Ctrl-R - Read from file"); + Ws(15); + PUTSTR(chartran(hstr)); + + strcpy(hstr, locate_str(16,10)); + strncat(hstr, (char *)"\xC0", 80); + strncat(hstr, hLine_str(58), 80); + strncat(hstr, (char *)"\xD9", 80); + PUTSTR(chartran(hstr)); } @@ -411,6 +416,9 @@ int Fs_Edit() FILE *fd; Syslog('b', "FSEDIT: Entering FullScreen editor"); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); + clear(); InsMode = TRUE; TopVisible = 1; @@ -700,6 +708,7 @@ int Fs_Edit() if (ch == 'A' || ch == 'S') { Syslog('b', "FSEDIT: %s message (%c)", (ch == 'S' && Changed) ? "Saving" : "Aborting", ch); clear(); + chartran_close(); if (ch == 'S' && Changed) { Syslog('+', "FSEDIT: Message will be saved"); return TRUE; @@ -781,6 +790,7 @@ int Fs_Edit() } } + chartran_close(); WriteError("FsEdit(): Impossible to be here"); return FALSE; } diff --git a/mbsebbs/fsedit.h b/mbsebbs/fsedit.h index 22d7549d..e97ce3ee 100644 --- a/mbsebbs/fsedit.h +++ b/mbsebbs/fsedit.h @@ -18,10 +18,10 @@ int CurRow; /* Current row in buffer */ void Show_Ins(void); void Top_Help(void); void Top_Menu(void); -void Ls(int, int); -void Rs(int); -void Ws(int, int); -void Hl(int, int, char *); +void Ls(int); +void Rs(void); +void Ws(int); +void Hl(int, char *); void Full_Help(void); void Setcursor(void); void Beep(void); diff --git a/mbsebbs/lastcallers.c b/mbsebbs/lastcallers.c index c540f1b9..ec9edba8 100644 --- a/mbsebbs/lastcallers.c +++ b/mbsebbs/lastcallers.c @@ -4,7 +4,7 @@ * Purpose ...............: Display Last Callers * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -60,53 +60,54 @@ extern int cols; void LastCallers(char *OpData) { FILE *pLC; - int LineCount = 5, count = 0, i, x; - char *sFileName, *Heading, *Underline; + int LineCount = 5, count = 0; + char lstr[128], *sFileName, *Heading; struct lastcallers lcall; struct lastcallershdr lcallhdr; sFileName = calloc(PATH_MAX, sizeof(char)); Heading = calloc(81, sizeof(char)); - Underline = calloc(81, sizeof(char)); - clear(); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); + + strcpy(lstr, clear_str()); + PUTSTR(chartran(lstr)); snprintf(sFileName, PATH_MAX, "%s/etc/lastcall.data", getenv("MBSE_ROOT")); if ((pLC = fopen(sFileName,"r")) == NULL) WriteError("$LastCallers: Can't open %s", sFileName); else { fread(&lcallhdr, sizeof(lcallhdr), 1, pLC); - colour(WHITE, BLACK); + + strcpy(lstr, colour_str(WHITE, BLACK)); /* Todays callers to */ snprintf(Heading, 81, "%s%s", (char *) Language(84), CFG.bbs_name); - Center(Heading); - - x = strlen(Heading); - - for (i = 0; i < x; i++) - snprintf(Underline, 81, "%s%c", Underline, exitinfo.GraphMode ? 196 : 45); - - colour(LIGHTRED, BLACK); - Center(Underline); + strncat(lstr, Center_str(Heading), 127); + PUTSTR(chartran(lstr)); + strcpy(lstr, colour_str(LIGHTRED, BLACK)); + strncat(lstr, Center_str(hLine_str(strlen(Heading))), 127); + PUTSTR(chartran(lstr)); Enter(1); /* # User Name Device timeOn Calls Location */ - pout(LIGHTGREEN, BLACK, (char *) Language(85)); - Enter(1); + strcpy(lstr, poutCR_str(LIGHTGREEN, BLACK, (char *) Language(85))); + PUTSTR(chartran(lstr)); - colour(GREEN, BLACK); - fLine(cols -1); + strcpy(lstr, colour_str(GREEN, BLACK)); + strncat(lstr, fLine_str(cols -1), 127); + PUTSTR(chartran(lstr)); while (fread(&lcall, lcallhdr.recsize, 1, pLC) == 1) { if (!lcall.Hidden) { count++; - colour(WHITE, BLACK); + strcpy(lstr, colour_str(WHITE, BLACK)); snprintf(Heading, 81, "%-5d", count); - PUTSTR(Heading); + strncat(lstr, Heading, 127); - colour(LIGHTCYAN, BLACK); + strncat(lstr, colour_str(LIGHTCYAN, BLACK), 127); if ((strcasecmp(OpData, "/H")) == 0) { if ((strcmp(lcall.Handle, "") != 0 && *(lcall.Handle) != ' ')) snprintf(Heading, 81, "%-20s", lcall.Handle); @@ -117,39 +118,42 @@ void LastCallers(char *OpData) } else { snprintf(Heading, 81, "%-20s", lcall.UserName); } - PUTSTR(Heading); + strncat(lstr, Heading, 127); snprintf(Heading, 81, "%-8s", lcall.Device); - pout(LIGHTBLUE, BLACK, Heading); + strncat(lstr, pout_str(LIGHTBLUE, BLACK, Heading), 127); snprintf(Heading, 81, "%-8s", lcall.TimeOn); - pout(LIGHTMAGENTA, BLACK, Heading); + strncat(lstr, pout_str(LIGHTMAGENTA, BLACK, Heading), 127); snprintf(Heading, 81, "%-7d", lcall.Calls); - pout(YELLOW, BLACK, Heading); + strncat(lstr, pout_str(YELLOW, BLACK, Heading), 127); snprintf(Heading, 81, "%-32s", lcall.Location); - pout(LIGHTRED, BLACK, Heading); + strncat(lstr, pout_str(LIGHTRED, BLACK, Heading), 127); + PUTSTR(chartran(lstr)); Enter(1); LineCount++; - if (LineCount == rows) { + if (LineCount == (rows -2)) { Pause(); LineCount = 0; } } /* End of check if user is hidden */ } - colour(GREEN, BLACK); - fLine(cols -1); + strcpy(lstr, colour_str(GREEN, BLACK)); + strncat(lstr, fLine_str(cols -1), 127); + PUTSTR(chartran(lstr)); fclose(pLC); Enter(1); Pause(); } + free(sFileName); free(Heading); - free(Underline); + chartran_close(); } diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index 3d7a422b..e77128e4 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -5,7 +5,7 @@ * Todo ..................: Implement message groups. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -79,11 +79,7 @@ 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 */ @@ -897,20 +893,13 @@ 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; -#ifndef USE_EXPERIMENT - int i; -#endif Buf1[0] = '\0'; Buf2[0] = '\0'; @@ -998,22 +987,7 @@ 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) { - /* - * Try to translate character sets - */ - for (i = 0; i < strlen(Msg.Subject); i++) { - PUTSTR(charset_map_c(Msg.Subject[i], FALSE)); - } - } else { - PUTSTR(Msg.Subject); - } -#endif + pout(GREEN, BLACK, chartran(Msg.Subject)); Enter(1); colour(CFG.HiliteF, CFG.HiliteB); @@ -1185,12 +1159,9 @@ 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 ShowMsg = TRUE, UseIconv = FALSE; + char *p = NULL, *fn, *charset = NULL, *charsin = NULL, temp[256]; + int ShowMsg = TRUE; lastread LR; -#ifndef USE_EXPERIMENT - int i; -#endif LastNum = Num; iLineCount = 7; @@ -1280,25 +1251,21 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) /* * No charset marked in the message, use the area charset */ - charset = xstrcpy(getftnchrs(msgs.Charset)); + charsin = xstrcpy(get_ic_ftn(msgs.Charset)); + } else { + charsin = xstrcpy(get_ic_ftn(find_ftn_charset(charset))); } - charsin = xstrcpy(charset); - charsout = xstrcpy(getftnchrs(exitinfo.Charset)); + Syslog('b', "charsets: %s -> %s", charsin, get_ic_ftn(exitinfo.Charset)); /* * 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); - } + chartran_init(charsin, get_ic_ftn(exitinfo.Charset), 'b'); + /* * Show message header with charset mapping if needed. */ - ShowMsgHdr(UseIconv); -#else ShowMsgHdr(); -#endif /* * Show message text @@ -1311,7 +1278,7 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) if (Kludges) { pout(LIGHTGRAY, BLACK, p); Enter(1); - if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE, UseIconv)) + if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE)) break; } } else { @@ -1319,25 +1286,11 @@ 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); + strncpy(temp, chartran(p), sizeof(temp) -1); + PUTSTR(temp); Enter(1); -#else - if (UseIconv) { - /* - * Try to translate character sets - */ - for (i = 0; i < strlen(p); i++) { - PUTSTR(charset_map_c(p[i], FALSE)); - } - Enter(1); - } else { - PUTSTR(p); - Enter(1); - } -#endif - if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE, UseIconv)) + if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE)) break; } } while ((p = (char *)MsgText_Next()) != NULL); @@ -1346,11 +1299,10 @@ int Read_a_Msg(unsigned int Num, int UpdateLR) if (charset) free(charset); - if (charsout) - free(charsout); if (charsin) free(charsin); - + chartran_close(); + /* * Set the Received status on this message if it's for the user. */ @@ -1975,7 +1927,7 @@ void Delete_Msg() /* * Check linecounter for reading messages. */ -int CheckLine(int FG, int BG, int Email, int Conv) +int CheckLine(int FG, int BG, int Email) { int x, z; @@ -2002,11 +1954,7 @@ 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/mail.h b/mbsebbs/mail.h index b98d1adf..59422b73 100644 --- a/mbsebbs/mail.h +++ b/mbsebbs/mail.h @@ -9,7 +9,7 @@ int LC(int); /* More prompt for reading messages */ int Edit_Msg(void); /* Edit a message */ int Ext_Edit(void); /* External Message editor */ -int CheckLine(int, int, int, int); /* Check linecounter for read */ +int CheckLine(int, int, int); /* Check linecounter for read */ void SysopComment(char *); /* Comment to Sysop */ void Post_Msg(void); /* Post a message */ void Read_Msgs(void); /* Read Messages */ diff --git a/mbsebbs/mbnewusr.c b/mbsebbs/mbnewusr.c index 9720c29a..0686d279 100644 --- a/mbsebbs/mbnewusr.c +++ b/mbsebbs/mbnewusr.c @@ -4,7 +4,7 @@ * Purpose ...............: New user registration * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -166,12 +166,6 @@ int main(int argc, char **argv) signal(i, SIG_IGN); } - /* - * Default set the terminal to ANSI mode. If your logo - * is in color, the user will see color no mather what. - */ - TermInit(1); - /* * Now it's time to check if the bbs is open. If not, we * log the user off. diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index 31bf5083..e7772e7b 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -214,12 +214,6 @@ int main(int argc, char **argv) signal(i, SIG_DFL); } - /* - * Default set the terminal to ANSI mode. If your logo - * is in color, the user will see color no mather what. - */ - TermInit(1); - /* * Now it's time to check if the bbs is open. If not, we * log the user off. diff --git a/mbsebbs/menu.c b/mbsebbs/menu.c index 68341477..d31bcdf5 100644 --- a/mbsebbs/menu.c +++ b/mbsebbs/menu.c @@ -591,10 +591,6 @@ void DoMenu(int Type) Chg_Location(); break; - case 304: - Chg_Graphics(); - break; - case 305: Chg_VoicePhone(); break; diff --git a/mbsebbs/misc.c b/mbsebbs/misc.c index 9ee93791..741dddf5 100644 --- a/mbsebbs/misc.c +++ b/mbsebbs/misc.c @@ -123,11 +123,12 @@ void DisplayLogo() WriteError("$DisplayLogo: Can't open %s", temp); else { while (Fgets(sString, 1023, pLogo) != NULL) { - PUTSTR(sString); + PUTSTR(chartran(sString)); Enter(1); } fclose(pLogo); } + free(sString); free(temp); } diff --git a/mbsebbs/newuser.c b/mbsebbs/newuser.c index a5640e97..16cbccbf 100644 --- a/mbsebbs/newuser.c +++ b/mbsebbs/newuser.c @@ -5,7 +5,7 @@ * BBS and unix accounts. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -198,21 +198,6 @@ int newuser(void) l_date = localtime(&Time_Now); ltime = time(NULL); - usrconfig.GraphMode = TRUE; /* Default set it to ANSI */ - if (CFG.iAnsi) { - Enter(2); - /* Do you want ANSI and graphics mode [Y/n]: */ - language(LIGHTGRAY, BLACK, 44); - - alarm_on(); - i = toupper(getchar()); - - if (i == Keystroke(44, 1)) - usrconfig.GraphMode = FALSE; - } - exitinfo.GraphMode = usrconfig.GraphMode; - TermInit(exitinfo.GraphMode); - if (CFG.iVoicePhone) { while (1) { Enter(1); diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index 0f3aaf05..b836e466 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -4,7 +4,7 @@ * Purpose ...............: Offline Reader * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -1211,8 +1211,7 @@ void OLR_DownBW() Inf.maxfreqs = CFG.OLR_MaxReq; if (exitinfo.HotKeys) Inf.uflags |= le_us(INF_HOTKEYS); - if (exitinfo.GraphMode) - Inf.uflags |= le_us(INF_GRAPHICS); + Inf.uflags |= le_us(INF_GRAPHICS); if (exitinfo.OL_ExtInfo) Inf.uflags |= le_us(INF_EXT_INFO); Inf.credits = le_us(exitinfo.Credit); diff --git a/mbsebbs/pinfo.c b/mbsebbs/pinfo.c index 9b9139f7..b76c4832 100644 --- a/mbsebbs/pinfo.c +++ b/mbsebbs/pinfo.c @@ -4,7 +4,7 @@ * Purpose ...............: Product information * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -38,30 +38,32 @@ #include "ttyio.h" -void ls(int a) +char pstr[256]; + + +void ls(void) { - PUTCHAR(a ? 179 : '|'); + strcpy(pstr, (char *)"\xB3"); } -void rs(int a) +void rs(void) { - colour(DARKGRAY, BLACK); - PUTCHAR(a ? 179 : '|'); - Enter(1); + strncat(pstr, colour_str(DARKGRAY, BLACK), 255); + strncat(pstr, (char *)"\xB3\r\n", 255); } -void wl(int a) +void wl(void) { int i; - ls(a); + ls(); for(i = 0; i < 76; i++) - PUTCHAR(' '); - rs(a); + strncat(pstr, (char *)" ", 255); + rs(); } @@ -71,79 +73,117 @@ void wl(int a) */ void cr(void) { - int a, i; - char *string, *temp; + char *temp; - a = exitinfo.GraphMode; - - string = calloc(81, sizeof(char)); temp = calloc(81, sizeof(char)); - clear(); - colour(DARKGRAY, BLACK); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); + + strncpy(pstr, clear_str(), 255); + strncat(pstr, colour_str(DARKGRAY, BLACK), 255); /* Print top row */ - PUTCHAR(a ? 213 : '+'); - for (i = 0; i < 76; i++) - PUTCHAR(a ? 205 : '='); - PUTCHAR(a ? 184 : '+'); - Enter(1); + strncat(pstr, (char *)"\xDA", 255); + strncat(pstr, hLine_str(76), 255); + strncat(pstr, (char *)"\xBF\r\n", 255); + PUTSTR(chartran(pstr)); - wl(a); - ls(a); - snprintf(temp, 81, "MBSE Bulletin Board System %s (%s-%s)", VERSION, OsName(), OsCPU()); - pout(YELLOW, BLACK, padleft(temp, 76, ' ')); - rs(a); - wl(a); - ls(a); + wl(); + PUTSTR(chartran(pstr)); + + ls(); + snprintf(temp, 80, "MBSE Bulletin Board System %s (%s-%s)", VERSION, OsName(), OsCPU()); + strncat(pstr, pout_str(YELLOW, BLACK, padleft(temp, 76, ' ')), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + ls(); snprintf(temp, 81, "%s", COPYRIGHT); - pout(LIGHTCYAN, BLACK, padleft(temp, 76, ' ')); - rs(a); - wl(a); - ls(a); - snprintf(temp, 81, "Compiled on %s at %s", __DATE__, __TIME__); - pout(LIGHTRED, BLACK, padleft(temp, 76, ' ')); - rs(a); - wl(a); - ls(a); - pout(LIGHTCYAN, BLACK, (char *)"MBSE has been written and designed by Michiel Broek. Many others have given "); - rs(a); - ls(a); - pout(LIGHTCYAN, BLACK, (char *)"valuable time in the form of new ideas and suggestions on how to make MBSE "); - rs(a); - ls(a); - pout(LIGHTCYAN, BLACK, (char *)"BBS a better BBS "); - rs(a); - wl(a); - ls(a); - pout(WHITE, BLACK, (char *)"Available from http://www.mbse.eu or 2:280/2802 "); - rs(a); - wl(a); - ls(a); - pout(LIGHTRED, BLACK, (char *)"JAM(mbp) - Copyright 1993 Joaquim Homrighausen, Andrew Milner, "); - rs(a); - ls(a); - pout(LIGHTRED, BLACK, (char *)" Mats Birch, Mats Wallin. "); - rs(a); - ls(a); - pout(LIGHTRED, BLACK, (char *)" ALL RIGHTS RESERVED. "); - rs(a); - wl(a); - ls(a); - pout(LIGHTBLUE, BLACK, (char *)"This is free software; released under the terms of the GNU General Public "); - rs(a); - ls(a); - pout(LIGHTBLUE, BLACK, (char *)"License as published by the Free Software Foundation. "); - rs(a); - wl(a); + strncat(pstr, pout_str(LIGHTCYAN, BLACK, padleft(temp, 76, ' ')), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + ls(); + snprintf(temp, 81, "Compiled on %s at %s", __DATE__, __TIME__); + strncat(pstr, pout_str(LIGHTRED, BLACK, padleft(temp, 76, ' ')), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTCYAN, BLACK, (char *)"MBSE has been written and designed by Michiel Broek. Many others have given "), 255); + rs(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTCYAN, BLACK, (char *)"valuable time in the form of new ideas and suggestions on how to make MBSE "), 255); + rs(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTCYAN, BLACK, (char *)"BBS a better BBS "), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(WHITE, BLACK, (char *)"Available from http://www.mbse.eu or 2:280/2802 "), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTRED, BLACK, (char *)"JAM(mbp) - Copyright 1993 Joaquim Homrighausen, Andrew Milner, "), + 255); + rs(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTRED, BLACK, (char *)" Mats Birch, Mats Wallin. "), 255); + rs(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTRED, BLACK, (char *)" ALL RIGHTS RESERVED. "), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTBLUE, BLACK, (char *)"This is free software; released under the terms of the GNU General Public "), 255); + rs(); + PUTSTR(chartran(pstr)); + + ls(); + strncat(pstr, pout_str(LIGHTBLUE, BLACK, (char *)"License as published by the Free Software Foundation. "), 255); + rs(); + PUTSTR(chartran(pstr)); + + wl(); + PUTSTR(chartran(pstr)); + + strcpy(pstr, (char *)"\xC0"); + strncat(pstr, hLine_str(76), 255); + strncat(pstr, (char *)"\xD9\r\n", 255); + PUTSTR(chartran(pstr)); - PUTCHAR(a ? 212 : '+'); - for (i = 0; i < 76; i++) - PUTCHAR(a ? 205 : '='); - PUTCHAR(a ? 190 : '+'); - - free(string); free(temp); + chartran_close(); Enter(1); Pause(); } diff --git a/mbsebbs/pinfo.h b/mbsebbs/pinfo.h index 79a49247..5116ad12 100644 --- a/mbsebbs/pinfo.h +++ b/mbsebbs/pinfo.h @@ -1,8 +1,8 @@ #ifndef _PINFO_H #define _PINFO_H -void ls(int); /* Left side of block */ -void rs(int); /* Right side of block */ +void ls(void); /* Left side of block */ +void rs(void); /* Right side of block */ void cr(void); /* Show product info screen */ #endif diff --git a/mbsebbs/term.c b/mbsebbs/term.c index 6ae61237..3b4438ec 100644 --- a/mbsebbs/term.c +++ b/mbsebbs/term.c @@ -4,7 +4,7 @@ * Purpose ...............: Terminal output routines. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -36,17 +36,10 @@ #include "ttyio.h" -int termmode; /* 0 = tty, 1 = ANSI */ extern int cols; extern int rows; -void TermInit(int mode) -{ - termmode = mode; -} - - /* * Function will print about of enters specified @@ -63,29 +56,57 @@ void Enter(int num) +char *pout_str(int fg, int bg, char *Str) +{ + static char temp[256]; + + strncpy(temp, colour_str(fg, bg), 255); + strncat(temp, Str, 255); + return temp; +} + + void pout(int fg, int bg, char *Str) { - colour(fg, bg); - PUTSTR(Str); + PUTSTR(pout_str(fg, bg, Str)); +} + + + +char *poutCenter_str(int fg, int bg, char *Str) +{ + static char temp[256]; + + strncpy(temp, colour_str(fg, bg), 255); + strncat(temp, Center_str(Str), 255); + return temp; } void poutCenter(int fg, int bg, char *Str) { - colour(fg, bg); - Center(Str); + PUTSTR(poutCenter_str(fg, bg, Str)); +} + + + +char *poutCR_str(int fg, int bg, char *Str) +{ + static char temp[256]; + + strncpy(temp, colour_str(fg, bg), 255); + strncat(temp, Str, 255); + strncat(temp, (char *)"\r\n", 255); + return temp; } void poutCR(int fg, int bg, char *Str) { - colour(fg, bg); - PUTSTR(Str); - PUTCHAR('\r'); - PUTCHAR('\n'); + PUTSTR(poutCR_str(fg, bg, Str)); } @@ -93,90 +114,110 @@ void poutCR(int fg, int bg, char *Str) /* * Changes ansi background and foreground color */ +char *colour_str(int fg, int bg) +{ + static char temp[61]; + char tmp1[40]; + + int att = 0, fore = 37, back = 40; + + if (fg<0 || fg>31 || bg<0 || bg>7) { + snprintf(temp, 61, "ANSI: Illegal colour specified: %i, %i\n", fg, bg); + return temp; + } + + strcpy(temp, "\x1B["); + + if ( fg > WHITE) { + strcat(temp, (char *)"5;"); + fg-= 16; + } + + if (fg > LIGHTGRAY) { + att=1; + fg=fg-8; + } + + if (fg == BLACK) fore=30; + else if (fg == BLUE) fore=34; + else if (fg == GREEN) fore=32; + else if (fg == CYAN) fore=36; + else if (fg == RED) fore=31; + else if (fg == MAGENTA) fore=35; + else if (fg == BROWN) fore=33; + else fore=37; + + if (bg == BLUE) back=44; + else if (bg == GREEN) back=42; + else if (bg == CYAN) back=46; + else if (bg == RED) back=41; + else if (bg == MAGENTA) back=45; + else if (bg == BROWN) back=43; + else if (bg == LIGHTGRAY) back=47; + else back=40; + + snprintf(tmp1, 41, "%d;%d;%dm", att, fore, back); + strncat(temp, tmp1, 60); + return temp; +} + + + void colour(int fg, int bg) { - char temp[61]; + PUTSTR(colour_str(fg, bg)); +} - if (termmode == 1) { - - int att=0, fore=37, back=40; - if (fg<0 || fg>31 || bg<0 || bg>7) { - snprintf(temp, 61, "ANSI: Illegal colour specified: %i, %i\n", fg, bg); - PUTSTR(temp); - return; - } - PUTSTR((char *)"["); - if ( fg > WHITE) { - PUTSTR((char *)"5;"); - fg-= 16; - } - if (fg > LIGHTGRAY) { - att=1; - fg=fg-8; - } +char *Center_str(char *string) +{ + int Strlen, Maxlen = cols, i, x, z; + static char Str[256]; - if (fg == BLACK) fore=30; - else if (fg == BLUE) fore=34; - else if (fg == GREEN) fore=32; - else if (fg == CYAN) fore=36; - else if (fg == RED) fore=31; - else if (fg == MAGENTA) fore=35; - else if (fg == BROWN) fore=33; - else fore=37; + Strlen = strlen(string); + if (Maxlen > 255) + Maxlen = 255; - if (bg == BLUE) back=44; - else if (bg == GREEN) back=42; - else if (bg == CYAN) back=46; - else if (bg == RED) back=41; - else if (bg == MAGENTA) back=45; - else if (bg == BROWN) back=43; - else if (bg == LIGHTGRAY) back=47; - else back=40; - - snprintf(temp, 61, "%d;%d;%dm", att, fore, back); - PUTSTR(temp); + if (Strlen == Maxlen) + strncpy(Str, string, 255); + else { + strcpy(Str, (char *)""); + x = Maxlen - Strlen; + z = x / 2; + for (i = 0; i < z; i++) + strcat(Str, " "); + strncat(Str, string, 255); } + + strncat(Str, (char *)"\r\n", 255); + return Str; } void Center(char *string) { - int Strlen; - int Maxlen = cols; - int i, x, z; - char *Str; + PUTSTR(Center_str(string)); +} - Str = calloc(1024, sizeof(char)); - Strlen = strlen(string); - if (Strlen == Maxlen) - PUTSTR(string); - else { - x = Maxlen - Strlen; - z = x / 2; - for (i = 0; i < z; i++) - strcat(Str, " "); - strcat(Str, string); - PUTSTR(Str); - } - PUTCHAR('\r'); - PUTCHAR('\n'); - free(Str); + +char *clear_str(void) +{ + static char temp[41]; + + strncpy(temp, colour_str(LIGHTGRAY, BLACK), 40); + strncat(temp, (char *)ANSI_HOME, 40); + strncat(temp, (char *)ANSI_CLEAR, 50); + return temp; } void clear() { - if (termmode == 1) { - colour(LIGHTGRAY, BLACK); - PUTSTR((char *)ANSI_HOME); - PUTSTR((char *)ANSI_CLEAR); - } else - Enter(1); + PUTSTR(clear_str()); } @@ -184,36 +225,62 @@ void clear() /* * Moves cursor to specified position */ -void locate(int y, int x) +char *locate_str(int y, int x) { - char temp[61]; - - if (termmode > 0) { - if (y > rows || x > cols) { - snprintf(temp, 61, "ANSI: Invalid screen coordinates: %i, %i\n", y, x); - } else { - snprintf(temp, 61, "\x1B[%i;%iH", y, x); - } - PUTSTR(temp); + static char temp[61]; + + if (y > rows || x > cols) { + snprintf(temp, 61, "ANSI: Invalid screen coordinates: %i, %i\n", y, x); + } else { + snprintf(temp, 61, "\x1B[%i;%iH", y, x); } + return temp; } -void fLine(int Len) +void locate(int y, int x) { - int x; + PUTSTR(locate_str(y, x)); +} - if (termmode == 0) - for (x = 0; x < Len; x++) - PUTCHAR('-'); - if (termmode == 1) - for (x = 0; x < Len; x++) - PUTCHAR(196); - PUTCHAR('\r'); - PUTCHAR('\n'); +char *hLine_str(int Len) +{ + int x; + static char temp[256]; + + strcpy(temp, ""); + for (x = 0; x < Len; x++) + strncat(temp, (char *)"\xC4", 255); + + return temp; +} + + + +char *fLine_str(int Len) +{ + static char temp[255]; + + strncpy(temp, hLine_str(Len), 255); + strncat(temp, (char *)"\r\n", 255); + return temp; +} + + + +void fLine(int Len) +{ + PUTSTR(fLine_str(Len)); +} + + + +char *sLine_str(void) +{ + return fLine_str(cols -1); } diff --git a/mbsebbs/term.h b/mbsebbs/term.h index 4ca78d26..fdc3dd60 100644 --- a/mbsebbs/term.h +++ b/mbsebbs/term.h @@ -3,16 +3,25 @@ /* $Id$ */ -void TermInit(int); void Enter(int); +char *pout_str(int, int, char *); void pout(int, int, char *); +char *poutCR_str(int, int, char *); void poutCR(int, int, char *); +char *poutCenter_str(int,int,char *); void poutCenter(int,int,char *); +char *colour_str(int, int); void colour(int, int); +char *Center_str(char *); void Center(char *); +char *clear_str(void); void clear(void); +char *locate_str(int, int); void locate(int, int); +char *hLine_str(int); +char *fLine_str(int); void fLine(int); +char *sLine_str(void); void sLine(void); void mvprintw(int, int, const char *, ...); diff --git a/mbsebbs/user.c b/mbsebbs/user.c index 30a19fa1..b2b21ef9 100644 --- a/mbsebbs/user.c +++ b/mbsebbs/user.c @@ -246,6 +246,7 @@ void user(void) /* * Setup users favourite language. */ + utf8 = (usrconfig.Charset == FTNC_UTF8); Set_Language(usrconfig.iLanguage); Free_Language(); InitLanguage(); @@ -259,7 +260,6 @@ void user(void) UserCity(mypid, usrconfig.Name, usrconfig.sLocation); else UserCity(mypid, usrconfig.Name, (char *)"N/A"); - TermInit(usrconfig.GraphMode); /* * Count simultaneous logins @@ -528,13 +528,11 @@ void user(void) * file, search order is the same as in DisplayFile() */ st.st_mtime = 0; - if (exitinfo.GraphMode) { - snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.ans", getenv("MBSE_ROOT"), lang.lc); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.ans", getenv("MBSE_ROOT"), lang.lc); + stat(temp, &st); + if (st.st_mtime == 0) { + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.ans", getenv("MBSE_ROOT"), CFG.deflang); stat(temp, &st); - if (st.st_mtime == 0) { - snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.ans", getenv("MBSE_ROOT"), CFG.deflang); - stat(temp, &st); - } } if (st.st_mtime == 0) { snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.asc", getenv("MBSE_ROOT"), lang.lc); diff --git a/mbsebbs/userlist.c b/mbsebbs/userlist.c index e6b881b2..5d26f511 100644 --- a/mbsebbs/userlist.c +++ b/mbsebbs/userlist.c @@ -4,7 +4,7 @@ * Purpose ...............: Display Userlist * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -41,13 +41,14 @@ extern int rows; +extern int cols; void UserList(char *OpData) { FILE *pUsrConfig; int LineCount = 2, iFoundName = FALSE, iNameCount = 0; - char *Name, *sTemp, *User, *temp, msg[81]; + char ustr[128], *Name, *sTemp, *User, *temp, msg[81]; struct userhdr uhdr; struct userrec u; @@ -56,10 +57,13 @@ void UserList(char *OpData) sTemp = calloc(81, sizeof(char)); User = calloc(81, sizeof(char)); - clear(); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); + + strcpy(ustr, clear_str()); /* User List */ - language(WHITE, BLACK, 126); - Enter(1); + strncat(ustr, poutCR_str(WHITE, BLACK, (char *) Language(126)), 127); + PUTSTR(chartran(ustr)); LineCount = 1; snprintf(temp, PATH_MAX, "%s/etc/users.data", getenv("MBSE_ROOT")); @@ -74,16 +78,19 @@ void UserList(char *OpData) colour(CFG.InputColourF, CFG.InputColourB); alarm_on(); GetstrC(Name, 35); - clear(); - + + strcpy(ustr, clear_str()); /* Name Location Last On Calls */ - language(WHITE, BLACK, 128); - Enter(1); + strncat(ustr, poutCR_str(WHITE, BLACK, (char *) Language(128)), 127); + PUTSTR(chartran(ustr)); - colour(GREEN, BLACK); - fLine(79); + strcpy(ustr, colour_str(GREEN, BLACK)); + strncat(ustr, fLine_str(cols -1), 127); + PUTSTR(chartran(ustr)); + + strcpy(ustr, colour_str(CYAN, BLACK)); + PUTSTR(chartran(ustr)); - colour(CYAN, BLACK); while (fread(&u, uhdr.recsize, 1, pUsrConfig) == 1) { if ((strcmp(Name,"")) != 0) { if (((strcasecmp(OpData, "/H")) == 0) && strlen(u.sHandle)) @@ -150,14 +157,17 @@ void UserList(char *OpData) fclose(pUsrConfig); - colour(GREEN, BLACK); - fLine(79); + strcpy(ustr, colour_str(GREEN, BLACK)); + strncat(ustr, fLine_str(cols -1), 127); + PUTSTR(chartran(ustr)); free(temp); free(Name); free(sTemp); free(User); + chartran_close(); + Pause(); } diff --git a/mbsebbs/whoson.c b/mbsebbs/whoson.c index e4cb9c34..2f82d254 100644 --- a/mbsebbs/whoson.c +++ b/mbsebbs/whoson.c @@ -4,7 +4,7 @@ * Purpose ...............: Who's online functions * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -50,37 +50,41 @@ extern int LC_Download, LC_Upload, LC_Read, LC_Chat, LC_Olr, LC_Door; */ void WhosOn(char *OpData) { - char buf[128], *Heading, *Underline, *cnt, *isdoing, *location, *device; - char *fullname, *temp, msg[81]; - int i, x, Start = TRUE; + char buf[128], *Heading, *cnt, *isdoing, *location, *device; + char *fullname, *temp, msg[81], wstr[128];; + int x, Start = TRUE; FILE *fp; struct userhdr ushdr; struct userrec us; - Underline = calloc(81, sizeof(char)); Heading = calloc(81, sizeof(char)); WhosDoingWhat(WHOSON, NULL); - clear(); - Enter(1); - colour(WHITE, BLACK); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); + + strcpy(wstr, clear_str()); + strncat(wstr, (char *)"\r\n", 127); + strncat(wstr, colour_str(WHITE, BLACK), 127); /* Callers On-Line to */ snprintf(Heading, 81, "%s%s", (char *) Language(414), CFG.bbs_name); - Center(Heading); - x = strlen(Heading); + strncat(wstr, Center_str(Heading), 127); + PUTSTR(chartran(wstr)); - for(i = 0; i < x; i++) - snprintf(Underline, 81, "%s%c", Underline, exitinfo.GraphMode ? 196 : 45); - colour(LIGHTRED, BLACK); - Center(Underline); - Enter(1); + x = strlen(Heading); + strcpy(wstr, colour_str(LIGHTRED, BLACK)); + strncat(wstr, Center_str(hLine_str(x)), 127); + PUTSTR(chartran(wstr)); /* Name Device Status Location */ - pout(LIGHTGREEN, BLACK, (char *) Language(415)); - Enter(1); - colour(GREEN, BLACK); - fLine(79); + strcpy(wstr, pout_str(LIGHTGREEN, BLACK, (char *) Language(415))); + strncat(wstr, (char *)"\r\n", 127); + PUTSTR(chartran(wstr)); + + strcpy(wstr, colour_str(GREEN, BLACK)); + strncat(wstr, fLine_str(79), 127); + PUTSTR(chartran(wstr)); while (TRUE) { if (Start) @@ -192,10 +196,11 @@ void WhosOn(char *OpData) } } - colour(GREEN, BLACK); - fLine(79); + strcpy(wstr, colour_str(GREEN, BLACK)); + strncat(wstr, fLine_str(79), 127); + PUTSTR(chartran(wstr)); - free(Underline); + chartran_close(); free(Heading); Enter(1); } diff --git a/mbsetup/ledit.c b/mbsetup/ledit.c index 054b18ae..b2797636 100644 --- a/mbsetup/ledit.c +++ b/mbsetup/ledit.c @@ -2207,7 +2207,6 @@ char *getmenutype(int val) case 301: return (char *)"Change transfer protocol"; case 302: return (char *)"Change password"; case 303: return (char *)"Change location"; - case 304: return (char *)"Change graphics mode"; case 305: return (char *)"Change voice phone"; case 306: return (char *)"Change data phone"; case 307: return (char *)"Change show news bulletins";