From 3350c0806e27b139f0ca6d015983ba45ea2ef5af Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Tue, 17 Jan 2006 17:47:35 +0000 Subject: [PATCH] Replace all std::cout with internally defined macro --- golded3/gcarea.cpp | 19 ++++---- golded3/gccfgg.cpp | 39 ++++++++-------- golded3/gccfgg0.cpp | 72 ++++++++++++++++------------- golded3/gccfgg1.cpp | 12 ++--- golded3/gccfgg7.cpp | 20 ++++---- golded3/gccfgg8.cpp | 12 +++-- golded3/gckeys.cpp | 36 +++++++++------ golded3/gclang.cpp | 16 ++++--- golded3/gcmisc.cpp | 27 +++++------ golded3/gedoss.cpp | 14 +++--- golded3/geinit.cpp | 97 +++++++++++++++++++-------------------- golded3/geplay.cpp | 20 ++++---- golded3/golded.h | 1 + goldlib/gall/gdefs.h | 14 ++++++ goldlib/gcfg/gedacfg.cpp | 11 +++-- goldlib/gcfg/gxcrash.cpp | 11 +++-- goldlib/gcfg/gxdb.cpp | 48 +++++++++++-------- goldlib/gcfg/gxdutch.cpp | 11 +++-- goldlib/gcfg/gxezy102.cpp | 20 ++++---- goldlib/gcfg/gxezy110.cpp | 33 +++++++------ goldlib/gcfg/gxfd.cpp | 19 +++++--- goldlib/gcfg/gxfecho6.cpp | 14 ++++-- goldlib/gcfg/gxfidpcb.cpp | 11 +++-- goldlib/gcfg/gxfm116.cpp | 10 ++-- goldlib/gcfg/gxgecho.cpp | 34 ++++++++------ goldlib/gcfg/gxhpt.cpp | 16 +++++-- goldlib/gcfg/gximail4.cpp | 26 +++++++---- goldlib/gcfg/gximail5.cpp | 26 +++++++---- goldlib/gcfg/gximail6.cpp | 34 ++++++++------ goldlib/gcfg/gxinter.cpp | 33 +++++++------ goldlib/gcfg/gxlora.cpp | 19 +++++--- goldlib/gcfg/gxmax3.cpp | 19 +++++--- goldlib/gcfg/gxme2.cpp | 11 +++-- goldlib/gcfg/gxopus.cpp | 18 +++++--- goldlib/gcfg/gxpcb.cpp | 60 ++++++++++++++---------- goldlib/gcfg/gxprobrd.cpp | 28 ++++++----- goldlib/gcfg/gxqecho.cpp | 11 +++-- goldlib/gcfg/gxqfront.cpp | 20 +++++--- goldlib/gcfg/gxquick.cpp | 28 ++++++----- goldlib/gcfg/gxra.cpp | 19 +++++--- goldlib/gcfg/gxraecho.cpp | 20 +++++--- goldlib/gcfg/gxspace.cpp | 25 ++++++---- goldlib/gcfg/gxsquish.cpp | 11 +++-- goldlib/gcfg/gxsuper.cpp | 34 +++++++------- goldlib/gcfg/gxsync.cpp | 12 +++-- goldlib/gcfg/gxtimed.cpp | 11 +++-- goldlib/gcfg/gxtmail.cpp | 11 +++-- goldlib/gcfg/gxts.cpp | 19 +++++--- goldlib/gcfg/gxwmail.cpp | 20 ++++---- goldlib/gcfg/gxwtr.cpp | 23 ++++++---- goldlib/gcfg/gxxbbs.cpp | 11 +++-- goldlib/gcfg/gxxmail.cpp | 19 +++++--- 52 files changed, 728 insertions(+), 477 deletions(-) diff --git a/golded3/gcarea.cpp b/golded3/gcarea.cpp index de9e55a..5909103 100644 --- a/golded3/gcarea.cpp +++ b/golded3/gcarea.cpp @@ -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)) { diff --git a/golded3/gccfgg.cpp b/golded3/gccfgg.cpp index bec25a6..8ef7a21 100644 --- a/golded3/gccfgg.cpp +++ b/golded3/gccfgg.cpp @@ -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 // ------------------------------------------------------------------ diff --git a/golded3/gccfgg0.cpp b/golded3/gccfgg0.cpp index e46ef9e..097a1f2 100644 --- a/golded3/gccfgg0.cpp +++ b/golded3/gccfgg0.cpp @@ -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 + char buff[256]; + sprintf(buff, " %c %04d: %s %s\n", cfgignore ? '-' : '+', line, key, val); + 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++; } diff --git a/golded3/gccfgg1.cpp b/golded3/gccfgg1.cpp index 6019353..d450893 100644 --- a/golded3/gccfgg1.cpp +++ b/golded3/gccfgg1.cpp @@ -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; diff --git a/golded3/gccfgg7.cpp b/golded3/gccfgg7.cpp index b3f1d6c..c7ec1bd 100644 --- a/golded3/gccfgg7.cpp +++ b/golded3/gccfgg7.cpp @@ -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); } // ------------------------------------------------------------------ diff --git a/golded3/gccfgg8.cpp b/golded3/gccfgg8.cpp index 4496922..4c662df 100644 --- a/golded3/gccfgg8.cpp +++ b/golded3/gccfgg8.cpp @@ -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++; } } diff --git a/golded3/gckeys.cpp b/golded3/gckeys.cpp index 0c31251..c586bd5 100644 --- a/golded3/gckeys.cpp +++ b/golded3/gckeys.cpp @@ -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; diff --git a/golded3/gclang.cpp b/golded3/gclang.cpp index 1526fc8..7746861 100644 --- a/golded3/gclang.cpp +++ b/golded3/gclang.cpp @@ -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++; } diff --git a/golded3/gcmisc.cpp b/golded3/gcmisc.cpp index 6e624e1..a7eed0c 100644 --- a/golded3/gcmisc.cpp +++ b/golded3/gcmisc.cpp @@ -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); } diff --git a/golded3/gedoss.cpp b/golded3/gedoss.cpp index 5e64982..5c5db9a 100644 --- a/golded3/gedoss.cpp +++ b/golded3/gedoss.cpp @@ -191,13 +191,15 @@ void Cleanup(void) { throw_xdelete(gvid); int smax = MinV((int)GLOG_STORELINES, LOG.storelines); - for(int s=0; s 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(); diff --git a/golded3/geinit.cpp b/golded3/geinit.cpp index ca8eb5f..ae6a476 100644 --- a/golded3/geinit.cpp +++ b/golded3/geinit.cpp @@ -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 Use a different configuration file.\r\n" - "-D Disable old obsolete configuration keywords.\r\n" - "-E 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 Sorts all mail areas according to the sort specs.\r\n" - "-T 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 Use a different configuration file.\r\n"); + STD_PRINT("-D Disable old obsolete configuration keywords.\r\n"); + STD_PRINT("-E 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 Sorts all mail areas according to the sort specs.\r\n"); + STD_PRINT("-T 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,13 +690,12 @@ void Initialize(int argc, char* argv[]) { compiled = ReadGoldedCfg(cmdlineforce); // Call install finish procedure - if(cmdlineinstall) { - if(InstallFinish()) { - std::cout << "*** INSTALL NOT COMPLETED ***\r\n"; - remove(CFG->goldcfg); - errorlevel = EXIT_NONAME; - exit(0); - } + if (cmdlineinstall && InstallFinish()) + { + STD_PRINT("*** INSTALL NOT COMPLETED ***\r\n"); + remove(CFG->goldcfg); + errorlevel = EXIT_NONAME; + exit(0); } HeaderView = new GMsgHeaderView; @@ -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(); } diff --git a/golded3/geplay.cpp b/golded3/geplay.cpp index d1fdb33..8edb6e3 100644 --- a/golded3/geplay.cpp +++ b/golded3/geplay.cpp @@ -88,17 +88,21 @@ void InitSound() { // Find out if there are any sound files to be played #ifdef GOLD_SOUNDSUPPORT std::vector::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; diff --git a/golded3/golded.h b/golded3/golded.h index 9302734..4a8cc42 100644 --- a/golded3/golded.h +++ b/golded3/golded.h @@ -40,6 +40,7 @@ #include #include #include +#include #include // Wrappers for certain mostly DOS/Borland headers #include diff --git a/goldlib/gall/gdefs.h b/goldlib/gall/gdefs.h index 023ab16..2fb0bc1 100644 --- a/goldlib/gall/gdefs.h +++ b/goldlib/gall/gdefs.h @@ -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 */ diff --git a/goldlib/gcfg/gedacfg.cpp b/goldlib/gcfg/gedacfg.cpp index a5ce98f..5619822 100644 --- a/goldlib/gcfg/gedacfg.cpp +++ b/goldlib/gcfg/gedacfg.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #include @@ -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; diff --git a/goldlib/gcfg/gxcrash.cpp b/goldlib/gcfg/gxcrash.cpp index 4824693..8d1f378 100644 --- a/goldlib/gcfg/gxcrash.cpp +++ b/goldlib/gcfg/gxcrash.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOCMAIL #include @@ -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]; diff --git a/goldlib/gcfg/gxdb.cpp b/goldlib/gcfg/gxdb.cpp index 21493cc..0db9a80 100644 --- a/goldlib/gcfg/gxdb.cpp +++ b/goldlib/gcfg/gxdb.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NODB #include #include @@ -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++) diff --git a/goldlib/gcfg/gxdutch.cpp b/goldlib/gcfg/gxdutch.cpp index c73f08b..46a2a33 100644 --- a/goldlib/gcfg/gxdutch.cpp +++ b/goldlib/gcfg/gxdutch.cpp @@ -26,6 +26,10 @@ #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NODUTCHIE #include @@ -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)) { diff --git a/goldlib/gcfg/gxezy102.cpp b/goldlib/gcfg/gxezy102.cpp index 4087d07..98ec120 100644 --- a/goldlib/gcfg/gxezy102.cpp +++ b/goldlib/gcfg/gxezy102.cpp @@ -26,6 +26,10 @@ #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOEZY #include #include @@ -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; diff --git a/goldlib/gcfg/gxezy110.cpp b/goldlib/gcfg/gxezy110.cpp index a799395..3d5dedb 100644 --- a/goldlib/gcfg/gxezy110.cpp +++ b/goldlib/gcfg/gxezy110.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOEZY #include #include @@ -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) diff --git a/goldlib/gcfg/gxfd.cpp b/goldlib/gcfg/gxfd.cpp index 1c5a1d4..60f252d 100644 --- a/goldlib/gcfg/gxfd.cpp +++ b/goldlib/gcfg/gxfd.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOFD #include #include @@ -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; diff --git a/goldlib/gcfg/gxfecho6.cpp b/goldlib/gcfg/gxfecho6.cpp index 0c7e91e..15bdbbc 100644 --- a/goldlib/gcfg/gxfecho6.cpp +++ b/goldlib/gcfg/gxfecho6.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOFE #include #include @@ -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); } diff --git a/goldlib/gcfg/gxfidpcb.cpp b/goldlib/gcfg/gxfidpcb.cpp index 4860235..1974f8f 100644 --- a/goldlib/gcfg/gxfidpcb.cpp +++ b/goldlib/gcfg/gxfidpcb.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOFIDOPCB #include @@ -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; diff --git a/goldlib/gcfg/gxfm116.cpp b/goldlib/gcfg/gxfm116.cpp index 3ddd416..cfa04e8 100644 --- a/goldlib/gcfg/gxfm116.cpp +++ b/goldlib/gcfg/gxfm116.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOFMAIL #include #include @@ -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); } } } diff --git a/goldlib/gcfg/gxgecho.cpp b/goldlib/gcfg/gxgecho.cpp index 303cfa5..78ea964 100644 --- a/goldlib/gcfg/gxgecho.cpp +++ b/goldlib/gcfg/gxgecho.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOGECHO #include @@ -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); } diff --git a/goldlib/gcfg/gxhpt.cpp b/goldlib/gcfg/gxhpt.cpp index d274e43..6e7bdab 100644 --- a/goldlib/gcfg/gxhpt.cpp +++ b/goldlib/gcfg/gxhpt.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOFIDOCONF #include @@ -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; } diff --git a/goldlib/gcfg/gximail4.cpp b/goldlib/gcfg/gximail4.cpp index a2b3d9e..24e368a 100644 --- a/goldlib/gcfg/gximail4.cpp +++ b/goldlib/gcfg/gximail4.cpp @@ -26,6 +26,10 @@ #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOIMAIL #include #include @@ -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; diff --git a/goldlib/gcfg/gximail5.cpp b/goldlib/gcfg/gximail5.cpp index d4875af..9b63eb9 100644 --- a/goldlib/gcfg/gximail5.cpp +++ b/goldlib/gcfg/gximail5.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOIMAIL #include @@ -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; diff --git a/goldlib/gcfg/gximail6.cpp b/goldlib/gcfg/gximail6.cpp index 4e5024e..e5b51d8 100644 --- a/goldlib/gcfg/gximail6.cpp +++ b/goldlib/gcfg/gximail6.cpp @@ -31,6 +31,10 @@ #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOIMAIL #include @@ -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", - 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; + 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_PRINT(buff); } } diff --git a/goldlib/gcfg/gxinter.cpp b/goldlib/gcfg/gxinter.cpp index 1a8b131..39d341b 100644 --- a/goldlib/gcfg/gxinter.cpp +++ b/goldlib/gcfg/gxinter.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOINTERMAIL #include #include @@ -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); } diff --git a/goldlib/gcfg/gxlora.cpp b/goldlib/gcfg/gxlora.cpp index 2218fd8..912508f 100644 --- a/goldlib/gcfg/gxlora.cpp +++ b/goldlib/gcfg/gxlora.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOLORA #include #include @@ -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)); diff --git a/goldlib/gcfg/gxmax3.cpp b/goldlib/gcfg/gxmax3.cpp index c90e277..bf6da6a 100644 --- a/goldlib/gcfg/gxmax3.cpp +++ b/goldlib/gcfg/gxmax3.cpp @@ -29,6 +29,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOMAXIMUS #include #include @@ -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; diff --git a/goldlib/gcfg/gxme2.cpp b/goldlib/gcfg/gxme2.cpp index 85d2336..d1a0f45 100644 --- a/goldlib/gcfg/gxme2.cpp +++ b/goldlib/gcfg/gxme2.cpp @@ -25,6 +25,10 @@ // ------------------------------------------------------------------ #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOME2 #include @@ -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)) { diff --git a/goldlib/gcfg/gxopus.cpp b/goldlib/gcfg/gxopus.cpp index 380fd5c..88a7680 100644 --- a/goldlib/gcfg/gxopus.cpp +++ b/goldlib/gcfg/gxopus.cpp @@ -30,6 +30,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOOPUS #include #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) { diff --git a/goldlib/gcfg/gxpcb.cpp b/goldlib/gcfg/gxpcb.cpp index e504c68..ad6e5e3 100644 --- a/goldlib/gcfg/gxpcb.cpp +++ b/goldlib/gcfg/gxpcb.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOPCB #include #include @@ -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); diff --git a/goldlib/gcfg/gxprobrd.cpp b/goldlib/gcfg/gxprobrd.cpp index cf5b36e..efc7b0d 100644 --- a/goldlib/gcfg/gxprobrd.cpp +++ b/goldlib/gcfg/gxprobrd.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOPROBOARD #include #include @@ -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(); diff --git a/goldlib/gcfg/gxqecho.cpp b/goldlib/gcfg/gxqecho.cpp index 33b8a85..5e5ee11 100644 --- a/goldlib/gcfg/gxqecho.cpp +++ b/goldlib/gcfg/gxqecho.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOQECHO #include @@ -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)) { diff --git a/goldlib/gcfg/gxqfront.cpp b/goldlib/gcfg/gxqfront.cpp index cd664ae..291d771 100644 --- a/goldlib/gcfg/gxqfront.cpp +++ b/goldlib/gcfg/gxqfront.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOQFRONT #include #include @@ -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; nOriginLine[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) { diff --git a/goldlib/gcfg/gxquick.cpp b/goldlib/gcfg/gxquick.cpp index ec40c48..1464cc2 100644 --- a/goldlib/gcfg/gxquick.cpp +++ b/goldlib/gcfg/gxquick.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOQBBS #include #include @@ -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; diff --git a/goldlib/gcfg/gxra.cpp b/goldlib/gcfg/gxra.cpp index 31ae20a..11b07b4 100644 --- a/goldlib/gcfg/gxra.cpp +++ b/goldlib/gcfg/gxra.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NORA #include #include @@ -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); diff --git a/goldlib/gcfg/gxraecho.cpp b/goldlib/gcfg/gxraecho.cpp index b2abd41..1bd0ee8 100644 --- a/goldlib/gcfg/gxraecho.cpp +++ b/goldlib/gcfg/gxraecho.cpp @@ -26,6 +26,10 @@ #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NORAECHO #include #include @@ -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) { diff --git a/goldlib/gcfg/gxspace.cpp b/goldlib/gcfg/gxspace.cpp index 6adf0c3..7bc9322 100644 --- a/goldlib/gcfg/gxspace.cpp +++ b/goldlib/gcfg/gxspace.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOSPCT #include @@ -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; diff --git a/goldlib/gcfg/gxsquish.cpp b/goldlib/gcfg/gxsquish.cpp index 421d99e..74a45e6 100644 --- a/goldlib/gcfg/gxsquish.cpp +++ b/goldlib/gcfg/gxsquish.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOSQSH #include @@ -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(); diff --git a/goldlib/gcfg/gxsuper.cpp b/goldlib/gcfg/gxsuper.cpp index 768aec0..4a42256 100644 --- a/goldlib/gcfg/gxsuper.cpp +++ b/goldlib/gcfg/gxsuper.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOSBBS #include #include @@ -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); } } diff --git a/goldlib/gcfg/gxsync.cpp b/goldlib/gcfg/gxsync.cpp index f32a8f7..7152ddd 100644 --- a/goldlib/gcfg/gxsync.cpp +++ b/goldlib/gcfg/gxsync.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOSYNCHRONET #include #include @@ -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 diff --git a/goldlib/gcfg/gxtimed.cpp b/goldlib/gcfg/gxtimed.cpp index a6ddcce..27cf137 100644 --- a/goldlib/gcfg/gxtimed.cpp +++ b/goldlib/gcfg/gxtimed.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOTIMED #include @@ -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(); diff --git a/goldlib/gcfg/gxtmail.cpp b/goldlib/gcfg/gxtmail.cpp index bd15584..6c17ee2 100644 --- a/goldlib/gcfg/gxtmail.cpp +++ b/goldlib/gcfg/gxtmail.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOTERMAIL #include @@ -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(); diff --git a/goldlib/gcfg/gxts.cpp b/goldlib/gcfg/gxts.cpp index 33ab859..666ae06 100644 --- a/goldlib/gcfg/gxts.cpp +++ b/goldlib/gcfg/gxts.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOTOSSCAN #include #include // 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 diff --git a/goldlib/gcfg/gxwmail.cpp b/goldlib/gcfg/gxwmail.cpp index f74830b..63f0975 100644 --- a/goldlib/gcfg/gxwmail.cpp +++ b/goldlib/gcfg/gxwmail.cpp @@ -28,6 +28,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOWMAIL #include #include @@ -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)) { diff --git a/goldlib/gcfg/gxwtr.cpp b/goldlib/gcfg/gxwtr.cpp index e52121b..86a7a07 100644 --- a/goldlib/gcfg/gxwtr.cpp +++ b/goldlib/gcfg/gxwtr.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOWATERGATE #include #include @@ -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); } diff --git a/goldlib/gcfg/gxxbbs.cpp b/goldlib/gcfg/gxxbbs.cpp index 6dfafb6..8936be4 100644 --- a/goldlib/gcfg/gxxbbs.cpp +++ b/goldlib/gcfg/gxxbbs.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOXBBS #include #include @@ -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(); diff --git a/goldlib/gcfg/gxxmail.cpp b/goldlib/gcfg/gxxmail.cpp index 4ec2984..f1fe857 100644 --- a/goldlib/gcfg/gxxmail.cpp +++ b/goldlib/gcfg/gxxmail.cpp @@ -27,6 +27,10 @@ #include #include #include +#if defined(__GOLD_GUI__) +#include +#include +#endif #undef GCFG_NOXMAIL #include #include @@ -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) {