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 // Add or update area data
void AreaList::AddNewArea(AreaCfg* aa) { void AreaList::AddNewArea(AreaCfg* aa)
{
if(veryverbose) { if (veryverbose)
{
std::string temp; std::string temp;
std::cout << " fmt=" << aa->basetype << ", eid=\"" << aa->echoid << STD_PRINT(" fmt=" << aa->basetype << ", eid=\"" << aa->echoid);
"\", pth=\"" << aa->path << "\", brd=" << aa->board << STD_PRINT("\", pth=\"" << aa->path << "\", brd=" << aa->board);
", gid=" << aa->groupid << ", aka=" << aa->aka.make_string(temp); STD_PRINT(", gid=" << aa->groupid << ", aka=" << aa->aka.make_string(temp));
std::cout << " " << aa->attr.make_string(temp) << std::endl; STD_PRINT(" " << aa->attr.make_string(temp) << std::endl);
} }
Desc desc; Desc desc;
@ -847,8 +848,8 @@ void AreaList::ReadEcholist(char* val) {
else else
tok = getkeyval; tok = getkeyval;
if(not quiet) if (not quiet)
std::cout << "* Reading " << file << std::endl; STD_PRINT("* Reading " << file << std::endl);
while(fgets((val=buf), sizeof(buf), fp)) { 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.soupexport, CFG->goldpath, CFG->semaphore.soupexport);
MakePathname(CFG->semaphore.exitnow, CFG->goldpath, CFG->semaphore.exitnow); MakePathname(CFG->semaphore.exitnow, CFG->goldpath, CFG->semaphore.exitnow);
if(strieql(CFG->semaphore.exportlist, AddPath(CFG->jampath, "echomail.jam"))) { 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; {
STD_PRINT("* Warning: SEMAPHORE EXPORTLIST must not be the same as ECHOMAIL.JAM!" << std::endl);
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
} }
@ -232,9 +233,10 @@ void WriteGoldGed() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
static int EnterString(char* prompt, char* string, uint length) { #if !defined(__GOLD_GUI__)
static int EnterString(char* prompt, char* string, uint length)
std::cout << prompt << std::endl << "> " << std::flush; {
STD_PRINT(prompt << std::endl << "> " << std::flush);
*string = NUL; *string = NUL;
char* ptr = string; char* ptr = string;
@ -244,18 +246,18 @@ static int EnterString(char* prompt, char* string, uint length) {
k = kbxget(); k = kbxget();
if(k == Key_BS) { if(k == Key_BS) {
if(pos) { if(pos) {
std::cout << "\b \b" << std::flush; STD_PRINT("\b \b" << std::flush);
pos--; pos--;
*(--ptr) = NUL; *(--ptr) = NUL;
} }
} }
else if(k == Key_Esc) { else if(k == Key_Esc) {
std::cout << std::endl; STD_PRINT(std::endl);
*string = NUL; *string = NUL;
return -1; return -1;
} }
else if(k == Key_Ent) { else if(k == Key_Ent) {
std::cout << std::endl; STD_PRINT(std::endl);
*ptr = NUL; *ptr = NUL;
break; break;
} }
@ -263,7 +265,7 @@ static int EnterString(char* prompt, char* string, uint length) {
if(pos < length) { if(pos < length) {
char c = (char)k; char c = (char)k;
if(c) { if(c) {
std::cout << c << std::flush; STD_PRINT(c << std::flush);
*ptr++ = c; *ptr++ = c;
pos++; pos++;
} }
@ -330,10 +332,10 @@ void InstallDetect(char* path) {
if(fexist(cmdlinecfgbak)) if(fexist(cmdlinecfgbak))
remove(cmdlinecfgbak); remove(cmdlinecfgbak);
rename(CFG->goldcfg, 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"); FILE* fp = fopen(CFG->goldcfg, "wt");
if(fp) { if(fp) {
@ -362,7 +364,7 @@ void InstallDetect(char* path) {
} }
if(fexist(AddPath(pth, idetect[i].configname))) { if(fexist(AddPath(pth, idetect[i].configname))) {
fprintf(fp, "AREAFILE %s %s\n", idetect[i].name, pth); 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")) if(streql(idetect[i].name, "Squish"))
gotsquish = true; gotsquish = true;
detected = true; detected = true;
@ -376,7 +378,7 @@ void InstallDetect(char* path) {
PathCopy(pth, ptr); PathCopy(pth, ptr);
if(fexist(AddPath(pth, "im.exe")) or fexist(AddPath(pth, "intrecho.exe"))) { if(fexist(AddPath(pth, "im.exe")) or fexist(AddPath(pth, "intrecho.exe"))) {
fprintf(fp, "AREAFILE InterMail %s\n", pth); 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; detected = true;
} }
@ -391,12 +393,12 @@ void InstallDetect(char* path) {
} }
if(fexist(AddPath(pth, "max.prm"))) { if(fexist(AddPath(pth, "max.prm"))) {
fprintf(fp, "AREAFILE Maximus %s\n", pth); fprintf(fp, "AREAFILE Maximus %s\n", pth);
std::cout << "Found Maximus." << std::endl; STD_PRINT("Found Maximus." << std::endl);
detected = true; detected = true;
} }
if(not gotsquish and fexist(AddPath(pth, "squish.cfg"))) { if(not gotsquish and fexist(AddPath(pth, "squish.cfg"))) {
fprintf(fp, "AREAFILE Squish %s\n", pth); fprintf(fp, "AREAFILE Squish %s\n", pth);
std::cout << "Found Squish." << std::endl; STD_PRINT("Found Squish." << std::endl);
detected = true; detected = true;
} }
@ -404,7 +406,7 @@ void InstallDetect(char* path) {
strcpy(pth, CFG->areapath); strcpy(pth, CFG->areapath);
if(fexist(AddPath(pth, "areadesc.me2"))) { if(fexist(AddPath(pth, "areadesc.me2"))) {
fprintf(fp, "AREAFILE ME2 %sareadesc.me2 %sareas.bbs\n", pth, pth); 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; gotareasbbs = true;
detected = true; detected = true;
} }
@ -414,13 +416,13 @@ void InstallDetect(char* path) {
strcpy(pth, CFG->areapath); strcpy(pth, CFG->areapath);
if(fexist(AddPath(pth, "areas.bbs"))) { if(fexist(AddPath(pth, "areas.bbs"))) {
fprintf(fp, "AREAFILE AreasBBS %sareas.bbs\n", pth); fprintf(fp, "AREAFILE AreasBBS %sareas.bbs\n", pth);
std::cout << "Found AREAS.BBS." << std::endl; STD_PRINT("Found AREAS.BBS." << std::endl);
detected = true; detected = true;
} }
} }
if(not detected) 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); fclose(fp);
} }
@ -511,6 +513,7 @@ install_terminated:
fclose(fp); fclose(fp);
return -1; return -1;
} }
#endif
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

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

View File

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

View File

@ -403,9 +403,9 @@ void CfgSeqMsgId() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void CfgSeqOutRun_Error() { void CfgSeqOutRun_Error()
{
std::cout << "* Warning: Bad SeqOutrun value \'" << val << "\', ignored."<< std::endl; STD_PRINT("* Warning: Bad SeqOutrun value \'" << val << "\', ignored."<< std::endl);
} }
void CfgSeqOutRun() { void CfgSeqOutRun() {
@ -422,10 +422,13 @@ void CfgSeqOutRun() {
p = val; p = val;
while(isdigit((int)(*p))) while(isdigit((int)(*p)))
p++; p++;
if(*p == '\0') { if(*p == '\0')
{
CFG->seqoutrun = s; CFG->seqoutrun = s;
if(veryverbose)
std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl; if (veryverbose)
STD_PRINT(" SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl);
return; return;
} }
if(p[1]) { if(p[1]) {
@ -451,8 +454,9 @@ void CfgSeqOutRun() {
return; return;
} }
CFG->seqoutrun = s; 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); CFG->grp.AddItm(GRP_XLATEXPORT, buf, strlen(buf)+1);
else else
strcpy(CFG->xlatexport, buf); 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++; cfgerrors++;
} }
} }
@ -661,8 +663,10 @@ void CfgXlatimport() {
void CfgXlatlocalset() { void CfgXlatlocalset() {
strupr(strxcpy(CFG->xlatlocalset, val, sizeof(CFG->xlatlocalset))); 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++; cfgerrors++;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -160,6 +160,20 @@ typedef uint32_t time32_t; /* 32-bit time_t type */
#ifdef __cplusplus #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 */ /* Common function-pointer types */

View File

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

View File

@ -27,6 +27,10 @@
#include <cstdlib> #include <cstdlib>
#include <gcrcall.h> #include <gcrcall.h>
#include <gstrall.h> #include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOCMAIL #undef GCFG_NOCMAIL
#include <gedacfg.h> #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) { void gareafile::ReadCrashmailCfg(const char* file) {
FILE* fp = fsopen(file, "rt", sharemode); FILE* fp = fsopen(file, "rt", sharemode);
if(fp) { if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if (not quiet)
std::cout << "* Reading " << file << std::endl; STD_PRINT("* Reading " << file << std::endl);
char buf[4000]; char buf[4000];
char key[30]; char key[30];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,6 +27,10 @@
#include <cstdlib> #include <cstdlib>
#include <gmemdbg.h> #include <gmemdbg.h>
#include <gstrall.h> #include <gstrall.h>
#if defined(__GOLD_GUI__)
#include <gvidall.h>
#include <gvidgui.h>
#endif
#undef GCFG_NOGECHO #undef GCFG_NOGECHO
#include <gedacfg.h> #include <gedacfg.h>
@ -84,10 +88,10 @@ void gareafile::ReadGEcho(char* tag) {
if(gesetup) { if(gesetup) {
fp = fsopen(file, "rb", sharemode); fp = fsopen(file, "rb", sharemode);
if(fp) { if (fp)
{
if(not quiet) if (not quiet)
std::cout << "* Reading " << file << std::endl; STD_PRINT("* Reading " << file << std::endl);
fread(&sysrev, sizeof(word), 1, fp); fread(&sysrev, sizeof(word), 1, fp);
rewind(fp); rewind(fp);
@ -107,13 +111,14 @@ void gareafile::ReadGEcho(char* tag) {
const char *_fidomsgtype = fidomsgtype; const char *_fidomsgtype = fidomsgtype;
if(ge_version >= 102) { if(ge_version >= 102)
{
_fidomsgtype = (gesetup->extraoptions & OPUSDATES) ? "OPUS" : "FTS1"; _fidomsgtype = (gesetup->extraoptions & OPUSDATES) ? "OPUS" : "FTS1";
if((streql(_fidomsgtype, "FTS1")) and (streql(fidomsgtype, "OPUS"))) { 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 << STD_PRINT("* 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 << STD_PRINT("* 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; 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"); MakePathname(file, gepath, "areafile.ge");
fp = fsopen(file, "rb", sharemode); fp = fsopen(file, "rb", sharemode);
if(fp) { if (fp)
{
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if (not quiet)
std::cout << "* Reading " << file << std::endl; STD_PRINT("* Reading " << file << std::endl);
fread(&ahdr, sizeof(AREAFILE_HDR), 1, fp); fread(&ahdr, sizeof(AREAFILE_HDR), 1, fp);
uint arearecsize = (ahdr.maxconnections * sizeof(CONNECTION)) + ahdr.recsize; uint arearecsize = (ahdr.maxconnections * sizeof(CONNECTION)) + ahdr.recsize;
@ -436,7 +442,7 @@ void gareafile::ReadGEcho(char* tag) {
} }
} }
else 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); throw_free(gesetup);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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