Replace all std::cout with internally defined macro
This commit is contained in:
@@ -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)) {
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -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++;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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++;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -191,13 +191,15 @@ void Cleanup(void) {
|
||||
throw_xdelete(gvid);
|
||||
|
||||
int smax = MinV((int)GLOG_STORELINES, LOG.storelines);
|
||||
for(int s=0; s<smax; s++)
|
||||
std::cout << LOG.storeline[s] << std::endl;
|
||||
for (int s=0; s<smax; s++)
|
||||
STD_PRINT(LOG.storeline[s] << std::endl);
|
||||
|
||||
if(CFG) {
|
||||
if(LOG.storelines > GLOG_STORELINES)
|
||||
std::cout << "(See also " << CFG->logfile << ")" << std::endl;
|
||||
if(errorlevel > EXIT_NONAME)
|
||||
if (CFG)
|
||||
{
|
||||
if (LOG.storelines > GLOG_STORELINES)
|
||||
STD_PRINT("(See also " << CFG->logfile << ")" << std::endl);
|
||||
|
||||
if (errorlevel > EXIT_NONAME)
|
||||
MakeNoise(SND_S_O_S);
|
||||
|
||||
CfgReset();
|
||||
|
@@ -80,10 +80,10 @@ static void InitCmdline(char* val) {
|
||||
val = key+1;
|
||||
switch(g_toupper(*key)) {
|
||||
case 'C': // Use another Configfile
|
||||
if(*val)
|
||||
if (*val)
|
||||
strcpy(cmdlinecfg, val);
|
||||
else
|
||||
std::cout << "Warning: configuration filename missed for -C option, ignored.\r\n";
|
||||
STD_PRINT("Warning: configuration filename missed for -C option, ignored.\r\n");
|
||||
break;
|
||||
case 'D':
|
||||
cmdlineoldkeyw = (*val == '-');
|
||||
@@ -150,8 +150,9 @@ static void InitCmdline(char* val) {
|
||||
break;
|
||||
case 'Z':
|
||||
gftrk_set_max = atoi(val);
|
||||
if(gftrk_set_max == 0) {
|
||||
std::cout << "Warning: Invalid parameter for -Z option, fixed.\r\n";
|
||||
if (gftrk_set_max == 0)
|
||||
{
|
||||
STD_PRINT("Warning: Invalid parameter for -Z option, fixed.\r\n");
|
||||
gftrk_set_max = 1;
|
||||
}
|
||||
break;
|
||||
@@ -519,7 +520,7 @@ void Initialize(int argc, char* argv[]) {
|
||||
srand(gtime(NULL));
|
||||
|
||||
// Display startup banner
|
||||
std::cout << __gver_longpid__ << " " << __gver_ver__ << "\r\n";
|
||||
STD_PRINT(__gver_longpid__ << " " << __gver_ver__ << "\r\n");
|
||||
|
||||
// Check environment commandline
|
||||
ptr = getenv("GEDCMD");
|
||||
@@ -559,34 +560,34 @@ void Initialize(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
// Print commandline help and exit if requested
|
||||
if(cmdlinehelp) {
|
||||
std::cout <<
|
||||
"Copyright (C) 1990-2005 Odinn Sorensen, Alexander Aganichev, Jacobo Tarrio,\r\n"
|
||||
" Stas Degteff and others\r\n"
|
||||
"-------------------------------------------------------------------------------\r\n"
|
||||
"\r\n"
|
||||
"Invocation: " << argv[0] << " [-options] [keystacking]\r\n"
|
||||
"\r\n"
|
||||
"-C<configfile> Use a different configuration file.\r\n"
|
||||
"-D Disable old obsolete configuration keywords.\r\n"
|
||||
"-E<echoid> Start directly in the specified mail area.\r\n"
|
||||
"-EXPORTSOUP Export SOUP packets during startup.\r\n"
|
||||
"-F or -FF Force recompile of most (or all with -FF) configuration files.\r\n"
|
||||
"-INSTALL[=path] Start the quick install procedure. Look in path, if given.\r\n"
|
||||
"-IMPORTSOUP Import SOUP packets during startup.\r\n"
|
||||
"-M Mute sounds. Disables all noises in GoldED+.\r\n"
|
||||
"-N Disable share-compatible file opens during startup.\r\n"
|
||||
"-NOSCAN Temporarily disable area scan during startup.\r\n"
|
||||
#if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
|
||||
"-P Increase program priority to run faster.\r\n"
|
||||
#endif
|
||||
"-S<sortspec> Sorts all mail areas according to the sort specs.\r\n"
|
||||
"-T<seconds> Set a timeout value. GoldED+ will auto-exit after timeout.\r\n"
|
||||
"-V or -VV Verbose or Very verbose (-VV) config compile. Use -VV to debug.\r\n"
|
||||
"-W Write a GOLDAREA.INC file with AREADEF's of all mail areas.\r\n"
|
||||
"-X, -Y, -Z Reserved for debugging purposes.\r\n"
|
||||
"\r\n"
|
||||
"Any non-option parameter is stuffed into the keyboard buffer.\r\n" ;
|
||||
if (cmdlinehelp)
|
||||
{
|
||||
STD_PRINT("Copyright (C) 1990-2005 Odinn Sorensen, Alexander Aganichev, Jacobo Tarrio,\r\n");
|
||||
STD_PRINT(" Stas Degteff and others\r\n");
|
||||
STD_PRINT("-------------------------------------------------------------------------------\r\n");
|
||||
STD_PRINT("\r\n");
|
||||
STD_PRINT("Invocation: " << argv[0] << " [-options] [keystacking]\r\n");
|
||||
STD_PRINT("\r\n");
|
||||
STD_PRINT("-C<configfile> Use a different configuration file.\r\n");
|
||||
STD_PRINT("-D Disable old obsolete configuration keywords.\r\n");
|
||||
STD_PRINT("-E<echoid> Start directly in the specified mail area.\r\n");
|
||||
STD_PRINT("-EXPORTSOUP Export SOUP packets during startup.\r\n");
|
||||
STD_PRINT("-F or -FF Force recompile of most (or all with -FF) configuration files.\r\n");
|
||||
STD_PRINT("-INSTALL[=path] Start the quick install procedure. Look in path, if given.\r\n");
|
||||
STD_PRINT("-IMPORTSOUP Import SOUP packets during startup.\r\n");
|
||||
STD_PRINT("-M Mute sounds. Disables all noises in GoldED+.\r\n");
|
||||
STD_PRINT("-N Disable share-compatible file opens during startup.\r\n");
|
||||
STD_PRINT("-NOSCAN Temporarily disable area scan during startup.\r\n");
|
||||
#if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
|
||||
STD_PRINT("-P Increase program priority to run faster.\r\n");
|
||||
#endif
|
||||
STD_PRINT("-S<sortspec> Sorts all mail areas according to the sort specs.\r\n");
|
||||
STD_PRINT("-T<seconds> Set a timeout value. GoldED+ will auto-exit after timeout.\r\n");
|
||||
STD_PRINT("-V or -VV Verbose or Very verbose (-VV) config compile. Use -VV to debug.\r\n");
|
||||
STD_PRINT("-W Write a GOLDAREA.INC file with AREADEF's of all mail areas.\r\n");
|
||||
STD_PRINT("-X, -Y, -Z Reserved for debugging purposes.\r\n");
|
||||
STD_PRINT("\r\n");
|
||||
STD_PRINT("Any non-option parameter is stuffed into the keyboard buffer.\r\n");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -678,8 +679,9 @@ void Initialize(int argc, char* argv[]) {
|
||||
if(cmdlineinstall)
|
||||
InstallDetect(cmdlineinstpath);
|
||||
|
||||
if(not fexist(CFG->goldcfg)) {
|
||||
std::cout << "*** Cannot start: " << CFG->goldcfg << " not found! ***\r\n";
|
||||
if (not fexist(CFG->goldcfg))
|
||||
{
|
||||
STD_PRINT("*** Cannot start: " << CFG->goldcfg << " not found! ***\r\n");
|
||||
errorlevel = EXIT_NONAME;
|
||||
exit(0);
|
||||
}
|
||||
@@ -688,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();
|
||||
}
|
||||
|
@@ -88,17 +88,21 @@ void InitSound() {
|
||||
// Find out if there are any sound files to be played
|
||||
#ifdef GOLD_SOUNDSUPPORT
|
||||
std::vector<GEvent>::iterator n;
|
||||
for(n = CFG->event.begin(); n != CFG->event.end(); n++) {
|
||||
if(n->play.type == PLAY_VOC) {
|
||||
for(n = CFG->event.begin(); n != CFG->event.end(); n++)
|
||||
{
|
||||
if(n->play.type == PLAY_VOC)
|
||||
{
|
||||
snd = new gsound;
|
||||
if(snd->is_installed()) {
|
||||
if(not quiet)
|
||||
std::cout << "* Soundcard support was successfully initialized." << std::endl;
|
||||
if (snd->is_installed())
|
||||
{
|
||||
if (not quiet)
|
||||
STD_PRINT("* Soundcard support was successfully initialized." << std::endl);
|
||||
atexit(ResetSound);
|
||||
}
|
||||
else {
|
||||
if(not quiet)
|
||||
std::cout << "* Soundcard support could NOT be initialized!" << std::endl;
|
||||
else
|
||||
{
|
||||
if (not quiet)
|
||||
STD_PRINT("* Soundcard support could NOT be initialized!" << std::endl);
|
||||
ResetSound();
|
||||
}
|
||||
break;
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include <gstrall.h>
|
||||
#include <csignal>
|
||||
#include <iostream>
|
||||
#include <strstream>
|
||||
#include <iomanip>
|
||||
// Wrappers for certain mostly DOS/Borland headers
|
||||
#include <gshare.h>
|
||||
|
Reference in New Issue
Block a user