Replace all std::cout with internally defined macro

This commit is contained in:
Ianos Gnatiuc 2006-01-17 17:47:35 +00:00
parent d488a5510b
commit 3350c0806e
52 changed files with 728 additions and 477 deletions

View File

@ -146,14 +146,15 @@ void AddNewArea(AreaCfg& aa) {
// ------------------------------------------------------------------
// Add or update area data
void AreaList::AddNewArea(AreaCfg* aa) {
if(veryverbose) {
void AreaList::AddNewArea(AreaCfg* aa)
{
if (veryverbose)
{
std::string temp;
std::cout << " fmt=" << aa->basetype << ", eid=\"" << aa->echoid <<
"\", pth=\"" << aa->path << "\", brd=" << aa->board <<
", gid=" << aa->groupid << ", aka=" << aa->aka.make_string(temp);
std::cout << " " << aa->attr.make_string(temp) << std::endl;
STD_PRINT(" fmt=" << aa->basetype << ", eid=\"" << aa->echoid);
STD_PRINT("\", pth=\"" << aa->path << "\", brd=" << aa->board);
STD_PRINT(", gid=" << aa->groupid << ", aka=" << aa->aka.make_string(temp));
STD_PRINT(" " << aa->attr.make_string(temp) << std::endl);
}
Desc desc;
@ -847,8 +848,8 @@ void AreaList::ReadEcholist(char* val) {
else
tok = getkeyval;
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fgets((val=buf), sizeof(buf), fp)) {

View File

@ -134,8 +134,9 @@ bool ReadGoldedCfg(int& force) {
MakePathname(CFG->semaphore.soupexport, CFG->goldpath, CFG->semaphore.soupexport);
MakePathname(CFG->semaphore.exitnow, CFG->goldpath, CFG->semaphore.exitnow);
if(strieql(CFG->semaphore.exportlist, AddPath(CFG->jampath, "echomail.jam"))) {
std::cout << "* Warning: SEMAPHORE EXPORTLIST must not be the same as ECHOMAIL.JAM!" << std::endl;
if (strieql(CFG->semaphore.exportlist, AddPath(CFG->jampath, "echomail.jam")))
{
STD_PRINT("* Warning: SEMAPHORE EXPORTLIST must not be the same as ECHOMAIL.JAM!" << std::endl);
SayBibi();
cfgerrors++;
}
@ -232,9 +233,10 @@ void WriteGoldGed() {
// ------------------------------------------------------------------
static int EnterString(char* prompt, char* string, uint length) {
std::cout << prompt << std::endl << "> " << std::flush;
#if !defined(__GOLD_GUI__)
static int EnterString(char* prompt, char* string, uint length)
{
STD_PRINT(prompt << std::endl << "> " << std::flush);
*string = NUL;
char* ptr = string;
@ -244,18 +246,18 @@ static int EnterString(char* prompt, char* string, uint length) {
k = kbxget();
if(k == Key_BS) {
if(pos) {
std::cout << "\b \b" << std::flush;
STD_PRINT("\b \b" << std::flush);
pos--;
*(--ptr) = NUL;
}
}
else if(k == Key_Esc) {
std::cout << std::endl;
STD_PRINT(std::endl);
*string = NUL;
return -1;
}
else if(k == Key_Ent) {
std::cout << std::endl;
STD_PRINT(std::endl);
*ptr = NUL;
break;
}
@ -263,7 +265,7 @@ static int EnterString(char* prompt, char* string, uint length) {
if(pos < length) {
char c = (char)k;
if(c) {
std::cout << c << std::flush;
STD_PRINT(c << std::flush);
*ptr++ = c;
pos++;
}
@ -330,10 +332,10 @@ void InstallDetect(char* path) {
if(fexist(cmdlinecfgbak))
remove(cmdlinecfgbak);
rename(CFG->goldcfg, cmdlinecfgbak);
std::cout << "Warning: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl;
STD_PRINT("Warning: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl);
}
std::cout << "Please wait while GoldED+ is detecting your software." << std::endl;
STD_PRINT("Please wait while GoldED+ is detecting your software." << std::endl);
FILE* fp = fopen(CFG->goldcfg, "wt");
if(fp) {
@ -362,7 +364,7 @@ void InstallDetect(char* path) {
}
if(fexist(AddPath(pth, idetect[i].configname))) {
fprintf(fp, "AREAFILE %s %s\n", idetect[i].name, pth);
std::cout << "Found " << idetect[i].name << (ptr ? "." : " (unreliable).") << std::endl;
STD_PRINT("Found " << idetect[i].name << (ptr ? "." : " (unreliable).") << std::endl);
if(streql(idetect[i].name, "Squish"))
gotsquish = true;
detected = true;
@ -376,7 +378,7 @@ void InstallDetect(char* path) {
PathCopy(pth, ptr);
if(fexist(AddPath(pth, "im.exe")) or fexist(AddPath(pth, "intrecho.exe"))) {
fprintf(fp, "AREAFILE InterMail %s\n", pth);
std::cout << "Found InterMail and/or InterEcho." << std::endl;
STD_PRINT("Found InterMail and/or InterEcho." << std::endl);
detected = true;
}
@ -391,12 +393,12 @@ void InstallDetect(char* path) {
}
if(fexist(AddPath(pth, "max.prm"))) {
fprintf(fp, "AREAFILE Maximus %s\n", pth);
std::cout << "Found Maximus." << std::endl;
STD_PRINT("Found Maximus." << std::endl);
detected = true;
}
if(not gotsquish and fexist(AddPath(pth, "squish.cfg"))) {
fprintf(fp, "AREAFILE Squish %s\n", pth);
std::cout << "Found Squish." << std::endl;
STD_PRINT("Found Squish." << std::endl);
detected = true;
}
@ -404,7 +406,7 @@ void InstallDetect(char* path) {
strcpy(pth, CFG->areapath);
if(fexist(AddPath(pth, "areadesc.me2"))) {
fprintf(fp, "AREAFILE ME2 %sareadesc.me2 %sareas.bbs\n", pth, pth);
std::cout << "Found ME2." << std::endl;
STD_PRINT("Found ME2." << std::endl);
gotareasbbs = true;
detected = true;
}
@ -414,13 +416,13 @@ void InstallDetect(char* path) {
strcpy(pth, CFG->areapath);
if(fexist(AddPath(pth, "areas.bbs"))) {
fprintf(fp, "AREAFILE AreasBBS %sareas.bbs\n", pth);
std::cout << "Found AREAS.BBS." << std::endl;
STD_PRINT("Found AREAS.BBS." << std::endl);
detected = true;
}
}
if(not detected)
std::cout << "Sorry, could not find any supported software. Try another path." << std::endl;
STD_PRINT("Sorry, could not find any supported software. Try another path." << std::endl);
fclose(fp);
}
@ -511,6 +513,7 @@ install_terminated:
fclose(fp);
return -1;
}
#endif
// ------------------------------------------------------------------

View File

@ -729,14 +729,14 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
MakePathname(cfg, CFG->goldpath, cfg);
fp = fsopen(cfg, "rt", CFG->sharemode);
if(fp) {
if (fp)
{
cfgname = strrchr(cfg, '\\');
cfgname = cfgname ? cfgname+1 : cfg;
inuse++;
if(not quiet)
std::cout << "* Reading " << cfg << std::endl;
if (not quiet)
STD_PRINT("* Reading " << cfg << std::endl);
// Assign file buffer
setvbuf(fp, NULL, _IOFBF, 8192);
@ -759,8 +759,9 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
int _gotcond = true;
switch(crc) {
case CRC_IF:
if(in_if) {
std::cout << "* " << cfgname << ": Misplaced IF at line " << line << ". IF's cannot be nested." << std::endl;
if (in_if)
{
STD_PRINT("* " << cfgname << ": Misplaced IF at line " << line << ". IF's cannot be nested." << std::endl);
cfgerrors++;
}
in_if = true;
@ -769,8 +770,9 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
break;
case CRC_ELIF:
case CRC_ELSEIF:
if(not in_if or in_else) {
std::cout << "* " << cfgname << ": Misplaced ELIF/ELSEIF at line " << line << "." << std::endl;
if (not in_if or in_else)
{
STD_PRINT("* " << cfgname << ": Misplaced ELIF/ELSEIF at line " << line << "." << std::endl);
cfgerrors++;
}
if(if_status)
@ -781,8 +783,9 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
}
break;
case CRC_ELSE:
if(not in_if or in_else) {
std::cout << "* " << cfgname << ": Misplaced ELSE at line " << line << "." << std::endl;
if (not in_if or in_else)
{
STD_PRINT("* " << cfgname << ": Misplaced ELSE at line " << line << "." << std::endl);
cfgerrors++;
}
in_else = true;
@ -790,8 +793,9 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
cfgignore = not if_status;
break;
case CRC_ENDIF:
if(not in_if) {
std::cout << "* " << cfgname << ": Misplaced ENDIF at line " << line << "." << std::endl;
if (not in_if)
{
STD_PRINT("* " << cfgname << ": Misplaced ENDIF at line " << line << "." << std::endl);
cfgerrors++;
}
cfgignore = false;
@ -805,15 +809,11 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
}
// Tell the world what we found
if(veryverbose)
if (veryverbose)
{
#if defined(_MSC_VER)
char buff[256];
sprintf(buff, " %c %04d: %s %s\n", cfgignore ? '-' : '+', line, key, val);
std::cout << buff;
#else
std::cout << " " << (cfgignore ? '-' : '+') << std::setw(4) << std::setfill('0') << line << std::setfill(' ') << ": " << key << " " << val << std::endl;
#endif
STD_PRINT(buff);
}
// Call switch function to act on the key
@ -823,20 +823,28 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
case CRC_INCLUDE:
strschg_environ(val);
MapPath(val);
if(not quiet)
std::cout << "* Including " << val << std::endl;
if (not quiet)
STD_PRINT("* Including " << val << std::endl);
ReadCfg(val); // NOTE! This is a recursive call!
if(not quiet)
std::cout << "* Resuming " << cfg << std::endl;
if (not quiet)
STD_PRINT("* Resuming " << cfg << std::endl);
break;
case CRC_AREAFILE:
strschg_environ(val);
MapPath(val);
if(not quiet)
std::cout << "* Handling " << key << " " << val << std::endl;
if (not quiet)
STD_PRINT("* Handling " << key << " " << val << std::endl);
AL.GetAreafile(val);
if(not quiet)
std::cout << "* Resuming " << cfg << std::endl;
if (not quiet)
STD_PRINT("* Resuming " << cfg << std::endl);
break;
case CRC_APP:
// Ignore 3rd party application lines
@ -845,9 +853,11 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
// Ignore remark lines
break;
default:
if(not SwitchCfg(crc, *key, val)) {
if(not ignoreunknown) {
std::cout << "* " << cfgname << ": Unknown keyword \"" << key << "\" at line " << line << "." << std::endl;
if (not SwitchCfg(crc, *key, val))
{
if (not ignoreunknown)
{
STD_PRINT("* " << cfgname << ": Unknown keyword \"" << key << "\" at line " << line << "." << std::endl);
SayBibi();
cfgerrors++;
}

View File

@ -36,12 +36,12 @@ extern char* val;
// ------------------------------------------------------------------
void CfgAddress() { CfgAddress(val); }
void CfgAddress(char* v) {
if(not strblank(v)) {
if(veryverbose)
std::cout << " CfgAddress(" << v << ")" << std::endl;
void CfgAddress(char* v)
{
if (not strblank(v))
{
if (veryverbose)
STD_PRINT(" CfgAddress(" << v << ")" << std::endl);
gaka aka;
aka.domain[0] = NUL;

View File

@ -403,9 +403,9 @@ void CfgSeqMsgId() {
// ------------------------------------------------------------------
void CfgSeqOutRun_Error() {
std::cout << "* Warning: Bad SeqOutrun value \'" << val << "\', ignored."<< std::endl;
void CfgSeqOutRun_Error()
{
STD_PRINT("* Warning: Bad SeqOutrun value \'" << val << "\', ignored."<< std::endl);
}
void CfgSeqOutRun() {
@ -422,10 +422,13 @@ void CfgSeqOutRun() {
p = val;
while(isdigit((int)(*p)))
p++;
if(*p == '\0') {
if(*p == '\0')
{
CFG->seqoutrun = s;
if(veryverbose)
std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl;
if (veryverbose)
STD_PRINT(" SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl);
return;
}
if(p[1]) {
@ -451,8 +454,9 @@ void CfgSeqOutRun() {
return;
}
CFG->seqoutrun = s;
if(veryverbose)
std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl;
if (veryverbose)
STD_PRINT(" SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl);
}
// ------------------------------------------------------------------

View File

@ -638,8 +638,10 @@ void CfgXlatexport() {
CFG->grp.AddItm(GRP_XLATEXPORT, buf, strlen(buf)+1);
else
strcpy(CFG->xlatexport, buf);
if(CFG->usecharset and (strieql(buf, "IBMPC") or strieql(buf, "+7_FIDO"))) {
std::cout << "* Warning: Charset " << buf << " is obsolete. Consider using CPxxx form." << std::endl;
if (CFG->usecharset and (strieql(buf, "IBMPC") or strieql(buf, "+7_FIDO")))
{
STD_PRINT("* Warning: Charset " << buf << " is obsolete. Consider using CPxxx form." << std::endl);
cfgerrors++;
}
}
@ -661,8 +663,10 @@ void CfgXlatimport() {
void CfgXlatlocalset() {
strupr(strxcpy(CFG->xlatlocalset, val, sizeof(CFG->xlatlocalset)));
if(CFG->usecharset and (strieql(CFG->xlatlocalset, "IBMPC") or strieql(CFG->xlatlocalset, "+7_FIDO"))) {
std::cout << "* Warning: Charset " << CFG->xlatlocalset << " is obsolete. Consider using CPxxx form." << std::endl;
if (CFG->usecharset and (strieql(CFG->xlatlocalset, "IBMPC") or strieql(CFG->xlatlocalset, "+7_FIDO")))
{
STD_PRINT("* Warning: Charset " << CFG->xlatlocalset << " is obsolete. Consider using CPxxx form." << std::endl);
cfgerrors++;
}
}

View File

@ -1012,13 +1012,13 @@ int ReadKeysCfg(int force) {
const char* cfg = AddPath(CFG->goldpath, CFG->keyscfg);
ifp = fsopen(cfg, "rt", CFG->sharemode);
if(ifp) {
if (ifp)
{
const char* cfgname = strrchr(cfg, '\\');
cfgname = cfgname ? cfgname+1 : cfg;
if(not quiet)
std::cout << "* Reading " << cfg << std::endl;
if (not quiet)
STD_PRINT("* Reading " << cfg << std::endl);
CFG->macro.clear();
CFG->cmdkey.clear();
@ -1032,8 +1032,9 @@ int ReadKeysCfg(int force) {
continue;
ptr2 = ptr;
ptr = strskip_txt(ptr);
if(*ptr == NUL) {
std::cout << "* " << cfgname << ": Incomplete line " << line << "." << std::endl;
if (*ptr == NUL)
{
STD_PRINT("* " << cfgname << ": Incomplete line " << line << "." << std::endl);
SayBibi();
cfgerrors++;
continue;
@ -1047,10 +1048,12 @@ int ReadKeysCfg(int force) {
}
else if(strlen(ptr2) == 1)
keyval = (gkey)g_tolower(*ptr2); // Always convert to lowercase internally
else {
else
{
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype);
if(not keycmd or keytype) {
std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
if (not keycmd or keytype)
{
STD_PRINT("* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl);
SayBibi();
cfgerrors++;
continue;
@ -1096,8 +1099,9 @@ int ReadKeysCfg(int force) {
if(n < (sizeof(tmp2.buf)/sizeof(gkey)))
tmp2.buf[n++] = (gkey)keycmd;
}
else {
std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
else
{
STD_PRINT("* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl);
SayBibi();
cfgerrors++;
continue;
@ -1126,15 +1130,17 @@ int ReadKeysCfg(int force) {
}
else if(keytype)
KeyCmdAdd(keycmd, keyval, keytype);
else {
std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
else
{
STD_PRINT("* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl);
SayBibi();
cfgerrors++;
continue;
}
}
else {
std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
else
{
STD_PRINT("* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl);
SayBibi();
cfgerrors++;
continue;

View File

@ -706,11 +706,12 @@ bool ReadLangCfg(int force) {
// Read the GOLDLANG.CFG if there is one
const char* cfgname = AddPath(CFG->goldpath, CFG->langcfg);
fpi = fsopen(cfgname, "rt", CFG->sharemode);
if(fpi) {
if (fpi)
{
setvbuf(fpi, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << cfgname << std::endl;
if (not quiet)
STD_PRINT("* Reading " << cfgname << std::endl);
cfgname = CleanFilename(cfgname);
@ -728,9 +729,12 @@ bool ReadLangCfg(int force) {
strschg(str, "\\r", "\r");
strschg(str, "\\\"", "\"");
}
if(SwitchLanguage(strCrc16(strupr(ptr)), str)) {
if(cmdlineoldkeyw == false) {
std::cout << "* " << cfgname << " line " << line << ": \"" << ptr << "\" is obsolete or unknown." << std::endl;
if (SwitchLanguage(strCrc16(strupr(ptr)), str))
{
if (cmdlineoldkeyw == false)
{
STD_PRINT("* " << cfgname << " line " << line << ": \"" << ptr << "\" is obsolete or unknown." << std::endl);
SayBibi();
cfgerrors++;
}

View File

@ -47,12 +47,13 @@ int ReadHelpCfg(int force) {
if(ifp) {
setvbuf(ifp, NULL, _IOFBF, 8192);
ofp = fsopen(AddPath(CFG->goldpath, CFG->helpged), "wb", CFG->sharemode);
if(ofp) {
if (ofp)
{
offset = 0L;
CFG->helpcfg.ft = GetFiletime(AddPath(CFG->goldpath, CFG->helpcfg.fn));
if(not quiet)
std::cout << "* Reading " << AddPath(CFG->goldpath, CFG->helpcfg.fn) << std::endl;
if (not quiet)
STD_PRINT("* Reading " << AddPath(CFG->goldpath, CFG->helpcfg.fn) << std::endl);
setvbuf(ofp, NULL, _IOFBF, 8192);
@ -640,10 +641,10 @@ void ReadXlatTables() {
}
strcpy(buf, AddPath(CFG->xlatpath, xlt->mapfile));
ifp = fsopen(buf, "rb", CFG->sharemode);
if(ifp) {
if(not quiet)
std::cout << "* Reading " << buf << std::endl;
if (ifp)
{
if (not quiet)
STD_PRINT("* Reading " << buf << std::endl);
// Read the definition file
line = 1;
@ -725,7 +726,7 @@ void ReadXlatTables() {
fclose(ifp);
}
else
std::cout << "* XLAT table " << buf << " could not be opened." << std::endl;
STD_PRINT("* XLAT table " << buf << " could not be opened." << std::endl);
fwrite(&ChsTable, sizeof(Chs), 1, ofp);
}
@ -737,10 +738,10 @@ void ReadXlatTables() {
memset(&EscTable, 0, sizeof(Esc));
strcpy(buf, AddPath(CFG->xlatpath, xlt->mapfile));
ifp = fsopen(buf, "rb", CFG->sharemode);
if(ifp) {
if(not quiet)
std::cout << "* Reading " << buf << std::endl;
if (ifp)
{
if (not quiet)
STD_PRINT("* Reading " << buf << std::endl);
// Read the definition file
line = 1;
@ -804,7 +805,7 @@ void ReadXlatTables() {
fclose(ifp);
}
else
std::cout << "* XLAT table " << buf << " could not be opened." << std::endl;
STD_PRINT("* XLAT table " << buf << " could not be opened." << std::endl);
fwrite(&EscTable, sizeof(Esc), 1, ofp);
}

View File

@ -191,13 +191,15 @@ void Cleanup(void) {
throw_xdelete(gvid);
int smax = MinV((int)GLOG_STORELINES, LOG.storelines);
for(int s=0; s<smax; s++)
std::cout << LOG.storeline[s] << std::endl;
for (int s=0; s<smax; s++)
STD_PRINT(LOG.storeline[s] << std::endl);
if(CFG) {
if(LOG.storelines > GLOG_STORELINES)
std::cout << "(See also " << CFG->logfile << ")" << std::endl;
if(errorlevel > EXIT_NONAME)
if (CFG)
{
if (LOG.storelines > GLOG_STORELINES)
STD_PRINT("(See also " << CFG->logfile << ")" << std::endl);
if (errorlevel > EXIT_NONAME)
MakeNoise(SND_S_O_S);
CfgReset();

View File

@ -80,10 +80,10 @@ static void InitCmdline(char* val) {
val = key+1;
switch(g_toupper(*key)) {
case 'C': // Use another Configfile
if(*val)
if (*val)
strcpy(cmdlinecfg, val);
else
std::cout << "Warning: configuration filename missed for -C option, ignored.\r\n";
STD_PRINT("Warning: configuration filename missed for -C option, ignored.\r\n");
break;
case 'D':
cmdlineoldkeyw = (*val == '-');
@ -150,8 +150,9 @@ static void InitCmdline(char* val) {
break;
case 'Z':
gftrk_set_max = atoi(val);
if(gftrk_set_max == 0) {
std::cout << "Warning: Invalid parameter for -Z option, fixed.\r\n";
if (gftrk_set_max == 0)
{
STD_PRINT("Warning: Invalid parameter for -Z option, fixed.\r\n");
gftrk_set_max = 1;
}
break;
@ -519,7 +520,7 @@ void Initialize(int argc, char* argv[]) {
srand(gtime(NULL));
// Display startup banner
std::cout << __gver_longpid__ << " " << __gver_ver__ << "\r\n";
STD_PRINT(__gver_longpid__ << " " << __gver_ver__ << "\r\n");
// Check environment commandline
ptr = getenv("GEDCMD");
@ -559,34 +560,34 @@ void Initialize(int argc, char* argv[]) {
}
// Print commandline help and exit if requested
if(cmdlinehelp) {
std::cout <<
"Copyright (C) 1990-2005 Odinn Sorensen, Alexander Aganichev, Jacobo Tarrio,\r\n"
" Stas Degteff and others\r\n"
"-------------------------------------------------------------------------------\r\n"
"\r\n"
"Invocation: " << argv[0] << " [-options] [keystacking]\r\n"
"\r\n"
"-C<configfile> Use a different configuration file.\r\n"
"-D Disable old obsolete configuration keywords.\r\n"
"-E<echoid> Start directly in the specified mail area.\r\n"
"-EXPORTSOUP Export SOUP packets during startup.\r\n"
"-F or -FF Force recompile of most (or all with -FF) configuration files.\r\n"
"-INSTALL[=path] Start the quick install procedure. Look in path, if given.\r\n"
"-IMPORTSOUP Import SOUP packets during startup.\r\n"
"-M Mute sounds. Disables all noises in GoldED+.\r\n"
"-N Disable share-compatible file opens during startup.\r\n"
"-NOSCAN Temporarily disable area scan during startup.\r\n"
#if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
"-P Increase program priority to run faster.\r\n"
#endif
"-S<sortspec> Sorts all mail areas according to the sort specs.\r\n"
"-T<seconds> Set a timeout value. GoldED+ will auto-exit after timeout.\r\n"
"-V or -VV Verbose or Very verbose (-VV) config compile. Use -VV to debug.\r\n"
"-W Write a GOLDAREA.INC file with AREADEF's of all mail areas.\r\n"
"-X, -Y, -Z Reserved for debugging purposes.\r\n"
"\r\n"
"Any non-option parameter is stuffed into the keyboard buffer.\r\n" ;
if (cmdlinehelp)
{
STD_PRINT("Copyright (C) 1990-2005 Odinn Sorensen, Alexander Aganichev, Jacobo Tarrio,\r\n");
STD_PRINT(" Stas Degteff and others\r\n");
STD_PRINT("-------------------------------------------------------------------------------\r\n");
STD_PRINT("\r\n");
STD_PRINT("Invocation: " << argv[0] << " [-options] [keystacking]\r\n");
STD_PRINT("\r\n");
STD_PRINT("-C<configfile> Use a different configuration file.\r\n");
STD_PRINT("-D Disable old obsolete configuration keywords.\r\n");
STD_PRINT("-E<echoid> Start directly in the specified mail area.\r\n");
STD_PRINT("-EXPORTSOUP Export SOUP packets during startup.\r\n");
STD_PRINT("-F or -FF Force recompile of most (or all with -FF) configuration files.\r\n");
STD_PRINT("-INSTALL[=path] Start the quick install procedure. Look in path, if given.\r\n");
STD_PRINT("-IMPORTSOUP Import SOUP packets during startup.\r\n");
STD_PRINT("-M Mute sounds. Disables all noises in GoldED+.\r\n");
STD_PRINT("-N Disable share-compatible file opens during startup.\r\n");
STD_PRINT("-NOSCAN Temporarily disable area scan during startup.\r\n");
#if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
STD_PRINT("-P Increase program priority to run faster.\r\n");
#endif
STD_PRINT("-S<sortspec> Sorts all mail areas according to the sort specs.\r\n");
STD_PRINT("-T<seconds> Set a timeout value. GoldED+ will auto-exit after timeout.\r\n");
STD_PRINT("-V or -VV Verbose or Very verbose (-VV) config compile. Use -VV to debug.\r\n");
STD_PRINT("-W Write a GOLDAREA.INC file with AREADEF's of all mail areas.\r\n");
STD_PRINT("-X, -Y, -Z Reserved for debugging purposes.\r\n");
STD_PRINT("\r\n");
STD_PRINT("Any non-option parameter is stuffed into the keyboard buffer.\r\n");
exit(0);
}
@ -678,8 +679,9 @@ void Initialize(int argc, char* argv[]) {
if(cmdlineinstall)
InstallDetect(cmdlineinstpath);
if(not fexist(CFG->goldcfg)) {
std::cout << "*** Cannot start: " << CFG->goldcfg << " not found! ***\r\n";
if (not fexist(CFG->goldcfg))
{
STD_PRINT("*** Cannot start: " << CFG->goldcfg << " not found! ***\r\n");
errorlevel = EXIT_NONAME;
exit(0);
}
@ -688,14 +690,13 @@ void Initialize(int argc, char* argv[]) {
compiled = ReadGoldedCfg(cmdlineforce);
// Call install finish procedure
if(cmdlineinstall) {
if(InstallFinish()) {
std::cout << "*** INSTALL NOT COMPLETED ***\r\n";
if (cmdlineinstall && InstallFinish())
{
STD_PRINT("*** INSTALL NOT COMPLETED ***\r\n");
remove(CFG->goldcfg);
errorlevel = EXIT_NONAME;
exit(0);
}
}
HeaderView = new GMsgHeaderView;
throw_new(HeaderView);
@ -739,14 +740,12 @@ void Initialize(int argc, char* argv[]) {
gkbd.extkbd = CFG->switches.get(keybext);
// Report detected multitasker
if(not quiet) {
if(gmtsk.detected)
std::cout << "* Running under " << gmtsk.name << ".\r\n";
}
if (!quiet && gmtsk.detected)
STD_PRINT("* Running under " << gmtsk.name << ".\r\n");
if(cfgerrors) {
std::cout << "* Total CFG errors found: " << cfgerrors
<< ". Press almost any key to continue.\r\n";
if (cfgerrors)
{
STD_PRINT("* Total CFG errors found: " << cfgerrors << ". Press almost any key to continue.\r\n");
kbclear();
waitkey();
}

View File

@ -88,17 +88,21 @@ void InitSound() {
// Find out if there are any sound files to be played
#ifdef GOLD_SOUNDSUPPORT
std::vector<GEvent>::iterator n;
for(n = CFG->event.begin(); n != CFG->event.end(); n++) {
if(n->play.type == PLAY_VOC) {
for(n = CFG->event.begin(); n != CFG->event.end(); n++)
{
if(n->play.type == PLAY_VOC)
{
snd = new gsound;
if(snd->is_installed()) {
if(not quiet)
std::cout << "* Soundcard support was successfully initialized." << std::endl;
if (snd->is_installed())
{
if (not quiet)
STD_PRINT("* Soundcard support was successfully initialized." << std::endl);
atexit(ResetSound);
}
else {
if(not quiet)
std::cout << "* Soundcard support could NOT be initialized!" << std::endl;
else
{
if (not quiet)
STD_PRINT("* Soundcard support could NOT be initialized!" << std::endl);
ResetSound();
}
break;

View File

@ -40,6 +40,7 @@
#include <gstrall.h>
#include <csignal>
#include <iostream>
#include <strstream>
#include <iomanip>
// Wrappers for certain mostly DOS/Borland headers
#include <gshare.h>

View File

@ -160,6 +160,20 @@ typedef uint32_t time32_t; /* 32-bit time_t type */
#ifdef __cplusplus
/* ------------------------------------------------------------------ */
#if defined(__GOLD_GUI__)
#define STD_PRINT(out) { \
std::strstream str; \
str << out; \
GUI_Print(str); \
}
#else
#define STD_PRINT(out) std::cout << out;
#endif
/* ------------------------------------------------------------------ */
/* Common function-pointer types */

View File

@ -28,6 +28,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#include <gedacfg.h>
@ -329,11 +333,12 @@ void gareafile::GetAreasBBS(char* name, char* origin, char* options) {
MakePathname(areafile, areapath, areafile);
fp = fsopen(areafile, "rt", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << areafile << std::endl;
if (not quiet)
STD_PRINT("* Reading " << areafile << std::endl);
bool firstline = true;

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOCMAIL
#include <gedacfg.h>
@ -76,11 +80,12 @@ bool gareafile::jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc) {
void gareafile::ReadCrashmailCfg(const char* file) {
FILE* fp = fsopen(file, "rt", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
char buf[4000];
char key[30];

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NODB
#include <gedacfg.h>
#include <gs_db.h>
@ -47,18 +51,20 @@ void gareafile::ReadDB130(char* tag, char* dbpath) {
MakePathname(file2, dbpath, "dbridge.aa2");
fp1 = fsopen(file1, "rb", sharemode);
if(fp1) {
if (fp1)
{
setvbuf(fp1, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file1 << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file1 << std::endl);
fp2 = fsopen(file2, "rb", sharemode);
if(fp2) {
if (fp2)
{
setvbuf(fp2, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file2 << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file2 << std::endl);
while(fread(&AA1, sizeof(DB130_AA1), 1, fp1) == 1) {
@ -117,12 +123,12 @@ void gareafile::ReadDB1046(char* file, char* tag) {
DB1046_ADF* ADF = (DB1046_ADF*)throw_calloc(1, sizeof(DB1046_ADF));
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(ADF, sizeof(DB1046_ADF), 1, fp) == 1) {
if(ADF->allocated and strchr("QFqf", ADF->msgbase)) {
@ -181,11 +187,12 @@ void gareafile::ReadDB1047A22(char* file, int reclen, char* tag) {
if(ADF) {
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(ADF, reclen, 1, fp) == 1) {
if(ADF->allocated and strchr("QFqf", ADF->msgbase)) {
@ -245,11 +252,12 @@ void gareafile::ReadDB2011(char* file, int reclen, char* tag) {
if(ADF) {
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(ADF, reclen, 1, fp) == 1) {
if(ADF->allocated and strchr("QFqf", ADF->msgbase)) {
@ -334,10 +342,10 @@ void gareafile::ReadDBridge(char* tag) {
MakePathname(file, dbpath, "dbridge.prm");
fp = fsopen(file, "rt", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
// Read netmail storage method etc
for(line=1; line <= 2; line++)

View File

@ -26,6 +26,10 @@
#include <cstdlib>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NODUTCHIE
#include <gedacfg.h>
@ -63,11 +67,12 @@ void gareafile::ReadDutchie(char* tag) {
MakePathname(file, dupath, "dutchie.are");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fgets(buf, 255, fp)) {

View File

@ -26,6 +26,10 @@
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOEZY
#include <gedacfg.h>
#include <gs_ez102.h>
@ -48,10 +52,10 @@ void gareafile::ReadEzycom102(FILE* fp, char* path, char* file, char* options) {
MakePathname(file, path, "constant.ezy");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(constant, sizeof(CONSTANTRECORD), 1, fp);
fclose(fp);
@ -189,10 +193,10 @@ void gareafile::ReadEzycom102(FILE* fp, char* path, char* file, char* options) {
MakePathname(file, path, "messages.ezy");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
int record = 1;

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOEZY
#include <gedacfg.h>
#include <gs_ez110.h>
@ -49,10 +53,10 @@ void gareafile::ReadEzycom110(FILE* fp, char* path, char* file, char* options) {
MakePathname(file, path, "constant.ezy");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(constant, sizeof(CONSTANTRECORD), 1, fp);
fclose(fp);
@ -190,10 +194,10 @@ void gareafile::ReadEzycom110(FILE* fp, char* path, char* file, char* options) {
MakePathname(file, path, "MESSAGES.EZY");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
int record = 1;
@ -308,10 +312,10 @@ void gareafile::ReadEzycom(char* tag) {
if(not fexist(file))
MakePathname(file, path, "config.ezy");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
char _verstr[9];
fread(_verstr, 9, 1, fp);
@ -319,8 +323,9 @@ void gareafile::ReadEzycom(char* tag) {
strp2c(_verstr);
if(strnicmp(_verstr, "1.02", 4) < 0) {
std::cout << "* Error: Ezycom v" << _verstr << " is not supported - Skipping." << std::endl;
if (strnicmp(_verstr, "1.02", 4) < 0)
{
STD_PRINT("* Error: Ezycom v" << _verstr << " is not supported - Skipping." << std::endl);
return;
}
else if(strnicmp(_verstr, "1.10", 4) >= 0)

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOFD
#include <gedacfg.h>
#include <gs_fd.h>
@ -79,10 +83,10 @@ void gareafile::ReadFrontDoor(char* tag) {
MakePathname(file, fdpath, "setup.fd");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(buf, 5, 1, fp);
if(streql(buf, "JoHo")) { // Check to see that it is v1.99b or higher
@ -117,11 +121,12 @@ void gareafile::ReadFrontDoor(char* tag) {
MakePathname(file, fdpath, "folder.sys");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(folder, sizeof(FD_Folder), 1, fp) == 1) {
behave = folder->behave;

View File

@ -28,6 +28,10 @@
#include <cstdlib>
#include <gfilutil.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOFE
#include <gedacfg.h>
#include <gs_fech6.h>
@ -192,10 +196,10 @@ void gareafile::ReadFastecho(char* tag) {
}
fh = sopen(file, O_RDONLY|O_BINARY, sharemode, S_STDRD);
if(fh != -1) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fh != -1)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
read(fh, &revision, sizeof(revision));
lseek(fh, 0L, SEEK_SET); // rewind
@ -207,7 +211,7 @@ void gareafile::ReadFastecho(char* tag) {
else if(revision == 6)
ReadFastecho142(fh);
else
std::cout << "* Error: FastEcho system file revision level " << revision << " is not supported - Skipping." << std::endl;
STD_PRINT("* Error: FastEcho system file revision level " << revision << " is not supported - Skipping." << std::endl);
close(fh);
}

View File

@ -28,6 +28,10 @@
#include <gmemdbg.h>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOFIDOPCB
#include <gedacfg.h>
@ -85,11 +89,12 @@ void gareafile::ReadFidoPCB(char* tag) {
MakePathname(file, path, "fidopcb.cfg");
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
int areas = 0;
fparea* area = NULL;

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOFMAIL
#include <gedacfg.h>
#include <gs_fm116.h>
@ -298,11 +302,11 @@ void gareafile::ReadFMail(char* tag) {
ReadFMail098(fp, path, file, options);
else if((ar_rev >= 0x0110) and (ar_rev < 0x0200))
ReadFMail116(fp, path, file, options);
else {
else
{
char buff[56+sizeof(uint)*2];
sprintf(buff, "* Error: Unknown FMail config revision %04Xh - Skipping.\n", ar_rev);
std::cout << buff;
// std::cout << "* Error: Unknown FMail config revision " << std::setfill('0') << std::setw(4) << std::hex << ar_rev << "h - Skipping." << std::endl;
STD_PRINT(buff);
}
}
}

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOGECHO
#include <gedacfg.h>
@ -84,10 +88,10 @@ void gareafile::ReadGEcho(char* tag) {
if(gesetup) {
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(&sysrev, sizeof(word), 1, fp);
rewind(fp);
@ -107,13 +111,14 @@ void gareafile::ReadGEcho(char* tag) {
const char *_fidomsgtype = fidomsgtype;
if(ge_version >= 102) {
if(ge_version >= 102)
{
_fidomsgtype = (gesetup->extraoptions & OPUSDATES) ? "OPUS" : "FTS1";
if((streql(_fidomsgtype, "FTS1")) and (streql(fidomsgtype, "OPUS"))) {
std::cout <<
"* Warning - FTS-1 format is used for *.MSG. For better compatibility set this" << std::endl <<
"* in GSETUP: Miscellanous->GEcho Options->MSG compatibilty = Opus (not Fido)." << std::endl <<
"* To disable this warning, set FIDOMSGTYPE FTS1 in your GoldED setup." << std::endl;
if((streql(_fidomsgtype, "FTS1")) and (streql(fidomsgtype, "OPUS")))
{
STD_PRINT("* Warning - FTS-1 format is used for *.MSG. For better compatibility set this" << std::endl);
STD_PRINT("* in GSETUP: Miscellanous->GEcho Options->MSG compatibilty = Opus (not Fido)." << std::endl);
STD_PRINT("* To disable this warning, set FIDOMSGTYPE FTS1 in your GoldED setup." << std::endl);
}
}
@ -331,11 +336,12 @@ void gareafile::ReadGEcho(char* tag) {
MakePathname(file, gepath, "areafile.ge");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(&ahdr, sizeof(AREAFILE_HDR), 1, fp);
uint arearecsize = (ahdr.maxconnections * sizeof(CONNECTION)) + ahdr.recsize;
@ -436,7 +442,7 @@ void gareafile::ReadGEcho(char* tag) {
}
}
else
std::cout << "* Error: GEcho system file revision level " << sysrev << " is not supported - Skipping." << std::endl;
STD_PRINT("* Error: GEcho system file revision level " << sysrev << " is not supported - Skipping." << std::endl);
}
throw_free(gesetup);
}

View File

@ -28,6 +28,10 @@
#include <gcrcall.h>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOFIDOCONF
#include <gedacfg.h>
@ -174,11 +178,12 @@ void gareafile::ReadHPTFile(char* path, char* file, char* origin, int group) {
Path buf2;
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
aa.reset();
aa.type = GMB_NONE;
@ -201,8 +206,9 @@ void gareafile::ReadHPTFile(char* path, char* file, char* origin, int group) {
{
int ver_maj, ver_min;
sscanf(val, "%d.%d", &ver_maj, &ver_min);
if((ver_maj != 0) and (ver_min != 15)) {
std::cout << "* Error: Unknown fidoconfig version " << ver_maj << '.' << ver_min << " - Skipping." << std::endl;
if ((ver_maj != 0) and (ver_min != 15))
{
STD_PRINT("* Error: Unknown fidoconfig version " << ver_maj << '.' << ver_min << " - Skipping." << std::endl);
throw_xfree(alptr);
goto skip_config;
}

View File

@ -26,6 +26,10 @@
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOIMAIL
#include <gedacfg.h>
#include <gs_im160.h>
@ -44,10 +48,10 @@ void gareafile::ReadIMail160(char* options, char* file, char* impath) {
CF = new im_config_type; throw_new(CF);
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(CF, sizeof(im_config_type), 1, fp);
fclose(fp);
@ -71,11 +75,12 @@ void gareafile::ReadIMail160(char* options, char* file, char* impath) {
MakePathname(file, impath, "IMAIL.AR");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(&AR, sizeof(areas_record_type), 1, fp) == 1) {
@ -102,10 +107,11 @@ void gareafile::ReadIMail160(char* options, char* file, char* impath) {
case MSGTYPE_HUDSON:
aa.basetype = "HUDSON";
if((AR.brd >= 1) and (AR.brd <= 200))
if ((AR.brd >= 1) and (AR.brd <= 200))
aa.board = AR.brd;
else {
std::cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl;
else
{
STD_PRINT("* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl);
continue;
}
break;

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOIMAIL
#include <gedacfg.h>
@ -54,10 +58,10 @@ void gareafile::ReadIMail170(char* options, char* file, char* impath) {
CF = new im_config_type; throw_new(CF);
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(CF, sizeof(im_config_type), 1, fp);
fclose(fp);
@ -81,11 +85,12 @@ void gareafile::ReadIMail170(char* options, char* file, char* impath) {
MakePathname(file, impath, "IMAIL.AR");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(&AR, sizeof(areas_record_type), 1, fp) == 1) {
@ -112,10 +117,11 @@ void gareafile::ReadIMail170(char* options, char* file, char* impath) {
case MSGTYPE_HUDSON:
aa.basetype = "HUDSON";
if((AR.brd >= 1) and (AR.brd <= 200))
if ((AR.brd >= 1) and (AR.brd <= 200))
aa.board = AR.brd;
else {
std::cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl;
else
{
STD_PRINT("* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl);
continue;
}
break;

View File

@ -31,6 +31,10 @@
#include <stdlib.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOIMAIL
#include <gedacfg.h>
@ -54,10 +58,10 @@ void gareafile::ReadIMail185(char* options, char* file, char* impath) {
CF = new im_config_type; throw_new(CF);
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(CF, sizeof(im_config_type), 1, fp);
fclose(fp);
@ -81,11 +85,12 @@ void gareafile::ReadIMail185(char* options, char* file, char* impath) {
MakePathname(file, impath, "imail.ar");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(&AR, sizeof(mail_area_type), 1, fp) == 1) {
@ -112,10 +117,11 @@ void gareafile::ReadIMail185(char* options, char* file, char* impath) {
case MSGTYPE_HUDSON:
aa.basetype = "HUDSON";
if((AR.brd >= 1) and (AR.brd <= 200))
if ((AR.brd >= 1) and (AR.brd <= 200))
aa.board = AR.brd;
else {
std::cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl;
else
{
STD_PRINT("* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl);
continue;
}
break;
@ -219,11 +225,9 @@ void gareafile::ReadIMail(char* tag) {
}
}
char buff[78];
sprintf( buff, "* Error: IMAIL %u.%02u (structure revision %u.%02u) is not supported - Skipping.\n",
sprintf(buff, "* Error: IMAIL %u.%02u (structure revision %u.%02u) is not supported - Skipping.\n",
unsigned(imver[0]), unsigned(imver[1]), unsigned(imstructver[0]), unsigned(imstructver[1]) );
std::cout << buff;
// std::cout << "* Error: IMAIL " << imver[0] << '.' << std::setfill('0') << std::setw(2) << imver[1] << " (structure revision " << imstructver[0] << '.' << std::setfill('0') << std::setw(2) << imstructver[1] << ") is not supported - Skipping." << std::endl;
STD_PRINT(buff);
}
}

View File

@ -28,6 +28,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gfile.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOINTERMAIL
#include <gedacfg.h>
#include <gs_inter.h>
@ -64,12 +68,12 @@ void gareafile::ReadInterMail(char* tag) {
gfile fp;
fp.fopen(_file, "rb");
if(fp.isopen()) {
if (fp.isopen())
{
_ctl* ctl = (_ctl*)throw_calloc(1, sizeof(_ctl));
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
fp.fread(ctl, sizeof(_ctl));
@ -133,10 +137,10 @@ void gareafile::ReadInterMail(char* tag) {
_file = AddPath(ctl->s.systempath, "imfolder.cfg");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
FOLDER* _folder = (FOLDER*)throw_calloc(1, sizeof(FOLDER));
@ -177,10 +181,10 @@ void gareafile::ReadInterMail(char* tag) {
_file = AddPath(ctl->s.systempath, "folder.cfg");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
OLDFOLDER* _folder = (OLDFOLDER*)throw_calloc(1, sizeof(OLDFOLDER));
@ -216,10 +220,11 @@ void gareafile::ReadInterMail(char* tag) {
}
}
}
else {
else
{
char buff[62+sizeof(ctl->sysrev)*2];
sprintf(buff, "* Error: InterMail revision %04Xh is not supported - Skipping.\n", ctl->sysrev);
std::cout << buff;
STD_PRINT(buff);
}
throw_free(ctl);
}

View File

@ -28,6 +28,10 @@
#include <gmemdbg.h>
#include <gfile.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOLORA
#include <gedacfg.h>
#include <gs_lo240.h>
@ -65,10 +69,10 @@ void gareafile::ReadLoraBBS(char* tag) {
gfile fp;
const char* _file = AddPath(_path, "config.dat");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
_configuration* cfg = (_configuration*)throw_calloc(1, sizeof(_configuration));
fp.fread(cfg, sizeof(_configuration));
@ -131,11 +135,12 @@ void gareafile::ReadLoraBBS(char* tag) {
_file = AddPath(_path, "sysmsg.dat");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if (fp.isopen())
{
fp.setvbuf(NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
_sysmsg* sysmsg = (_sysmsg*)throw_calloc(1, sizeof(_sysmsg));

View File

@ -29,6 +29,10 @@
#include <gfilutil.h>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOMAXIMUS
#include <gedacfg.h>
#include <gs_max3.h>
@ -46,10 +50,10 @@ void gareafile::ReadMaximus3(char* mxpath, char* areafile, char* options) {
MakePathname(prmfile, mxpath, "max.prm");
fp = fsopen(prmfile, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << areafile << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << areafile << std::endl);
m_pointers* prmp = (m_pointers*)throw_calloc(1, sizeof(m_pointers));
m_pointers& prm = *prmp;
@ -68,11 +72,12 @@ void gareafile::ReadMaximus3(char* mxpath, char* areafile, char* options) {
MapPath(areafile);
fp = fsopen(areafile, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 32000);
if(not quiet)
std::cout << "* Reading " << areafile << std::endl;
if (not quiet)
STD_PRINT("* Reading " << areafile << std::endl);
long areasize = fsize(fp)-4;

View File

@ -25,6 +25,10 @@
// ------------------------------------------------------------------
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOME2
#include <gedacfg.h>
@ -56,11 +60,12 @@ void gareafile::ReadME2(char* tag) {
MakePathname(file, areapath, file);
fp = fsopen(file, "rt", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fgets(buf, 255, fp)) {

View File

@ -30,6 +30,10 @@
#include <gfilutil.h>
#include <gdirposx.h>
#include <gwildmat.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOOPUS
#include <gedacfg.h>
#undef _NORMAL
@ -75,11 +79,12 @@ void gareafile::ReadOpus(char* tag) {
// Found Opus 1.7x config files
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(&msgsys, sizeof(_msgsys), 1, fp) == 1) {
@ -131,11 +136,12 @@ void gareafile::ReadOpus(char* tag) {
MakePathname(file, oppath, de->name.c_str());
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(&sysdat, sizeof(_systemdat), 1, fp);
if(*sysdat.msgpath and *sysdat.msgtitle) {

View File

@ -28,6 +28,10 @@
#include <gmemdbg.h>
#include <gfile.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOPCB
#include <gedacfg.h>
#include <gs_pcb.h>
@ -83,10 +87,10 @@ void gareafile::ReadPCBoard(char* tag) {
gfile fp;
const char* _file = AddPath(_path, "pcboard.dat");
fp.fopen(_file, "rt");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
int _line = 0;
@ -114,10 +118,10 @@ void gareafile::ReadPCBoard(char* tag) {
if(*_fidopath) {
const char* _file = AddPath(_fidopath, "pcbfido.cfg");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
// Get configuration file version
fp.fread(&fido_version, 2);
@ -161,9 +165,11 @@ void gareafile::ReadPCBoard(char* tag) {
_file = AddPath(_fidopath, "areas.dat");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
word cfgver = 0;
fp.fread(&cfgver, 2);
if(cfgver == 3) {
@ -177,9 +183,11 @@ void gareafile::ReadPCBoard(char* tag) {
_file = AddPath(_fidopath, "akas.dat");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
word cfgver = 0;
fp.fread(&cfgver, 2);
if(cfgver == 3) {
@ -199,9 +207,11 @@ void gareafile::ReadPCBoard(char* tag) {
_file = AddPath(_fidopath, "origins.dat");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
word cfgver = 0;
fp.fread(&cfgver, 2);
if(cfgver == 3) {
@ -246,18 +256,18 @@ void gareafile::ReadPCBoard(char* tag) {
_file = AddPath(_cnamespath, ".@@@");
fp.fopen(_file, "rb");
if(fp.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
gfile fp2;
_file = AddPath(_cnamespath, ".add");
fp2.fopen(_file, "rb");
if(fp2.isopen()) {
if(not quiet)
std::cout << "* Reading " << _file << std::endl;
if (fp2.isopen())
{
if (not quiet)
STD_PRINT("* Reading " << _file << std::endl);
word _recsize = 0;
fp.fread(&_recsize, 2);

View File

@ -27,6 +27,10 @@
#include <cstring>
#include <cstdlib>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOPROBOARD
#include <gedacfg.h>
#include <gs_pb200.h>
@ -62,10 +66,10 @@ void gareafile::ReadProBoard(char* tag) {
Config* cfg = (Config*)throw_calloc(1, sizeof(Config));
MakePathname(file, path, "config.pro");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(cfg, sizeof(Config), 1, fp);
@ -78,10 +82,10 @@ void gareafile::ReadProBoard(char* tag) {
uint akasz = (uint)GetFilesize(file);
ftn_addr* aka = (ftn_addr*)throw_calloc(1, akasz+sizeof(ftn_addr));
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(aka, akasz, 1, fp);
fclose(fp);
@ -90,12 +94,12 @@ void gareafile::ReadProBoard(char* tag) {
MsgAreas* area = (MsgAreas*)throw_calloc(1, sizeof(MsgAreas));
MakePathname(file, path, "msgareas.pb");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(area, sizeof(MsgAreas), 1, fp) == 1) {
aa.reset();

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOQECHO
#include <gedacfg.h>
@ -39,11 +43,12 @@ void gareafile::ReadQEchoFile(char* file, char* options, char* origin) {
char buf[512];
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fgets(buf, sizeof(buf), fp)) {

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOQFRONT
#include <gedacfg.h>
#include <gs_qfrnt.h>
@ -62,9 +66,11 @@ void gareafile::ReadQFront(char* tag) {
OriginLineRecord* origin = (OriginLineRecord*)throw_calloc(1, sizeof(OriginLineRecord));
MakePathname(file, path, "qorigin.dat");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(origin, sizeof(OriginLineRecord), 1, fp);
for(int n=0; n<MaxOrigins; n++)
STRNP2C(origin->OriginLine[n]);
@ -74,12 +80,12 @@ void gareafile::ReadQFront(char* tag) {
EchoMailConferenceRecord* area = (EchoMailConferenceRecord*)throw_calloc(1, sizeof(EchoMailConferenceRecord));
MakePathname(file, path, "qechos.dat");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
while(fread(area, sizeof(EchoMailConferenceRecord), 1, fp) == 1) {
if(not area->Deleted) {

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOQBBS
#include <gedacfg.h>
#include <gs_qbbs.h>
@ -50,10 +54,10 @@ void gareafile::ReadQ260(char* qbpath, char* origin, char* options) {
MakePathname(file, qbpath, "config.bbs");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(cfg, sizeof(Q260CfgRecT), 1, fp);
@ -138,10 +142,10 @@ void gareafile::ReadQ276(char* qbpath, char* origin, char* options) {
MakePathname(file, qbpath, "quickcfg.dat");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(cfg, sizeof(Q276CfgRecT), 1, fp);
@ -154,10 +158,10 @@ void gareafile::ReadQ276(char* qbpath, char* origin, char* options) {
MakePathname(file, qbpath, "MSGCFG.DAT");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
int _recs = (int)(filelength(fileno(fp)) / sizeof(Q276BrdRecT));
// int _fmt = (_recs > 200) ? GMB_GOLDBASE : GMB_HUDSON;

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gmemdbg.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NORA
#include <gedacfg.h>
#include <gs_ra.h>
@ -72,10 +76,10 @@ void gareafile::ReadRemoteAccess(char* tag) {
MakePathname(file, rapath, "config.ra");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(config, sizeof(CONFIGrecord), 1, fp);
fclose(fp);
@ -94,11 +98,12 @@ void gareafile::ReadRemoteAccess(char* tag) {
strnp2cc(rapath, config->SysPath, sizeof(Path));
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
if(config->VersionID >= 0x200) {
MESSAGErecord* area = new MESSAGErecord; throw_new(area);

View File

@ -26,6 +26,10 @@
#include <cstdlib>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NORAECHO
#include <gedacfg.h>
#include <gs_recho.h>
@ -74,19 +78,21 @@ void gareafile::ReadRaEcho(char* tag) {
else if((raesize%(long)sizeof(TRaEchoArea101)) == 0)
raever = sizeof(TRaEchoArea101);
}
if(raever == 0) {
if(not quiet)
std::cout << "* Could not determine version of RA-ECHO - skipping." << std::endl;
if (raever == 0)
{
if (not quiet)
STD_PRINT("* Could not determine version of RA-ECHO - skipping." << std::endl);
return;
}
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
areano = 1;
while(fread(&area, raever, 1, fp) == 1) {

View File

@ -28,6 +28,10 @@
#include <gcrcall.h>
#include <gstrall.h>
#include <gutlmisc.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOSPCT
#include <gedacfg.h>
@ -74,11 +78,12 @@ void gareafile::ReadSpaceAr(const char* file) {
const word CRC_ENDAREA = 0x3E9F;
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
char buf[4000];
AreaCfg aa;
@ -169,11 +174,12 @@ void gareafile::ReadSpaceNtm(const char* file) {
const word CRC_ENDNETMAIL = 0xD995;
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
char buf[4000];
AreaCfg aa;
@ -234,11 +240,12 @@ void gareafile::ReadSpaceCtl(const char* file) {
const word CRC_AREAFILE = 0xB487;
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
char buf[4000];
AreaCfg aa;

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOSQSH
#include <gedacfg.h>
@ -50,11 +54,12 @@ void gareafile::ReadSquishFile(char* path, char* file, char* options, char* orig
Path buf2;
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
aa.reset();

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOSBBS
#include <gedacfg.h>
#include <gs_sbbs.h>
@ -73,10 +77,10 @@ void gareafile::ReadSuperBBS(char* tag) {
MakePathname(file, sbpath, "config.bbs");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(config, sizeof(ConfigRecordT), 1, fp);
STRNP2C(config->OriginLine);
@ -84,10 +88,10 @@ void gareafile::ReadSuperBBS(char* tag) {
MakePathname(file, sbpath, "sconfig.bbs");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(sconfig, sizeof(ExtraConfigT), 1, fp);
fclose(fp);
@ -100,10 +104,10 @@ void gareafile::ReadSuperBBS(char* tag) {
MakePathname(file, sbpath, "boards.bbs");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
for(int n=0; n<200; n++) {
@ -170,10 +174,8 @@ void gareafile::ReadSuperBBS(char* tag) {
fclose(fp);
}
}
else {
std::cout << "* Error: Unsupported version of SuperBBS: " <<
(word)(sconfig->VersionNumber >> 8) << '.' << (word)(sconfig->VersionNumber & 0xFF) << std::endl;
}
else
STD_PRINT("* Error: Unsupported version of SuperBBS: " << (word)(sconfig->VersionNumber >> 8) << '.' << (word)(sconfig->VersionNumber & 0xFF) << std::endl);
}
}

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOSYNCHRONET
#include <gedacfg.h>
#include <gs_sync.h>
@ -83,12 +87,12 @@ void gareafile::ReadSynchronet(char* tag) {
}
FILE* in = fsopen(file, "rb", sharemode);
if(in) {
if (in)
{
setvbuf(in, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
// Skip header:
// max_qwkmsgs 4

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOTIMED
#include <gedacfg.h>
@ -70,11 +74,12 @@ void gareafile::ReadTimedFile(char* path, char* file, char* options, char* origi
char buf2[256];
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
aa.reset();

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOTERMAIL
#include <gedacfg.h>
@ -47,11 +51,12 @@ void gareafile::ReadTmailFile(char* file, char* options, char* origin) {
char buf[512];
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
aa.reset();

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOTOSSCAN
#include <gedacfg.h>
#include <gs_fd.h> // Structures for FrontDoor fd.sys+folder.sys / setup.fd+folder.fd
@ -78,10 +82,10 @@ void gareafile::ReadTosScan(char* tag) {
MakePathname(file, tspath, "fd.sys");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(buf, 5, 1, fp);
if(streql(buf, "JoHo")) { // Check to see that it is v1.99b or higher
@ -111,11 +115,12 @@ void gareafile::ReadTosScan(char* tag) {
MakePathname(file, tspath, "areafile.fd");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fseek(fp, 4L, SEEK_SET); // Skip CRC32

View File

@ -28,6 +28,10 @@
#include <gfilutil.h>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOWMAIL
#include <gedacfg.h>
#include <gs_wmail.h>
@ -69,10 +73,10 @@ void gareafile::ReadWMail(char* tag) {
sprintf(file, "%swmail.prm", path);
fh = sopen(file, O_RDONLY|O_BINARY, sharemode, S_STDRD);
if(fh != -1) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fh != -1)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
read(fh, wmprm, sizeof(TWmailPrm));
@ -124,10 +128,10 @@ void gareafile::ReadWMail(char* tag) {
sprintf(file, "%sareas.prm", path);
fh = sopen(file, O_RDONLY|O_BINARY, sharemode, S_STDRD);
if(fh != -1) {
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (fh != -1)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
// All the echomail areas
while(read(fh, arprm, sizeof(TAreasPrm)) == sizeof(TAreasPrm)) {

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gstrall.h>
#include <gmemdbg.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOWATERGATE
#include <gedacfg.h>
#include <gs_wtr.h>
@ -104,11 +108,12 @@ void gareafile::ReadWtrGteFile(char* options, FILE* fp) {
MakePathname(file, c.systemdir, "areabase.tdb");
fp2 = fsopen(file, "rb", sharemode);
if(fp2) {
if (fp2)
{
char header[26];
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
fread(header, 26, 1, fp2);
strp2c(header);
@ -145,7 +150,7 @@ void gareafile::ReadWtrGteFile(char* options, FILE* fp) {
throw_delete(ar);
}
else
std::cout << "* Error: WaterGate Areabase \"" << header << "\" is not supported - Skipping." << std::endl;
STD_PRINT("* Error: WaterGate Areabase \"" << header << "\" is not supported - Skipping." << std::endl);
fclose(fp2);
}
@ -184,16 +189,18 @@ void gareafile::ReadWtrGte(char* tag) {
MakePathname(file, wtrpath, "wtrcfg.tdb");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
char header[26];
if(not quiet)
std::cout << "* Reading " << file << std::endl;
fread(header, 26, 1, fp); strp2c(header);
if(streql(header, ConfigHeader))
ReadWtrGteFile(options, fp);
else
std::cout << "* Error: WaterGate \"" << header << "\" is not supported - Skipping." << std::endl;
STD_PRINT("* Error: WaterGate \"" << header << "\" is not supported - Skipping." << std::endl);
fclose(fp);
}

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOXBBS
#include <gedacfg.h>
#include <gs_xbbs.h>
@ -55,11 +59,12 @@ void gareafile::ReadAdeptXbbsFile(char* path, char* file, char* options) {
Path apath;
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
aa.reset();

View File

@ -27,6 +27,10 @@
#include <cstdlib>
#include <gcrcall.h>
#include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOXMAIL
#include <gedacfg.h>
#include <gs_xmail.h>
@ -77,11 +81,12 @@ void gareafile::ReadxMailFile(char* file, char* options) {
char buf[512];
FILE* fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
aa.reset();
@ -161,12 +166,12 @@ void gareafile::ReadXMail(char* tag) {
MakePathname(file, xmailpath, "areas.xm");
fp = fsopen(file, "rb", sharemode);
if(fp) {
if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet)
std::cout << "* Reading " << file << std::endl;
if (not quiet)
STD_PRINT("* Reading " << file << std::endl);
areano = 1;
while(fread(&area, sizeof(EchoAreaRec), 1, fp) == 1) {