System update to UTF-8
This commit is contained in:
@@ -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) {
|
||||
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 <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,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;
|
||||
|
@@ -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,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);
|
||||
|
190
mbsebbs/pinfo.c
190
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();
|
||||
}
|
||||
|
@@ -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
|
||||
|
263
mbsebbs/term.c
263
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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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,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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user