System update to UTF-8
This commit is contained in:
parent
2a0fa86557
commit
c5e7083deb
43
ChangeLog
43
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.
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<BLOCKQUOTE>
|
||||
<DIV align=right><h5>Last update 05-Mar-2006</h5></div>
|
||||
<DIV align=right><h5>Last update 25-Feb-2007</h5></div>
|
||||
<DIV align=center><h1>MBSE BBS Control Codes in ANSI and ASCII files</h1></DIV>
|
||||
<hr>
|
||||
|
||||
@ -101,7 +101,7 @@ For example: ^B32000^BThis is the text^B<br>
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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 [<J>a/<n>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? [<J>a/<n>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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
@ -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++;
|
||||
}
|
||||
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)
|
||||
|
@ -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)) {
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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) {
|
||||
if ((fp = 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);
|
||||
if ((fp = fopen(newfile, "rb")) == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
Syslog('B', "Displayfile %s", newfile);
|
||||
while (fgets(buf, sizeof(buf)-1, fp)) {
|
||||
|
||||
while (!feof(pFileName)) {
|
||||
i = fread(sFileName, sizeof(char), 16384, pFileName);
|
||||
|
||||
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 <cr>, 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 <cr> 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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
106
mbsebbs/fsedit.c
106
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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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,10 +1299,9 @@ 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;
|
||||
|
@ -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 */
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -591,10 +591,6 @@ void DoMenu(int Type)
|
||||
Chg_Location();
|
||||
break;
|
||||
|
||||
case 304:
|
||||
Chg_Graphics();
|
||||
break;
|
||||
|
||||
case 305:
|
||||
Chg_VoicePhone();
|
||||
break;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Offline Reader
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2006
|
||||
* Copyright (C) 1997-2007
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -1211,7 +1211,6 @@ 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);
|
||||
if (exitinfo.OL_ExtInfo)
|
||||
Inf.uflags |= le_us(INF_EXT_INFO);
|
||||
|
186
mbsebbs/pinfo.c
186
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);
|
||||
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__);
|
||||
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(LIGHTRED, BLACK, padleft(temp, 76, ' ')), 255);
|
||||
rs();
|
||||
PUTSTR(chartran(pstr));
|
||||
|
||||
PUTCHAR(a ? 212 : '+');
|
||||
for (i = 0; i < 76; i++)
|
||||
PUTCHAR(a ? 205 : '=');
|
||||
PUTCHAR(a ? 190 : '+');
|
||||
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));
|
||||
|
||||
free(string);
|
||||
free(temp);
|
||||
chartran_close();
|
||||
Enter(1);
|
||||
Pause();
|
||||
}
|
||||
|
@ -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
|
||||
|
199
mbsebbs/term.c
199
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,25 +114,25 @@ void poutCR(int fg, int bg, char *Str)
|
||||
/*
|
||||
* Changes ansi background and foreground color
|
||||
*/
|
||||
void colour(int fg, int bg)
|
||||
char *colour_str(int fg, int bg)
|
||||
{
|
||||
char temp[61];
|
||||
static char temp[61];
|
||||
char tmp1[40];
|
||||
|
||||
if (termmode == 1) {
|
||||
|
||||
int att=0, fore=37, back=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);
|
||||
PUTSTR(temp);
|
||||
return;
|
||||
return temp;
|
||||
}
|
||||
|
||||
PUTSTR((char *)"[");
|
||||
strcpy(temp, "\x1B[");
|
||||
|
||||
if ( fg > WHITE) {
|
||||
PUTSTR((char *)"5;");
|
||||
strcat(temp, (char *)"5;");
|
||||
fg-= 16;
|
||||
}
|
||||
|
||||
if (fg > LIGHTGRAY) {
|
||||
att=1;
|
||||
fg=fg-8;
|
||||
@ -135,48 +156,68 @@ void colour(int fg, int bg)
|
||||
else if (bg == LIGHTGRAY) back=47;
|
||||
else back=40;
|
||||
|
||||
snprintf(temp, 61, "%d;%d;%dm", att, fore, back);
|
||||
PUTSTR(temp);
|
||||
snprintf(tmp1, 41, "%d;%d;%dm", att, fore, back);
|
||||
strncat(temp, tmp1, 60);
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void colour(int fg, int bg)
|
||||
{
|
||||
PUTSTR(colour_str(fg, bg));
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *Center_str(char *string)
|
||||
{
|
||||
int Strlen, Maxlen = cols, i, x, z;
|
||||
static char Str[256];
|
||||
|
||||
Strlen = strlen(string);
|
||||
if (Maxlen > 255)
|
||||
Maxlen = 255;
|
||||
|
||||
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];
|
||||
static 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);
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void locate(int y, int x)
|
||||
{
|
||||
PUTSTR(locate_str(y, x));
|
||||
}
|
||||
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
int x;
|
||||
PUTSTR(fLine_str(Len));
|
||||
}
|
||||
|
||||
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 *sLine_str(void)
|
||||
{
|
||||
return fLine_str(cols -1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 *, ...);
|
||||
|
||||
|
@ -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,14 +528,12 @@ 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);
|
||||
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);
|
||||
stat(temp, &st);
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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";
|
||||
|
Reference in New Issue
Block a user