2002-03-29 22:58:53 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
* Purpose ...............: MBSE BBS functions for TURBODIESEL
|
|
|
|
*
|
|
|
|
*****************************************************************************
|
2004-01-28 21:10:56 +00:00
|
|
|
* Copyright (C) 1997-2004
|
2002-03-29 22:58:53 +00:00
|
|
|
*
|
|
|
|
* Michiel Broek FIDO: 2:280/2802
|
|
|
|
* Beekmansbos 10
|
|
|
|
* 1971 BV IJmuiden
|
|
|
|
* the Netherlands
|
|
|
|
*
|
|
|
|
* This file is part of MBSE BBS.
|
|
|
|
*
|
|
|
|
* This BBS is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* MBSE BBS is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with MBSE BBS; see the file COPYING. If not, write to the Free
|
2003-08-15 20:05:34 +00:00
|
|
|
* Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
2002-03-29 22:58:53 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2002-06-30 12:48:44 +00:00
|
|
|
#include "../config.h"
|
2002-03-29 22:58:53 +00:00
|
|
|
#include "libs.h"
|
|
|
|
#include "structs.h"
|
|
|
|
#include "users.h"
|
|
|
|
#include "records.h"
|
2002-03-31 15:04:34 +00:00
|
|
|
#include "common.h"
|
2002-03-29 22:58:53 +00:00
|
|
|
#include "clcomm.h"
|
|
|
|
#include "diesel.h"
|
|
|
|
|
2002-04-03 20:29:12 +00:00
|
|
|
static int firstrandom = TRUE;
|
|
|
|
|
2002-03-29 22:58:53 +00:00
|
|
|
|
2002-03-31 13:09:23 +00:00
|
|
|
void MacroVars( const char *codes, const char *fmt, ...)
|
|
|
|
{
|
|
|
|
char *tmp1, *tmp2;
|
|
|
|
va_list ap;
|
|
|
|
int j;
|
|
|
|
int dieselrc;
|
|
|
|
char *vs;
|
|
|
|
int vd;
|
|
|
|
char vc;
|
|
|
|
double vf;
|
|
|
|
|
2002-04-10 20:29:57 +00:00
|
|
|
tmp1=calloc(MAXSTR, sizeof(char));
|
|
|
|
tmp2=calloc(MAXSTR, sizeof(char));
|
2002-03-31 13:09:23 +00:00
|
|
|
|
|
|
|
va_start(ap,fmt);
|
|
|
|
for ( j=0; (codes[j] != '\0') && (fmt[j] != '\0') ; j++ ){
|
|
|
|
tmp1[0]='\0';
|
|
|
|
switch(fmt[j]) {
|
|
|
|
case 's': /* string */
|
|
|
|
vs = va_arg(ap, char *);
|
|
|
|
sprintf(tmp1,"@(setvar,%c,\"%s\")",codes[j],vs);
|
|
|
|
break;
|
|
|
|
case 'd': /* int */
|
|
|
|
vd = va_arg(ap, int);
|
|
|
|
sprintf(tmp1,"@(setvar,%c,%d)",codes[j],vd);
|
|
|
|
break;
|
|
|
|
case 'c': /* char */
|
2002-05-02 17:19:49 +00:00
|
|
|
vc = va_arg(ap, int);
|
2002-03-31 13:09:23 +00:00
|
|
|
sprintf(tmp1,"@(setvar,%c,%c)",codes[j],vc);
|
|
|
|
break;
|
|
|
|
case 'f': /* char */
|
|
|
|
vf = va_arg(ap, double);
|
|
|
|
sprintf(tmp1,"@(setvar,%c,%f)",codes[j],vf);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
dieselrc=diesel(tmp1,tmp2);
|
|
|
|
if (dieselrc) {
|
2002-05-11 15:30:34 +00:00
|
|
|
Syslog('!', "MacroVars error %d argument %d, macro %c type %c", dieselrc, j, codes[j], fmt[j]);
|
2002-03-31 13:09:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
free(tmp1);
|
|
|
|
free(tmp2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MacroClear(void)
|
|
|
|
{
|
|
|
|
int dieselrc;
|
|
|
|
char tmp1[] = "@(CLEAR)", *tmp2;
|
|
|
|
|
|
|
|
tmp2 = calloc(10,sizeof(char));
|
|
|
|
dieselrc = diesel(tmp1, tmp2);
|
|
|
|
if (dieselrc)
|
|
|
|
Syslog('!', "MacroClear error %d", dieselrc);
|
|
|
|
free(tmp2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *ParseMacro( const char *line, int *dieselrc)
|
|
|
|
{
|
2002-04-10 20:29:57 +00:00
|
|
|
static char res[MAXSTR];
|
2002-03-31 13:09:23 +00:00
|
|
|
char *tmp1, *tmp2, *tmp3, *i;
|
|
|
|
int j, l;
|
|
|
|
char code;
|
|
|
|
|
|
|
|
res[0]='\0';
|
|
|
|
*dieselrc=0;
|
|
|
|
|
|
|
|
if ( *line == '#' )
|
|
|
|
return res;
|
|
|
|
|
2002-04-10 20:29:57 +00:00
|
|
|
tmp1 = calloc(MAXSTR, sizeof(char));
|
|
|
|
tmp2 = calloc(MAXSTR, sizeof(char));
|
|
|
|
tmp3 = calloc(MAXSTR, sizeof(char));
|
2002-03-31 13:09:23 +00:00
|
|
|
|
|
|
|
tmp1[0]='\0';
|
|
|
|
|
|
|
|
for ( i=line ; i[0] != '\0'; i++){
|
|
|
|
if ( (i[0] == '@') && isalpha(i[1]) ){
|
|
|
|
l=2;
|
|
|
|
i++;
|
|
|
|
if (i[0] != '@') {
|
|
|
|
if ((code = i[0]) != '\0' )
|
|
|
|
i++;
|
|
|
|
while (( i[0] == '_') || ( i[0] == '>') || ( i[0] == '<') ){
|
|
|
|
l++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
i--;
|
|
|
|
sprintf(tmp2,"@(GETVAR,%c)",code);
|
|
|
|
if (!diesel(tmp2,tmp3)==0){
|
|
|
|
sprintf(tmp3,"%c%c",'@',code);
|
|
|
|
}
|
|
|
|
if (l>2){
|
|
|
|
if ( *i != '>')
|
|
|
|
l=-l;
|
|
|
|
sprintf(&tmp1[strlen(tmp1)],"%*.*s",l,l, tmp3);
|
|
|
|
}else{
|
|
|
|
sprintf(&tmp1[strlen(tmp1)],"%s",tmp3);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
tmp1[(j=strlen(tmp1))]='@';
|
|
|
|
tmp1[j+1]='\0';
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
tmp1[(j=strlen(tmp1))]=i[0];
|
|
|
|
tmp1[j+1]='\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
i = tmp1;
|
|
|
|
sprintf(tmp2,"%s",tmp1);
|
|
|
|
|
|
|
|
if ((tmp1[0]=='@') && (tmp1[1]=='{')){
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
for (j=2; ((tmp1[j]!='}') && (tmp1[j]!='\0'));j++){
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if ( (tmp1[j]=='}') ){
|
|
|
|
i++;
|
|
|
|
res[0]='\0';
|
|
|
|
if (j>2)
|
|
|
|
sprintf(res,"%.*s",j-2,&tmp1[2]);
|
|
|
|
if ((diesel(res,tmp3)!=0) || (atoi(tmp3)==0))
|
|
|
|
sprintf(tmp2,"@!%s",i);
|
|
|
|
else
|
|
|
|
sprintf(tmp2,"%s",i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*dieselrc=diesel(tmp2, res);
|
|
|
|
|
|
|
|
free(tmp1);
|
|
|
|
free(tmp2);
|
|
|
|
free(tmp3);
|
|
|
|
while (isspace(res[strlen(res) - 1])) {
|
|
|
|
res[strlen(res) - 1] = EOS;
|
|
|
|
}
|
|
|
|
if ((res[0] == '@') && (res[1] =='!' ))
|
|
|
|
res[0]='\0';
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-03-29 22:58:53 +00:00
|
|
|
|
2002-04-03 20:29:12 +00:00
|
|
|
/*
|
|
|
|
* Add random fortune cookie to the macrovars
|
|
|
|
*/
|
2002-05-11 15:30:34 +00:00
|
|
|
void Cookie(int);
|
|
|
|
void Cookie(int HtmlMode)
|
2002-04-03 20:29:12 +00:00
|
|
|
{
|
|
|
|
FILE *olf;
|
2002-05-11 15:30:34 +00:00
|
|
|
char *fname, outbuf[256];
|
2002-04-03 20:29:12 +00:00
|
|
|
long recno, records;
|
|
|
|
|
2002-04-27 11:38:59 +00:00
|
|
|
MacroVars("F", "s", "");
|
2002-04-03 20:29:12 +00:00
|
|
|
fname = calloc(PATH_MAX, sizeof(char));
|
|
|
|
sprintf(fname, "%s/etc/oneline.data", getenv("MBSE_ROOT"));
|
|
|
|
|
|
|
|
if ((olf = fopen(fname, "r")) == NULL) {
|
2002-04-27 11:38:59 +00:00
|
|
|
WriteError("Can't open %s", fname);
|
2002-04-03 20:29:12 +00:00
|
|
|
free(fname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fread(&olhdr, sizeof(olhdr), 1, olf);
|
|
|
|
fseek(olf, 0, SEEK_END);
|
|
|
|
records = (ftell(olf) - olhdr.hdrsize) / olhdr.recsize;
|
|
|
|
|
|
|
|
if (firstrandom) {
|
|
|
|
srand(getpid());
|
|
|
|
firstrandom = FALSE;
|
|
|
|
}
|
2002-04-27 21:06:51 +00:00
|
|
|
recno = (1+(int) (1.0 * records * rand() / (RAND_MAX + 1.0))) - 1;
|
2002-04-03 20:29:12 +00:00
|
|
|
|
|
|
|
if (fseek(olf, olhdr.hdrsize + (recno * olhdr.recsize), SEEK_SET) == 0) {
|
|
|
|
if (fread(&ol, olhdr.recsize, 1, olf) == 1) {
|
2002-05-11 15:30:34 +00:00
|
|
|
if (HtmlMode) {
|
|
|
|
html_massage(ol.Oneline, outbuf);
|
|
|
|
MacroVars("F", "s", outbuf);
|
|
|
|
} else {
|
|
|
|
MacroVars("F", "s", ol.Oneline);
|
|
|
|
}
|
2002-04-03 20:29:12 +00:00
|
|
|
} else {
|
2002-04-27 11:38:59 +00:00
|
|
|
WriteError("Can't read record %d from %s", recno, fname);
|
2002-04-03 20:29:12 +00:00
|
|
|
}
|
|
|
|
} else {
|
2002-04-27 11:38:59 +00:00
|
|
|
WriteError("Can't seek record %d in %s", recno, fname);
|
2002-04-03 20:29:12 +00:00
|
|
|
}
|
|
|
|
fclose(olf);
|
|
|
|
free(fname);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-04-10 20:29:57 +00:00
|
|
|
/*
|
|
|
|
* Translate ISO 8859-1 characters to named character entities
|
|
|
|
*/
|
|
|
|
void html_massage(char *inbuf, char *outbuf)
|
|
|
|
{
|
|
|
|
char *inptr = inbuf;
|
|
|
|
char *outptr = outbuf;
|
|
|
|
|
|
|
|
memset(outbuf, 0, sizeof(outbuf));
|
|
|
|
|
|
|
|
while (*inptr) {
|
|
|
|
|
|
|
|
switch ((unsigned char)*inptr) {
|
|
|
|
|
|
|
|
case '"': sprintf(outptr, """); break;
|
|
|
|
case '&': sprintf(outptr, "&"); break;
|
|
|
|
case '<': sprintf(outptr, "<"); break;
|
|
|
|
case '>': sprintf(outptr, ">"); break;
|
|
|
|
case 160: sprintf(outptr, " "); break;
|
|
|
|
case 161: sprintf(outptr, "¡"); break;
|
|
|
|
case 162: sprintf(outptr, "¢"); break;
|
|
|
|
case 163: sprintf(outptr, "£"); break;
|
|
|
|
case 164: sprintf(outptr, "¤"); break;
|
|
|
|
case 165: sprintf(outptr, "¥"); break;
|
|
|
|
case 166: sprintf(outptr, "¦"); break;
|
|
|
|
case 167: sprintf(outptr, "§"); break;
|
|
|
|
case 168: sprintf(outptr, "¨"); break;
|
|
|
|
case 169: sprintf(outptr, "©"); break;
|
|
|
|
case 170: sprintf(outptr, "ª"); break;
|
|
|
|
case 171: sprintf(outptr, "«"); break;
|
|
|
|
case 172: sprintf(outptr, "¬"); break;
|
|
|
|
case 173: sprintf(outptr, "­"); break;
|
|
|
|
case 174: sprintf(outptr, "®"); break;
|
|
|
|
case 175: sprintf(outptr, "¯"); break;
|
|
|
|
case 176: sprintf(outptr, "°"); break;
|
2002-05-15 21:34:57 +00:00
|
|
|
case 177: sprintf(outptr, "&plumin;"); break;
|
2002-04-10 20:29:57 +00:00
|
|
|
case 178: sprintf(outptr, "²"); break;
|
|
|
|
case 179: sprintf(outptr, "³"); break;
|
|
|
|
case 180: sprintf(outptr, "´"); break;
|
|
|
|
case 181: sprintf(outptr, "µ"); break;
|
|
|
|
case 182: sprintf(outptr, "¶"); break;
|
|
|
|
case 183: sprintf(outptr, "·"); break;
|
|
|
|
case 184: sprintf(outptr, "¸"); break;
|
|
|
|
case 185: sprintf(outptr, "&supl;"); break;
|
|
|
|
case 186: sprintf(outptr, "º"); break;
|
|
|
|
case 187: sprintf(outptr, "»"); break;
|
|
|
|
case 188: sprintf(outptr, "¼"); break;
|
|
|
|
case 189: sprintf(outptr, "½"); break;
|
|
|
|
case 190: sprintf(outptr, "¾"); break;
|
|
|
|
case 191: sprintf(outptr, "¿"); break;
|
|
|
|
case 192: sprintf(outptr, "À"); break;
|
|
|
|
case 193: sprintf(outptr, "Á"); break;
|
|
|
|
case 194: sprintf(outptr, "Â"); break;
|
|
|
|
case 195: sprintf(outptr, "Ã"); break;
|
|
|
|
case 196: sprintf(outptr, "Ä"); break;
|
|
|
|
case 197: sprintf(outptr, "Å"); break;
|
|
|
|
case 198: sprintf(outptr, "Æ"); break;
|
|
|
|
case 199: sprintf(outptr, "Ç"); break;
|
|
|
|
case 200: sprintf(outptr, "È"); break;
|
|
|
|
case 201: sprintf(outptr, "É"); break;
|
|
|
|
case 202: sprintf(outptr, "Ê"); break;
|
|
|
|
case 203: sprintf(outptr, "Ë"); break;
|
|
|
|
case 204: sprintf(outptr, "Ì"); break;
|
|
|
|
case 205: sprintf(outptr, "Í"); break;
|
|
|
|
case 206: sprintf(outptr, "Î"); break;
|
|
|
|
case 207: sprintf(outptr, "Ï"); break;
|
|
|
|
case 208: sprintf(outptr, "Ð"); break;
|
|
|
|
case 209: sprintf(outptr, "Ñ"); break;
|
|
|
|
case 210: sprintf(outptr, "Ò"); break;
|
|
|
|
case 211: sprintf(outptr, "Ó"); break;
|
|
|
|
case 212: sprintf(outptr, "Ô"); break;
|
|
|
|
case 213: sprintf(outptr, "Õ"); break;
|
|
|
|
case 214: sprintf(outptr, "Ö"); break;
|
|
|
|
case 215: sprintf(outptr, "×"); break;
|
|
|
|
case 216: sprintf(outptr, "Ø"); break;
|
|
|
|
case 217: sprintf(outptr, "Ù"); break;
|
|
|
|
case 218: sprintf(outptr, "Ú"); break;
|
|
|
|
case 219: sprintf(outptr, "Û"); break;
|
|
|
|
case 220: sprintf(outptr, "Ü"); break;
|
|
|
|
case 221: sprintf(outptr, "Ý"); break;
|
|
|
|
case 222: sprintf(outptr, "Þ"); break;
|
|
|
|
case 223: sprintf(outptr, "ß"); break;
|
|
|
|
case 224: sprintf(outptr, "à"); break;
|
|
|
|
case 225: sprintf(outptr, "á"); break;
|
|
|
|
case 226: sprintf(outptr, "â"); break;
|
|
|
|
case 227: sprintf(outptr, "ã"); break;
|
|
|
|
case 228: sprintf(outptr, "ä"); break;
|
|
|
|
case 229: sprintf(outptr, "å"); break;
|
|
|
|
case 230: sprintf(outptr, "æ"); break;
|
|
|
|
case 231: sprintf(outptr, "ç"); break;
|
|
|
|
case 232: sprintf(outptr, "è"); break;
|
|
|
|
case 233: sprintf(outptr, "é"); break;
|
|
|
|
case 234: sprintf(outptr, "ê"); break;
|
|
|
|
case 235: sprintf(outptr, "ë"); break;
|
|
|
|
case 236: sprintf(outptr, "ì"); break;
|
|
|
|
case 237: sprintf(outptr, "í"); break;
|
|
|
|
case 238: sprintf(outptr, "î"); break;
|
|
|
|
case 239: sprintf(outptr, "ï"); break;
|
|
|
|
case 240: sprintf(outptr, "ð"); break;
|
|
|
|
case 241: sprintf(outptr, "ñ"); break;
|
|
|
|
case 242: sprintf(outptr, "ò"); break;
|
|
|
|
case 243: sprintf(outptr, "ó"); break;
|
|
|
|
case 244: sprintf(outptr, "ô"); break;
|
|
|
|
case 245: sprintf(outptr, "õ"); break;
|
|
|
|
case 246: sprintf(outptr, "ö"); break;
|
|
|
|
case 247: sprintf(outptr, "÷"); break;
|
|
|
|
case 248: sprintf(outptr, "ø"); break;
|
|
|
|
case 249: sprintf(outptr, "ù"); break;
|
|
|
|
case 250: sprintf(outptr, "ú"); break;
|
|
|
|
case 251: sprintf(outptr, "û"); break;
|
|
|
|
case 252: sprintf(outptr, "ü"); break;
|
|
|
|
case 253: sprintf(outptr, "ý"); break;
|
|
|
|
case 254: sprintf(outptr, "þ"); break;
|
|
|
|
case 255: sprintf(outptr, "ÿ"); break;
|
|
|
|
default: *outptr++ = *inptr; *outptr = '\0'; break;
|
|
|
|
}
|
|
|
|
while (*outptr)
|
|
|
|
outptr++;
|
|
|
|
|
|
|
|
inptr++;
|
|
|
|
}
|
|
|
|
*outptr = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FILE *OpenMacro(const char *filename, int Language, int htmlmode)
|
2002-03-29 22:58:53 +00:00
|
|
|
{
|
|
|
|
FILE *pLang, *fi = NULL;
|
2002-04-10 20:29:57 +00:00
|
|
|
char *temp, *aka, linebuf[1024], outbuf[1024];
|
2002-03-29 22:58:53 +00:00
|
|
|
|
|
|
|
temp = calloc(PATH_MAX, sizeof(char));
|
2002-04-10 20:29:57 +00:00
|
|
|
aka = calloc(81, sizeof(char));
|
2002-03-29 22:58:53 +00:00
|
|
|
temp[0] = '\0';
|
|
|
|
|
|
|
|
if (Language != '\0') {
|
|
|
|
/*
|
|
|
|
* Maybe a valid language character, try to load the language
|
|
|
|
*/
|
|
|
|
sprintf(temp, "%s/etc/language.data", getenv("MBSE_ROOT"));
|
|
|
|
if ((pLang = fopen(temp, "rb")) == NULL) {
|
|
|
|
WriteError("mbdiesel: Can't open language file: %s", temp);
|
|
|
|
} else {
|
|
|
|
fread(&langhdr, sizeof(langhdr), 1, pLang);
|
|
|
|
|
|
|
|
while (fread(&lang, langhdr.recsize, 1, pLang) == 1) {
|
|
|
|
if ((lang.LangKey[0] == Language) && (lang.Available)) {
|
|
|
|
sprintf(temp,"%s/%s", lang.MacroPath, filename);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fclose(pLang);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Try to open the selected language
|
|
|
|
*/
|
|
|
|
if (temp[0] != '\0')
|
|
|
|
fi = fopen(temp, "r");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If no selected language is loaded, try default language
|
|
|
|
*/
|
|
|
|
if (fi == NULL) {
|
2002-05-18 13:49:55 +00:00
|
|
|
Syslog('-', "Macro file \"%s\" for language %c not found, trying default", filename, Language);
|
2002-03-29 22:58:53 +00:00
|
|
|
sprintf(temp, "%s/%s", CFG.bbs_macros, filename);
|
|
|
|
fi = fopen(temp,"r");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fi == NULL)
|
2002-03-31 20:07:04 +00:00
|
|
|
WriteError("OpenMacro(%s, %c): not found", filename, Language);
|
2002-03-31 15:04:34 +00:00
|
|
|
else {
|
2002-04-01 20:27:30 +00:00
|
|
|
sprintf(temp, "%s-%s", OsName(), OsCPU());
|
2002-04-10 20:29:57 +00:00
|
|
|
if (CFG.aka[0].point)
|
|
|
|
sprintf(aka, "%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);
|
|
|
|
else
|
|
|
|
sprintf(aka, "%d:%d/%d@%s", CFG.aka[0].zone, CFG.aka[0].net, CFG.aka[0].node, CFG.aka[0].domain);
|
|
|
|
|
|
|
|
if (htmlmode) {
|
2002-05-18 13:49:55 +00:00
|
|
|
MacroVars("O", "s", temp);
|
|
|
|
sprintf(linebuf, "%s", CFG.sysop);
|
|
|
|
html_massage(linebuf, outbuf);
|
|
|
|
MacroVars("U", "s", outbuf);
|
2002-04-10 20:29:57 +00:00
|
|
|
sprintf(linebuf, "%s", CFG.location);
|
|
|
|
html_massage(linebuf, outbuf);
|
|
|
|
MacroVars("L", "s", outbuf);
|
|
|
|
sprintf(linebuf, "%s", CFG.bbs_name);
|
|
|
|
html_massage(linebuf, outbuf);
|
|
|
|
MacroVars("N", "s", outbuf);
|
|
|
|
sprintf(linebuf, "%s", CFG.sysop_name);
|
|
|
|
html_massage(linebuf, outbuf);
|
|
|
|
MacroVars("S", "s", outbuf);
|
|
|
|
sprintf(linebuf, "%s", CFG.comment);
|
|
|
|
html_massage(linebuf, outbuf);
|
|
|
|
MacroVars("T", "s", outbuf);
|
|
|
|
} else {
|
2002-05-18 13:49:55 +00:00
|
|
|
MacroVars("L", "s", CFG.location);
|
|
|
|
MacroVars("N", "s", CFG.bbs_name);
|
|
|
|
MacroVars("O", "s", temp);
|
|
|
|
MacroVars("S", "s", CFG.sysop_name);
|
|
|
|
MacroVars("T", "s", CFG.comment);
|
|
|
|
MacroVars("U", "s", CFG.sysop);
|
2002-04-10 20:29:57 +00:00
|
|
|
}
|
2002-05-18 13:49:55 +00:00
|
|
|
MacroVars("H", "s", CFG.www_url);
|
|
|
|
MacroVars("M", "s", CFG.sysdomain);
|
|
|
|
MacroVars("V", "s", VERSION);
|
|
|
|
MacroVars("Y", "s", aka);
|
|
|
|
MacroVars("Z", "d", 0);
|
2002-05-11 15:30:34 +00:00
|
|
|
Cookie(htmlmode);
|
2002-03-31 15:04:34 +00:00
|
|
|
}
|
2002-03-29 22:58:53 +00:00
|
|
|
|
2002-04-10 20:29:57 +00:00
|
|
|
free(aka);
|
2002-03-29 22:58:53 +00:00
|
|
|
free(temp);
|
|
|
|
return fi;
|
|
|
|
}
|
|
|
|
|
|
|
|
|