Namespace madness to get it to compile with gcc 3.0. Ah, 2.95 works too ;)

This commit is contained in:
Jacobo Tarrío 2001-07-16 20:35:42 +00:00
parent 2f1bb70e33
commit 8c47abb153
111 changed files with 437 additions and 431 deletions

View File

@ -71,7 +71,7 @@ void AreaList::SortAreaGroup(const char* options, int beginarea, int endarea) {
void RenameArea(char* echoid) { void RenameArea(char* echoid) {
vector<EchoRen>::iterator n; std::vector<EchoRen>::iterator n;
for(n = CFG->arearename.begin(); n != CFG->arearename.end(); n++) { for(n = CFG->arearename.begin(); n != CFG->arearename.end(); n++) {
if(strieql(echoid, n->from.c_str())) { if(strieql(echoid, n->from.c_str())) {
strxcpy(echoid, n->to.c_str(), sizeof(Echo)); strxcpy(echoid, n->to.c_str(), sizeof(Echo));
@ -149,11 +149,11 @@ void AddNewArea(AreaCfg& aa) {
void AreaList::AddNewArea(AreaCfg* aa) { void AreaList::AddNewArea(AreaCfg* aa) {
if(veryverbose) { if(veryverbose) {
string temp; std::string temp;
cout << " fmt=" << aa->msgbase << ", eid=\"" << aa->echoid << std::cout << " fmt=" << aa->msgbase << ", eid=\"" << aa->echoid <<
"\", pth=\"" << aa->path << "\", brd=" << aa->board << "\", pth=\"" << aa->path << "\", brd=" << aa->board <<
", gid=" << aa->groupid << ", aka=" << aa->aka.make_string(temp); ", gid=" << aa->groupid << ", aka=" << aa->aka.make_string(temp);
cout << " " << aa->attr.make_string(temp) << endl; std::cout << " " << aa->attr.make_string(temp) << std::endl;
} }
Desc desc; Desc desc;
@ -321,7 +321,7 @@ void AreaList::AddNewArea(AreaCfg* aa) {
// Add aka if not found // Add aka if not found
if(aa->aka.net) { if(aa->aka.net) {
bool found = false; bool found = false;
for(vector<gaka>::iterator i = CFG->aka.begin(); i != CFG->aka.end(); i++) for(std::vector<gaka>::iterator i = CFG->aka.begin(); i != CFG->aka.end(); i++)
if(aa->aka == i->addr) { if(aa->aka == i->addr) {
found = true; found = true;
break; break;
@ -832,7 +832,7 @@ void AreaList::ReadEcholist(char* val) {
tok = getkeyval; tok = getkeyval;
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fgets((val=buf), sizeof(buf), fp)) { while(fgets((val=buf), sizeof(buf), fp)) {
@ -1018,7 +1018,7 @@ const char* AreaCfg::setpath(const char* _path) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Set area origin // Set area origin
int AreaCfgBase::setorigin(string& _origin) { int AreaCfgBase::setorigin(std::string& _origin) {
if(not strblank(_origin.c_str())) { if(not strblank(_origin.c_str())) {
@ -1076,7 +1076,7 @@ char* MapPath(char* map, bool reverse) {
if(reverse) if(reverse)
strchg(cmap, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR); strchg(cmap, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
vector< pair<string, string> >::iterator i; std::vector< std::pair<std::string, std::string> >::iterator i;
for(i = CFG->mappath.begin(); i != CFG->mappath.end(); i++) { for(i = CFG->mappath.begin(); i != CFG->mappath.end(); i++) {
const char* p = reverse ? i->second.c_str() : i->first.c_str(); const char* p = reverse ? i->second.c_str() : i->first.c_str();
const char* q = reverse ? i->first.c_str() : i->second.c_str(); const char* q = reverse ? i->first.c_str() : i->second.c_str();

View File

@ -98,7 +98,7 @@ bool ReadGoldedCfg(int& force) {
if(*CFG->souptosslog) if(*CFG->souptosslog)
MakePathname(CFG->souptosslog, CFG->goldpath, CFG->souptosslog); MakePathname(CFG->souptosslog, CFG->goldpath, CFG->souptosslog);
vector<Tpl>::iterator t; std::vector<Tpl>::iterator t;
for(t = CFG->tpl.begin(); t != CFG->tpl.end(); t++) for(t = CFG->tpl.begin(); t != CFG->tpl.end(); t++)
MakePathname(t->file, CFG->templatepath, t->file); MakePathname(t->file, CFG->templatepath, t->file);
@ -121,7 +121,7 @@ bool ReadGoldedCfg(int& force) {
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"))) {
cout << "* Warning: SEMAPHORE EXPORTLIST must not be the same as ECHOMAIL.JAM!" << endl; std::cout << "* Warning: SEMAPHORE EXPORTLIST must not be the same as ECHOMAIL.JAM!" << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
} }
@ -134,7 +134,7 @@ bool ReadGoldedCfg(int& force) {
ReadXlatTables(); ReadXlatTables();
// Free all mapfile name allocations // Free all mapfile name allocations
vector<Map>::iterator xlt; std::vector<Map>::iterator xlt;
for(xlt = CFG->xlatescset.begin(); xlt != CFG->xlatescset.end(); xlt++) for(xlt = CFG->xlatescset.begin(); xlt != CFG->xlatescset.end(); xlt++)
throw_release(xlt->mapfile); throw_release(xlt->mapfile);
for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++)
@ -214,7 +214,7 @@ void WriteGoldGed() {
static int EnterString(char* prompt, char* string, uint length) { static int EnterString(char* prompt, char* string, uint length) {
cout << prompt << endl << "> " << flush; std::cout << prompt << std::endl << "> " << std::flush;
*string = NUL; *string = NUL;
char* ptr = string; char* ptr = string;
@ -224,18 +224,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) {
cout << "\b \b" << flush; std::cout << "\b \b" << std::flush;
pos--; pos--;
*(--ptr) = NUL; *(--ptr) = NUL;
} }
} }
else if(k == Key_Esc) { else if(k == Key_Esc) {
cout << endl; std::cout << std::endl;
*string = NUL; *string = NUL;
return -1; return -1;
} }
else if(k == Key_Ent) { else if(k == Key_Ent) {
cout << endl; std::cout << std::endl;
*ptr = NUL; *ptr = NUL;
break; break;
} }
@ -243,7 +243,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) {
cout << c << flush; std::cout << c << std::flush;
*ptr++ = c; *ptr++ = c;
pos++; pos++;
} }
@ -310,10 +310,10 @@ void InstallDetect(char* path) {
if(fexist(cmdlinecfgbak)) if(fexist(cmdlinecfgbak))
remove(cmdlinecfgbak); remove(cmdlinecfgbak);
rename(CFG->goldcfg, cmdlinecfgbak); rename(CFG->goldcfg, cmdlinecfgbak);
cout << "WARNING: Existing config backed up to " << cmdlinecfgbak << "!!!" << endl; std::cout << "WARNING: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl;
} }
cout << "Please wait while GoldED+ is detecting your software." << endl; std::cout << "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) {
@ -342,7 +342,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);
cout << "Found " << idetect[i].name << (ptr ? "." : " (unreliable).") << endl; std::cout << "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;
@ -356,7 +356,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);
cout << "Found InterMail and/or InterEcho." << endl; std::cout << "Found InterMail and/or InterEcho." << std::endl;
detected = true; detected = true;
} }
@ -371,12 +371,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);
cout << "Found Maximus." << endl; std::cout << "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);
cout << "Found Squish." << endl; std::cout << "Found Squish." << std::endl;
detected = true; detected = true;
} }
@ -384,7 +384,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);
cout << "Found ME2." << endl; std::cout << "Found ME2." << std::endl;
gotareasbbs = true; gotareasbbs = true;
detected = true; detected = true;
} }
@ -394,13 +394,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);
cout << "Found AREAS.BBS." << endl; std::cout << "Found AREAS.BBS." << std::endl;
detected = true; detected = true;
} }
} }
if(not detected) if(not detected)
cout << "Sorry, could not find any supported software. Try another path." << endl; std::cout << "Sorry, could not find any supported software. Try another path." << std::endl;
fclose(fp); fclose(fp);
} }

View File

@ -694,7 +694,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
inuse++; inuse++;
if(not quiet) if(not quiet)
cout << "* Reading " << cfg << endl; std::cout << "* Reading " << cfg << std::endl;
// Assign file buffer // Assign file buffer
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
@ -718,7 +718,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
switch(crc) { switch(crc) {
case CRC_IF: case CRC_IF:
if(in_if) { if(in_if) {
cout << "* " << cfgname << ": Misplaced IF at line " << line << ". IF's cannot be nested." << endl; std::cout << "* " << cfgname << ": Misplaced IF at line " << line << ". IF's cannot be nested." << std::endl;
cfgerrors++; cfgerrors++;
} }
in_if = true; in_if = true;
@ -728,7 +728,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
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) {
cout << "* " << cfgname << ": Misplaced ELIF/ELSEIF at line " << line << "." << endl; std::cout << "* " << cfgname << ": Misplaced ELIF/ELSEIF at line " << line << "." << std::endl;
cfgerrors++; cfgerrors++;
} }
if(if_status) if(if_status)
@ -740,7 +740,7 @@ 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) {
cout << "* " << cfgname << ": Misplaced ELSE at line " << line << "." << endl; std::cout << "* " << cfgname << ": Misplaced ELSE at line " << line << "." << std::endl;
cfgerrors++; cfgerrors++;
} }
in_else = true; in_else = true;
@ -749,7 +749,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
break; break;
case CRC_ENDIF: case CRC_ENDIF:
if(not in_if) { if(not in_if) {
cout << "* " << cfgname << ": Misplaced ENDIF at line " << line << "." << endl; std::cout << "* " << cfgname << ": Misplaced ENDIF at line " << line << "." << std::endl;
cfgerrors++; cfgerrors++;
} }
cfgignore = false; cfgignore = false;
@ -764,7 +764,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
// Tell the world what we found // Tell the world what we found
if(veryverbose) if(veryverbose)
cout << " " << (cfgignore ? '-' : '+') << setw(4) << setfill('0') << line << setfill(' ') << ": " << key << " " << val << endl; std::cout << " " << (cfgignore ? '-' : '+') << std::setw(4) << std::setfill('0') << line << std::setfill(' ') << ": " << key << " " << val << std::endl;
// Call switch function to act on the key // Call switch function to act on the key
if(not cfgignore) { if(not cfgignore) {
@ -773,18 +773,18 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
case CRC_INCLUDE: case CRC_INCLUDE:
strschg_environ(val); strschg_environ(val);
if(not quiet) if(not quiet)
cout << "* Including " << val << endl; std::cout << "* Including " << val << std::endl;
ReadCfg(val); // NOTE! This is a recursive call! ReadCfg(val); // NOTE! This is a recursive call!
if(not quiet) if(not quiet)
cout << "* Resuming " << cfg << endl; std::cout << "* Resuming " << cfg << std::endl;
break; break;
case CRC_AREAFILE: case CRC_AREAFILE:
strschg_environ(val); strschg_environ(val);
if(not quiet) if(not quiet)
cout << "* Handling " << key << " " << val << endl; std::cout << "* Handling " << key << " " << val << std::endl;
AL.GetAreafile(val); AL.GetAreafile(val);
if(not quiet) if(not quiet)
cout << "* Resuming " << cfg << endl; std::cout << "* Resuming " << cfg << std::endl;
break; break;
case CRC_APP: case CRC_APP:
// Ignore 3rd party application lines // Ignore 3rd party application lines
@ -795,7 +795,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
default: default:
if(not SwitchCfg(crc, *key, val)) { if(not SwitchCfg(crc, *key, val)) {
if(not ignoreunknown) { if(not ignoreunknown) {
cout << "* " << cfgname << ": Unknown keyword \"" << key << "\" at line " << line << "." << endl; std::cout << "* " << cfgname << ": Unknown keyword \"" << key << "\" at line " << line << "." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
} }
@ -836,7 +836,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) {
ap->set_type(AT_SOUP|AT_EMAIL|AT_NET); ap->set_type(AT_SOUP|AT_EMAIL|AT_NET);
} }
vector<MailList>::iterator z; std::vector<MailList>::iterator z;
for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++) { for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++) {
Area* ap = AL.AreaEchoToPtr(z->echoid); Area* ap = AL.AreaEchoToPtr(z->echoid);
if(ap) if(ap)

View File

@ -41,7 +41,7 @@ void CfgAddress(char* v) {
if(not strblank(v)) { if(not strblank(v)) {
if(veryverbose) if(veryverbose)
cout << " CfgAddress(" << v << ")" << endl; std::cout << " CfgAddress(" << v << ")" << std::endl;
gaka aka; gaka aka;
aka.domain[0] = NUL; aka.domain[0] = NUL;
@ -349,7 +349,7 @@ void CfgArealistscan() {
char* _key; char* _key;
getkeyval(&_key, &val); getkeyval(&_key, &val);
AL.ListScan.Add(pair<string, string>(StripQuotes(_key), val)); AL.ListScan.Add(std::pair<std::string, std::string>(StripQuotes(_key), val));
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -346,7 +346,7 @@ void CfgEvent() {
char* key; char* key;
word x; word x;
vector<GEvent>::iterator n; std::vector<GEvent>::iterator n;
GEvent tmp; GEvent tmp;
x = getkeyvalcrc(&key, &val); x = getkeyvalcrc(&key, &val);

View File

@ -401,7 +401,7 @@ void CfgMailtoss() {
void CfgMappath() { void CfgMappath() {
char* key; char* key;
pair<string, string> mapentry; std::pair<std::string, std::string> mapentry;
getkeyval(&key, &val); getkeyval(&key, &val);

View File

@ -363,7 +363,7 @@ void CfgUsername() {
strxcpy(tmp.name, strbtrim(val), sizeof(Name)); strxcpy(tmp.name, strbtrim(val), sizeof(Name));
// Check if we have it already // Check if we have it already
vector<Node>::iterator u; std::vector<Node>::iterator u;
for(u = CFG->username.begin(); u != CFG->username.end(); u++) for(u = CFG->username.begin(); u != CFG->username.end(); u++)
if(strieql(tmp.name, u->name)) if(strieql(tmp.name, u->name))
return; return;
@ -514,7 +514,7 @@ void CfgXlatexport() {
else else
strcpy(CFG->xlatexport, buf); strcpy(CFG->xlatexport, buf);
if(CFG->usecharset and (strieql(buf, "IBMPC") or strieql(buf, "+7_FIDO"))) { if(CFG->usecharset and (strieql(buf, "IBMPC") or strieql(buf, "+7_FIDO"))) {
cout << "* Warning: Charset " << buf << " is obsolte. Consider using CPxxx form." << endl; std::cout << "* Warning: Charset " << buf << " is obsolete. Consider using CPxxx form." << std::endl;
cfgerrors++; cfgerrors++;
} }
} }
@ -537,7 +537,7 @@ void CfgXlatlocalset() {
strupr(strxcpy(CFG->xlatlocalset, val, sizeof(CFG->xlatlocalset))); strupr(strxcpy(CFG->xlatlocalset, val, sizeof(CFG->xlatlocalset)));
if(strieql(CFG->xlatlocalset, "IBMPC") or strieql(CFG->xlatlocalset, "+7_FIDO")) { if(strieql(CFG->xlatlocalset, "IBMPC") or strieql(CFG->xlatlocalset, "+7_FIDO")) {
cout << "* Warning: Charset " << CFG->xlatlocalset << " is obsolte. Cosider using CPxxx form." << endl; std::cout << "* Warning: Charset " << CFG->xlatlocalset << " is obsolete. Consider using CPxxx form." << std::endl;
cfgerrors++; cfgerrors++;
} }
} }

View File

@ -882,7 +882,7 @@ void KeyCmdAdd(gkey keycmd, gkey keyval, int keytype) {
if(keyval <= 0xFF) if(keyval <= 0xFF)
keyval |= (gkey)(scancode(keyval) << 8); keyval |= (gkey)(scancode(keyval) << 8);
list<CmdKey>::iterator tmp = CFG->cmdkey.begin(); std::list<CmdKey>::iterator tmp = CFG->cmdkey.begin();
if(CFG->switches.get(keybdefaults)) { if(CFG->switches.get(keybdefaults)) {
while(tmp != CFG->cmdkey.end()) { while(tmp != CFG->cmdkey.end()) {
if(tmp->type == keytype) { if(tmp->type == keytype) {
@ -975,7 +975,7 @@ int ReadKeysCfg(int force) {
cfgname = cfgname ? cfgname+1 : cfg; cfgname = cfgname ? cfgname+1 : cfg;
if(not quiet) if(not quiet)
cout << "* Reading " << cfg << endl; std::cout << "* Reading " << cfg << std::endl;
CFG->macro.clear(); CFG->macro.clear();
CFG->cmdkey.clear(); CFG->cmdkey.clear();
@ -993,7 +993,7 @@ int ReadKeysCfg(int force) {
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype); keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype);
if(keycmd) { if(keycmd) {
if(keytype) { if(keytype) {
cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << endl; std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
continue; continue;
@ -1009,7 +1009,7 @@ int ReadKeysCfg(int force) {
else if(strlen(ptr2) == 1) else if(strlen(ptr2) == 1)
keyval = (gkey)tolower(*ptr2); // Always convert to lowercase internally keyval = (gkey)tolower(*ptr2); // Always convert to lowercase internally
else { else {
cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << endl; std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
continue; continue;
@ -1046,7 +1046,7 @@ int ReadKeysCfg(int force) {
tmp2.buf[n++] = (gkey)keycmd; tmp2.buf[n++] = (gkey)keycmd;
} }
else { else {
cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << endl; std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
continue; continue;
@ -1061,7 +1061,7 @@ int ReadKeysCfg(int force) {
CFG->macro.push_back(tmp2); CFG->macro.push_back(tmp2);
// delete overlayed (non-macro) key definition // delete overlayed (non-macro) key definition
list<CmdKey>::iterator tmp = CFG->cmdkey.begin(); std::list<CmdKey>::iterator tmp = CFG->cmdkey.begin();
while(tmp != CFG->cmdkey.end()) { while(tmp != CFG->cmdkey.end()) {
if(tmp->type == keytype) { if(tmp->type == keytype) {
if(tmp->key == keyval) { if(tmp->key == keyval) {
@ -1076,14 +1076,14 @@ int ReadKeysCfg(int force) {
else if(keytype) else if(keytype)
KeyCmdAdd(keycmd, keyval, keytype); KeyCmdAdd(keycmd, keyval, keytype);
else { else {
cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << endl; std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
continue; continue;
} }
} }
else { else {
cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << endl; std::cout << "* " << cfgname << ": Invalid key \"" << ptr2 << "\" in line " << line << "." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
continue; continue;
@ -1100,7 +1100,7 @@ int ReadKeysCfg(int force) {
CFG->cmdkey.sort(CmdKeyCmp); CFG->cmdkey.sort(CmdKeyCmp);
// Count keys // Count keys
list<CmdKey>::iterator ck = CFG->cmdkey.begin(); std::list<CmdKey>::iterator ck = CFG->cmdkey.begin();
while(ck != CFG->cmdkey.end()) { while(ck != CFG->cmdkey.end()) {
switch(ck->type) { switch(ck->type) {
case KT_A: AreaKeys++; if(AreaKeys == 1) AreaKey = ck; break; case KT_A: AreaKeys++; if(AreaKeys == 1) AreaKey = ck; break;
@ -1117,7 +1117,7 @@ int ReadKeysCfg(int force) {
} }
// Assign global macros // Assign global macros
vector<Macro>::iterator k; std::vector<Macro>::iterator k;
for(k=CFG->macro.begin(), n=0; k != CFG->macro.end(); k++, n++) { for(k=CFG->macro.begin(), n=0; k != CFG->macro.end(); k++, n++) {
if(k->type == 0) { if(k->type == 0) {
if(k->key == KK_Auto) { if(k->key == KK_Auto) {

View File

@ -671,7 +671,7 @@ bool ReadLangCfg(int force) {
setvbuf(fpi, NULL, _IOFBF, 8192); setvbuf(fpi, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << cfgname << endl; std::cout << "* Reading " << cfgname << std::endl;
cfgname = CleanFilename(cfgname); cfgname = CleanFilename(cfgname);
@ -691,7 +691,7 @@ bool ReadLangCfg(int force) {
} }
if(SwitchLanguage(strCrc16(strupr(ptr)), str)) { if(SwitchLanguage(strCrc16(strupr(ptr)), str)) {
if(cmdlineoldkeyw == false) { if(cmdlineoldkeyw == false) {
cout << "* " << cfgname << " line " << line << ": \"" << ptr << "\" is obsolete or unknown." << endl; std::cout << "* " << cfgname << " line " << line << ": \"" << ptr << "\" is obsolete or unknown." << std::endl;
SayBibi(); SayBibi();
cfgerrors++; cfgerrors++;
} }

View File

@ -52,7 +52,7 @@ int ReadHelpCfg(int force) {
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)
cout << "* Reading " << AddPath(CFG->goldpath, CFG->helpcfg.fn) << endl; std::cout << "* Reading " << AddPath(CFG->goldpath, CFG->helpcfg.fn) << std::endl;
setvbuf(ofp, NULL, _IOFBF, 8192); setvbuf(ofp, NULL, _IOFBF, 8192);
@ -603,7 +603,7 @@ void ReadXlatTables() {
if(ofp) { if(ofp) {
// Compile CHARSET tables // Compile CHARSET tables
vector<Map>::iterator xlt; std::vector<Map>::iterator xlt;
for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) { for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) {
// Assign table defaults // Assign table defaults
@ -617,7 +617,7 @@ void ReadXlatTables() {
if(ifp) { if(ifp) {
if(not quiet) if(not quiet)
cout << "* Reading " << buf << endl; std::cout << "* Reading " << buf << std::endl;
// Read the definition file // Read the definition file
line = 1; line = 1;
@ -699,7 +699,7 @@ void ReadXlatTables() {
fclose(ifp); fclose(ifp);
} }
else else
cout << "* XLAT table " << buf << " could not be opened." << endl; std::cout << "* XLAT table " << buf << " could not be opened." << std::endl;
fwrite(&ChsTable, sizeof(Chs), 1, ofp); fwrite(&ChsTable, sizeof(Chs), 1, ofp);
} }
@ -714,7 +714,7 @@ void ReadXlatTables() {
if(ifp) { if(ifp) {
if(not quiet) if(not quiet)
cout << "* Reading " << buf << endl; std::cout << "* Reading " << buf << std::endl;
// Read the definition file // Read the definition file
line = 1; line = 1;
@ -778,7 +778,7 @@ void ReadXlatTables() {
fclose(ifp); fclose(ifp);
} }
else else
cout << "* XLAT table " << buf << " could not be opened." << endl; std::cout << "* XLAT table " << buf << " could not be opened." << std::endl;
fwrite(&EscTable, sizeof(Esc), 1, ofp); fwrite(&EscTable, sizeof(Esc), 1, ofp);
} }

View File

@ -369,8 +369,8 @@ struct Tpl {
class EchoRen { class EchoRen {
public: public:
string from; std::string from;
string to; std::string to;
EchoRen() {} EchoRen() {}
EchoRen(const char *_from, const char *_to) { from = _from; to = _to; } EchoRen(const char *_from, const char *_to) { from = _from; to = _to; }
~EchoRen() {} ~EchoRen() {}
@ -914,7 +914,7 @@ struct Ezycom {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
struct Invalidate { struct Invalidate {
pair<string, string> origin, seenby, tearline, cc, xc, xp; std::pair<std::string, std::string> origin, seenby, tearline, cc, xc, xp;
}; };

View File

@ -196,7 +196,7 @@ int DoCarboncopy(GMsg* msg, GMsg** carbon) {
newline = newline->next; newline = newline->next;
} while(newline != NULL); } while(newline != NULL);
string temp; std::string temp;
// Fix the CC list in the message // Fix the CC list in the message
if(cc and ccline) { if(cc and ccline) {
switch(CFG->carboncopylist) { switch(CFG->carboncopylist) {
@ -235,7 +235,7 @@ int DoCarboncopy(GMsg* msg, GMsg** carbon) {
case CC_NAMES: case CC_NAMES:
// Expand in line // Expand in line
{ {
string hline = ""; std::string hline = "";
int line_items = 0; int line_items = 0;
if(A == AA) { if(A == AA) {
@ -285,7 +285,7 @@ int DoCarboncopy(GMsg* msg, GMsg** carbon) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
static bool AddXCAreas(const char* mask, bool attr, vector<int> &postareas, vector<bool> &postareas_attrs, int local_xps) { static bool AddXCAreas(const char* mask, bool attr, std::vector<int> &postareas, std::vector<bool> &postareas_attrs, int local_xps) {
bool rv = false; bool rv = false;
@ -313,7 +313,7 @@ static bool AddXCAreas(const char* mask, bool attr, vector<int> &postareas, vect
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void DoCrosspost(GMsg* msg, vector<int> &postareas) { void DoCrosspost(GMsg* msg, std::vector<int> &postareas) {
if(CFG->crosspost == NO) if(CFG->crosspost == NO)
return; return;
@ -325,7 +325,7 @@ void DoCrosspost(GMsg* msg, vector<int> &postareas) {
int margintext; int margintext;
bool xphide; bool xphide;
int local_xps = postareas.size(); int local_xps = postareas.size();
vector<bool> postareas_attrs(local_xps); std::vector<bool> postareas_attrs(local_xps);
bool hideoriginal = false; bool hideoriginal = false;
// Insert empty line at the top first for practical purposes // Insert empty line at the top first for practical purposes
@ -425,7 +425,7 @@ void DoCrosspost(GMsg* msg, vector<int> &postareas) {
xcline = AddLine(xcline, buf); xcline = AddLine(xcline, buf);
} }
string hline = ""; std::string hline = "";
int line_items = 0; int line_items = 0;
for(int i=local_xps; i < postareas.size(); i++) { for(int i=local_xps; i < postareas.size(); i++) {

View File

@ -132,16 +132,16 @@ public:
int cfgeditquotemargin; int cfgeditquotemargin;
int cfgquotemargin; int cfgquotemargin;
list<CmdKey> cmdkey; std::list<CmdKey> cmdkey;
vector<Macro> macro; std::vector<Macro> macro;
int addressbookadd; int addressbookadd;
int addresslookupfirst; int addresslookupfirst;
vector<AddrMacro> addressmacro; std::vector<AddrMacro> addressmacro;
Path adeptxbbspath; Path adeptxbbspath;
int adeptxbbsuserno; int adeptxbbsuserno;
vector<gaka> aka; std::vector<gaka> aka;
vector<AkaMatchG> akamatch; std::vector<AkaMatchG> akamatch;
int areaautoid; int areaautoid;
Echo areacfmreplyto; Echo areacfmreplyto;
bool areacopydirect; bool areacopydirect;
@ -165,7 +165,7 @@ public:
gstrarray areapmscanexcl; gstrarray areapmscanexcl;
gstrarray areapmscanincl; gstrarray areapmscanincl;
int areareadonly; int areareadonly;
vector<EchoRen> arearename; std::vector<EchoRen> arearename;
bool areareplydirect; bool areareplydirect;
Echo areareplyto; Echo areareplyto;
gstrarray areascan; gstrarray areascan;
@ -209,19 +209,19 @@ public:
int dispmsgsize; int dispmsgsize;
uint disptabsize; // tabsize; uint disptabsize; // tabsize;
bool encodeemailheaders; bool encodeemailheaders;
vector<GEvent> event; std::vector<GEvent> event;
int externoptions; int externoptions;
vector<ExtUtil> externutil; std::vector<ExtUtil> externutil;
Ezycom ezycom; Ezycom ezycom;
int ezycomuserno; int ezycomuserno;
Path fidolastread; // lastread; Path fidolastread; // lastread;
int fidomsgtype; int fidomsgtype;
Path fidouserlist; Path fidouserlist;
int fidouserno; // lastreaduser; int fidouserno; // lastreaduser;
vector<FileAlias> filealias; std::vector<FileAlias> filealias;
bool forcetemplate; bool forcetemplate;
gstrarray frqext; gstrarray frqext;
vector<FrqNodeMap> frqnodemap; std::vector<FrqNodeMap> frqnodemap;
int frqoptions; int frqoptions;
bool gedhandshake; bool gedhandshake;
Path goldbasepath; Path goldbasepath;
@ -255,8 +255,8 @@ public:
Path loadlanguage; Path loadlanguage;
Path logfile; // goldedlog; Path logfile; // goldedlog;
int logformat; int logformat;
vector<MailList> mailinglist; std::vector<MailList> mailinglist;
vector< pair<string, string> > mappath; std::vector< std::pair<std::string, std::string> > mappath;
int menumarked; int menumarked;
int msglistdate; int msglistdate;
bool msglistfast; bool msglistfast;
@ -329,21 +329,21 @@ public:
char tasktitle[60]; char tasktitle[60];
Tear tearline; Tear tearline;
bool titlestatus; bool titlestatus;
vector<Tpl> tpl; std::vector<Tpl> tpl;
int tplno; int tplno;
bool templatematch; bool templatematch;
Path templatepath; Path templatepath;
Path temppath; Path temppath;
int timeout; int timeout;
int twitmode; // showtwits; int twitmode; // showtwits;
vector<Node> twitname; std::vector<Node> twitname;
gstrarray twitsubj; gstrarray twitsubj;
bool usecharset; bool usecharset;
int usefwd; int usefwd;
bool useintl; bool useintl;
bool usepid; bool usepid;
Path userlistfile; // goldedlst; Path userlistfile; // goldedlst;
vector<Node> username; std::vector<Node> username;
int usernameno; int usernameno;
bool usestylies; bool usestylies;
bool usetzutc; bool usetzutc;
@ -353,9 +353,9 @@ public:
bool viewquote; bool viewquote;
Name whoto; Name whoto;
int wildcatuserno; int wildcatuserno;
string wtpl; std::string wtpl;
vector<Map> xlatcharset; std::vector<Map> xlatcharset;
vector<Map> xlatescset; std::vector<Map> xlatescset;
char xlatexport[17]; // exportcharset[17]; char xlatexport[17]; // exportcharset[17];
char xlatimport[17]; // localcharset[17]; char xlatimport[17]; // localcharset[17];
char xlatlocalset[17]; char xlatlocalset[17];

View File

@ -579,7 +579,7 @@ void DoTearorig(int mode, GMsg* msg) {
char* ptr; char* ptr;
Line* line = msg->lin; Line* line = msg->lin;
Line* newline; Line* newline;
string origin; std::string origin;
origin = AA->Origin(); origin = AA->Origin();

View File

@ -79,7 +79,7 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip)
while(line) { while(line) {
uint lineisctrl = line->type & (GLINE_TEAR|GLINE_ORIG|GLINE_KLUDGE); uint lineisctrl = line->type & (GLINE_TEAR|GLINE_ORIG|GLINE_KLUDGE);
if(not ((mode == MODE_SAVENOCTRL) and lineisctrl)) { if(not ((mode == MODE_SAVENOCTRL) and lineisctrl)) {
string::iterator p = line->txt.begin(); std::string::iterator p = line->txt.begin();
while(p != line->txt.end()) { while(p != line->txt.end()) {
if(mode == MODE_WRITE) { if(mode == MODE_WRITE) {
// Replace control codes, except the ANSI escape code // Replace control codes, except the ANSI escape code

View File

@ -175,11 +175,11 @@ void Cleanup(void) {
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++)
cout << LOG.storeline[s] << endl; std::cout << LOG.storeline[s] << std::endl;
if(CFG) { if(CFG) {
if(LOG.storelines > GLOG_STORELINES) if(LOG.storelines > GLOG_STORELINES)
cout << "(See also " << CFG->logfile << ")" << endl; std::cout << "(See also " << CFG->logfile << ")" << std::endl;
if(errorlevel > EXIT_NONAME) if(errorlevel > EXIT_NONAME)
MakeNoise(SND_S_O_S); MakeNoise(SND_S_O_S);

View File

@ -711,7 +711,7 @@ Line* IEclass::wrapit(Line** __currline, uint* __curr_col, uint* __curr_row, boo
// The line is hard-terminated. // The line is hard-terminated.
// Copy the quote string, if any, to the new line first // Copy the quote string, if any, to the new line first
string _wrapbuf = _quotebuf; std::string _wrapbuf = _quotebuf;
// Copy/append the wrapped part to the new line // Copy/append the wrapped part to the new line
_wrapbuf += _thisline->txt.substr(_wrappos); _wrapbuf += _thisline->txt.substr(_wrappos);
@ -755,7 +755,7 @@ Line* IEclass::wrapit(Line** __currline, uint* __curr_col, uint* __curr_row, boo
Line* _nextline = _thisline->next; Line* _nextline = _thisline->next;
// Copy the quote string, if any, to the new line first // Copy the quote string, if any, to the new line first
string _wrapbuf = _quotebuf; std::string _wrapbuf = _quotebuf;
// Copy/append the wrapped part to the new line // Copy/append the wrapped part to the new line
_wrapbuf += _thisline->txt.substr(_wrappos); _wrapbuf += _thisline->txt.substr(_wrappos);
@ -1208,7 +1208,7 @@ void IEclass::Newline() {
int _splitpos = col; int _splitpos = col;
// Buffer for the second part of the split line // Buffer for the second part of the split line
string _splitbuf; std::string _splitbuf;
// If the split line was quoted, get the quotestring // If the split line was quoted, get the quotestring
// But do not get it if the cursor points to a linefeed or is // But do not get it if the cursor points to a linefeed or is
@ -2590,7 +2590,7 @@ void UndoStack::PlayItem() {
case EDIT_UNDO_TEXT: { case EDIT_UNDO_TEXT: {
text_item* text_data = last_item->data.text_ptr; text_item* text_data = last_item->data.text_ptr;
string *txt = &currline->txt; std::string *txt = &currline->txt;
switch(undo_action) { switch(undo_action) {
case EDIT_UNDO_DEL_TEXT: case EDIT_UNDO_DEL_TEXT:
txt->insert(text_data->col, text_data->text, text_data->len); txt->insert(text_data->col, text_data->text, text_data->len);

View File

@ -908,7 +908,7 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) {
ImportMode = MenuImportTxt.Run(); ImportMode = MenuImportTxt.Run();
} }
string filenamebuf; std::string filenamebuf;
Path tmpfile; Path tmpfile;
bool isPipe = NO; bool isPipe = NO;
bool fileselected = false; bool fileselected = false;

View File

@ -83,7 +83,7 @@ void IEclass::Buf2Clip() {
gclipbrd clipbrd; gclipbrd clipbrd;
Line *_bufline; Line *_bufline;
string clipdata; std::string clipdata;
for(_bufline = Edit__pastebuf; _bufline; _bufline = _bufline->next) for(_bufline = Edit__pastebuf; _bufline; _bufline = _bufline->next)
if(not _bufline->txt.empty()) { if(not _bufline->txt.empty()) {

View File

@ -967,7 +967,7 @@ void FileRequest(GMsg* msg) {
AA->Open(); AA->Open();
if(CFG->frqoptions & FREQ_FAST) if(CFG->frqoptions & FREQ_FAST)
savedirect = true; savedirect = true;
vector<FrqNodeMap>::iterator fnm; std::vector<FrqNodeMap>::iterator fnm;
for(fnm = CFG->frqnodemap.begin(); fnm != CFG->frqnodemap.end(); fnm++) { for(fnm = CFG->frqnodemap.begin(); fnm != CFG->frqnodemap.end(); fnm++) {
if(fnm->from.equals(msg->orig)) { if(fnm->from.equals(msg->orig)) {
msg->orig = fnm->to; msg->orig = fnm->to;

View File

@ -58,7 +58,7 @@ int EditKeys = 0;
int FileKeys = 0; int FileKeys = 0;
int AddressbookKeys = 0; int AddressbookKeys = 0;
int HeaderKeys = 0; int HeaderKeys = 0;
list<CmdKey>::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey; std::list<CmdKey>::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey;
int inforow = 18; int inforow = 18;
@ -263,7 +263,7 @@ bool inline samekey(gkey key1, gkey key2) {
int IsMacro(gkey key, int type) { int IsMacro(gkey key, int type) {
vector<Macro>::iterator m = CFG->macro.begin(); std::vector<Macro>::iterator m = CFG->macro.begin();
while(m != CFG->macro.end()) { while(m != CFG->macro.end()) {
if(((key == m->key) or samekey(key, m->key)) and (type == m->type)) if(((key == m->key) or samekey(key, m->key)) and (type == m->type))
return true; return true;
@ -278,10 +278,10 @@ int IsMacro(gkey key, int type) {
int PlayMacro(gkey key, int type) { int PlayMacro(gkey key, int type) {
vector<Macro>::iterator m = CFG->macro.begin(); std::vector<Macro>::iterator m = CFG->macro.begin();
while(m != CFG->macro.end()) { while(m != CFG->macro.end()) {
if(((key == m->key) or samekey(key, m->key)) and (type == m->type)) { if(((key == m->key) or samekey(key, m->key)) and (type == m->type)) {
RunMacro(m); RunMacro(&(*m));
return true; return true;
} }
m++; m++;

View File

@ -101,7 +101,7 @@ extern int m_titlepos;
extern int m_titleattr; extern int m_titleattr;
extern int AreaKeys, ReadKeys, ListKeys, NodeKeys, EditKeys, FileKeys, AddressbookKeys, HeaderKeys; extern int AreaKeys, ReadKeys, ListKeys, NodeKeys, EditKeys, FileKeys, AddressbookKeys, HeaderKeys;
extern list<CmdKey>::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey; extern std::list<CmdKey>::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey;
extern int inforow; extern int inforow;

View File

@ -138,7 +138,7 @@ bool set_to_address(GMsg* msg, gsetaddr* toname, gsetaddr* toaddr, gsetaddr* fro
strcpy(buf, ptr); strcpy(buf, ptr);
if(not CFG->addressmacro.empty()) { if(not CFG->addressmacro.empty()) {
vector<AddrMacro>::iterator n; std::vector<AddrMacro>::iterator n;
for(n=CFG->addressmacro.begin(); n != CFG->addressmacro.end(); n++) { for(n=CFG->addressmacro.begin(); n != CFG->addressmacro.end(); n++) {
if(strieql(buf, n->macro)) { if(strieql(buf, n->macro)) {
ptr = strcpy(buf1, n->name); ptr = strcpy(buf1, n->name);
@ -299,7 +299,7 @@ bool GMsgHeaderEdit::validate() {
field* ftoaddr = get_field(id_to_addr); field* ftoaddr = get_field(id_to_addr);
field* fsubj = get_field(id_subject); field* fsubj = get_field(id_subject);
gsetaddr toname, toaddr, fromaddr, subj; gsetaddr toname, toaddr, fromaddr, subj;
string orig_toname; std::string orig_toname;
orig_toname = msg->to; orig_toname = msg->to;
toname.buf = current->buf; toname.update = false; toname.buf = current->buf; toname.update = false;
@ -307,7 +307,7 @@ bool GMsgHeaderEdit::validate() {
fromaddr.buf = ffromaddr->buf; fromaddr.update = false; fromaddr.buf = ffromaddr->buf; fromaddr.update = false;
subj.buf = fsubj->buf; subj.update = false; subj.buf = fsubj->buf; subj.update = false;
string iaddr(msg->iaddr), realto(msg->realto); std::string iaddr(msg->iaddr), realto(msg->realto);
bool res = set_to_address(msg, &toname, &toaddr, &fromaddr, &subj, 0, LNG->SelectDestNode, lookup); bool res = set_to_address(msg, &toname, &toaddr, &fromaddr, &subj, 0, LNG->SelectDestNode, lookup);
@ -351,8 +351,8 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view, bool doedithdr) {
GMsgHeaderEdit hedit(view); GMsgHeaderEdit hedit(view);
GMsg *msg = view.msg; GMsg *msg = view.msg;
string from_name, to_name, subject; std::string from_name, to_name, subject;
string from_addr, to_addr, orig_from_addr; std::string from_addr, to_addr, orig_from_addr;
from_name = msg->By(); from_name = msg->By();
if(AA->isinternet()) { if(AA->isinternet()) {
@ -558,9 +558,9 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view, bool doedithdr) {
} }
// Try to match akas with the dest address, but only if the orig address was NOT changed // Try to match akas with the dest address, but only if the orig address was NOT changed
vector<gaka>::iterator i; std::vector<gaka>::iterator i;
for(i = CFG->aka.begin(); i != CFG->aka.end(); i++) { for(i = CFG->aka.begin(); i != CFG->aka.end(); i++) {
if(memcmp(&msg->orig, i, sizeof(Addr)) == 0) if(memcmp(&msg->orig, &(*i), sizeof(Addr)) == 0)
break; // Found one of our own akas. break; // Found one of our own akas.
} }

View File

@ -45,7 +45,7 @@ extern int __gftrk_statusline;
extern bool gmem_check_overrun; extern bool gmem_check_overrun;
#endif #endif
static string keybuf; static std::string keybuf;
static Path cmdlinecfg = ""; static Path cmdlinecfg = "";
bool cmdlinedebughg = false; bool cmdlinedebughg = false;
@ -81,7 +81,7 @@ static void InitCmdline(char* val) {
if(*val) if(*val)
strcpy(cmdlinecfg, val); strcpy(cmdlinecfg, val);
else else
cout << "Warning: configuration filename missed for -C option, ignored." << endl; std::cout << "Warning: configuration filename missed for -C option, ignored." << std::endl;
break; break;
case 'D': case 'D':
cmdlineoldkeyw = (*val == '-') ? true : false; cmdlineoldkeyw = (*val == '-') ? true : false;
@ -149,7 +149,7 @@ static void InitCmdline(char* val) {
case 'Z': case 'Z':
gftrk_set_max = atoi(val); gftrk_set_max = atoi(val);
if(gftrk_set_max == 0) { if(gftrk_set_max == 0) {
cout << "Warning: Invalid parameter for -Z option, fixed." << endl; std::cout << "Warning: Invalid parameter for -Z option, fixed." << std::endl;
gftrk_set_max = 1; gftrk_set_max = 1;
} }
break; break;
@ -206,7 +206,7 @@ static void ReadEscsets() {
FILE* fp; FILE* fp;
vector<Map>::iterator x; std::vector<Map>::iterator x;
int n; int n;
for(n = 0, x = CFG->xlatescset.begin(); x != CFG->xlatescset.end(); x++, n++) { for(n = 0, x = CFG->xlatescset.begin(); x != CFG->xlatescset.end(); x++, n++) {
if(strieql(x->imp, "Composed")) { if(strieql(x->imp, "Composed")) {
@ -487,7 +487,7 @@ void Initialize(int argc, char* argv[]) {
char* ptr2; char* ptr2;
bool dbedit = false; bool dbedit = false;
bool found = false, compiled; bool found = false, compiled;
string truepathtmp; std::string truepathtmp;
throw_init(); throw_init();
#if defined(GTHROW_LOG) #if defined(GTHROW_LOG)
@ -507,7 +507,7 @@ void Initialize(int argc, char* argv[]) {
srand((unsigned)time(NULL)); srand((unsigned)time(NULL));
// Display startup banner // Display startup banner
cout << __gver_longpid__ << " " << __gver_ver__ << endl; std::cout << __gver_longpid__ << " " << __gver_ver__ << std::endl;
// Check environment commandline // Check environment commandline
ptr = getenv("GEDCMD"); ptr = getenv("GEDCMD");
@ -548,33 +548,33 @@ void Initialize(int argc, char* argv[]) {
// Print commandline help and exit if requested // Print commandline help and exit if requested
if(cmdlinehelp) { if(cmdlinehelp) {
cout << std::cout <<
"Copyright (C) 1990-2000 Odinn Sorensen, Alexander Aganichev, Jacobo Tarrio and" << endl << "Copyright (C) 1990-2000 Odinn Sorensen, Alexander Aganichev, Jacobo Tarrio and" << std::endl <<
" others" << endl << " others" << std::endl <<
"-------------------------------------------------------------------------------" << endl << "-------------------------------------------------------------------------------" << std::endl <<
endl << std::endl <<
"Invocation: " << argv[0] << " [-options] [keystacking]" << endl << "Invocation: " << argv[0] << " [-options] [keystacking]" << std::endl <<
endl << std::endl <<
"-C<configfile> Use a different configuration file." << endl << "-C<configfile> Use a different configuration file." << std::endl <<
"-D Disable old obsolete configuration keywords." << endl << "-D Disable old obsolete configuration keywords." << std::endl <<
"-E<echoid> Start directly in the specified mail area." << endl << "-E<echoid> Start directly in the specified mail area." << std::endl <<
"-EXPORTSOUP Export SOUP packets during startup." << endl << "-EXPORTSOUP Export SOUP packets during startup." << std::endl <<
"-F or -FF Force recompile of most (or all with -FF) configuration files." << endl << "-F or -FF Force recompile of most (or all with -FF) configuration files." << std::endl <<
"-INSTALL[=path] Start the quick install procedure. Look in path, if given." << endl << "-INSTALL[=path] Start the quick install procedure. Look in path, if given." << std::endl <<
"-IMPORTSOUP Import SOUP packets during startup." << endl << "-IMPORTSOUP Import SOUP packets during startup." << std::endl <<
"-M Mute sounds. Disables all noises in GoldED+." << endl << "-M Mute sounds. Disables all noises in GoldED+." << std::endl <<
"-N Disable share-compatible file opens during startup." << endl << "-N Disable share-compatible file opens during startup." << std::endl <<
"-NOSCAN Temporarily disable area scan during startup." << endl << "-NOSCAN Temporarily disable area scan during startup." << std::endl <<
#if defined(GUTLOS_FUNCS) && !defined(__MSDOS__) #if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
"-P Increase program priority to run faster." << endl << "-P Increase program priority to run faster." << std::endl <<
#endif #endif
"-S<sortspec> Sorts all mail areas according to the sort specs." << endl << "-S<sortspec> Sorts all mail areas according to the sort specs." << std::endl <<
"-T<seconds> Set a timeout value. GoldED+ will auto-exit after timeout." << endl << "-T<seconds> Set a timeout value. GoldED+ will auto-exit after timeout." << std::endl <<
"-V or -VV Verbose or Very verbose (-VV) config compile. Use -VV to debug." << endl << "-V or -VV Verbose or Very verbose (-VV) config compile. Use -VV to debug." << std::endl <<
"-W Write a GOLDAREA.INC file with AREADEF's of all mail areas." << endl << "-W Write a GOLDAREA.INC file with AREADEF's of all mail areas." << std::endl <<
"-X, -Y, -Z Reserved for debugging purposes." << endl << "-X, -Y, -Z Reserved for debugging purposes." << std::endl <<
endl << std::endl <<
"Any non-option parameter is stuffed into the keyboard buffer." << endl; "Any non-option parameter is stuffed into the keyboard buffer." << std::endl;
exit(0); exit(0);
} }
@ -642,7 +642,7 @@ void Initialize(int argc, char* argv[]) {
InstallDetect(cmdlineinstpath); InstallDetect(cmdlineinstpath);
if(not fexist(CFG->goldcfg)) { if(not fexist(CFG->goldcfg)) {
cout << "*** Cannot start: " << CFG->goldcfg << " not found! ***" << endl; std::cout << "*** Cannot start: " << CFG->goldcfg << " not found! ***" << std::endl;
errorlevel = EXIT_NONAME; errorlevel = EXIT_NONAME;
exit(0); exit(0);
} }
@ -653,7 +653,7 @@ void Initialize(int argc, char* argv[]) {
// Call install finish procedure // Call install finish procedure
if(cmdlineinstall) { if(cmdlineinstall) {
if(InstallFinish()) { if(InstallFinish()) {
cout << "*** INSTALL NOT COMPLETED ***" << endl; std::cout << "*** INSTALL NOT COMPLETED ***" << std::endl;
remove(CFG->goldcfg); remove(CFG->goldcfg);
errorlevel = EXIT_NONAME; errorlevel = EXIT_NONAME;
exit(0); exit(0);
@ -704,12 +704,12 @@ void Initialize(int argc, char* argv[]) {
// Report detected multitasker // Report detected multitasker
if(not quiet) { if(not quiet) {
if(gmtsk.detected) if(gmtsk.detected)
cout << "* Running under " << gmtsk.name << "." << endl; std::cout << "* Running under " << gmtsk.name << "." << std::endl;
} }
if(cfgerrors) { if(cfgerrors) {
cout << "* Total CFG errors found: " << cfgerrors std::cout << "* Total CFG errors found: " << cfgerrors
<< ". Press almost any key to continue." << endl; << ". Press almost any key to continue." << std::endl;
kbclear(); kbclear();
waitkey(); waitkey();
} }
@ -998,7 +998,7 @@ void Initialize(int argc, char* argv[]) {
WideSharemode = CFG->sharemode; WideSharemode = CFG->sharemode;
WideUsernames = CFG->username.size(); WideUsernames = CFG->username.size();
WideUsername = new const char*[WideUsernames]; WideUsername = new const char*[WideUsernames];
vector<Node>::iterator i; std::vector<Node>::iterator i;
int w; int w;
for(w = 0, i = CFG->username.begin(); w < WideUsernames; w++, i++) for(w = 0, i = CFG->username.begin(); w < WideUsernames; w++, i++)
WideUsername[w] = i->name; WideUsername[w] = i->name;

View File

@ -2743,7 +2743,7 @@ int LoadCharset(const char* imp, const char* exp, int query) {
} }
// Find and load charset table // Find and load charset table
vector<Map>::iterator xlt; std::vector<Map>::iterator xlt;
for(n = 0, xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++, n++) { for(n = 0, xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++, n++) {
if(striinc(xlt->imp, imp) and striinc(xlt->exp, exp)) { if(striinc(xlt->imp, imp) and striinc(xlt->exp, exp)) {
// Already loaded? // Already loaded?

View File

@ -772,7 +772,7 @@ int ChangeUsername() {
if(not CFG->username.empty()) { if(not CFG->username.empty()) {
Listi = (char**)throw_calloc(CFG->username.size()+1, sizeof(char*)); Listi = (char**)throw_calloc(CFG->username.size()+1, sizeof(char*));
vector<Node>::iterator i; std::vector<Node>::iterator i;
for(n = 0, i = CFG->username.begin(); i != CFG->username.end(); n++, i++) { for(n = 0, i = CFG->username.begin(); i != CFG->username.end(); n++, i++) {
i->addr.make_string(adrs); i->addr.make_string(adrs);
sprintf(buf, " %-35s %s ", i->name, adrs); sprintf(buf, " %-35s %s ", i->name, adrs);
@ -786,7 +786,7 @@ int ChangeUsername() {
if(n != -1) { if(n != -1) {
CFG->usernameno = n; CFG->usernameno = n;
AA->SetUsername(CFG->username[n]); AA->SetUsername(CFG->username[n]);
for(vector<gaka>::iterator a = CFG->aka.begin(); a != CFG->aka.end(); a++) { for(std::vector<gaka>::iterator a = CFG->aka.begin(); a != CFG->aka.end(); a++) {
if(AA->Username().addr.match(a->addr)) { if(AA->Username().addr.match(a->addr)) {
AA->SetAka(a->addr); AA->SetAka(a->addr);
break; break;
@ -818,7 +818,7 @@ int ChangeTemplate() {
if(not CFG->tpl.empty()) { if(not CFG->tpl.empty()) {
Listi = (char**)throw_calloc(CFG->tpl.size()+1, sizeof(char*)); Listi = (char**)throw_calloc(CFG->tpl.size()+1, sizeof(char*));
vector<Tpl>::iterator t; std::vector<Tpl>::iterator t;
for(n = 0, t = CFG->tpl.begin(); t != CFG->tpl.end(); n++, t++) { for(n = 0, t = CFG->tpl.begin(); t != CFG->tpl.end(); n++, t++) {
t->match.make_string(adrs); t->match.make_string(adrs);
sprintf(buf, " %-45s %s ", t->name, adrs); sprintf(buf, " %-45s %s ", t->name, adrs);
@ -852,7 +852,7 @@ int ChangeTemplate() {
int ChangeAka() { int ChangeAka() {
int n; int n;
vector<gaka>::iterator i; std::vector<gaka>::iterator i;
int startat = 0; int startat = 0;
char** Listi; char** Listi;
char addr[100], buf[100]; char addr[100], buf[100];
@ -900,7 +900,7 @@ int ChangeXlatImport() {
if(not CFG->xlatcharset.empty()) { if(not CFG->xlatcharset.empty()) {
Listi = (char**)throw_calloc(CFG->xlatcharset.size()+2, sizeof(char*)); Listi = (char**)throw_calloc(CFG->xlatcharset.size()+2, sizeof(char*));
vector<Map>::iterator xlt; std::vector<Map>::iterator xlt;
for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) { for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) {
if(strieql(xlt->exp, CFG->xlatlocalset)) { if(strieql(xlt->exp, CFG->xlatlocalset)) {
maximport = MaxV(maximport, (int)strlen(xlt->imp)); maximport = MaxV(maximport, (int)strlen(xlt->imp));

View File

@ -168,7 +168,7 @@ void GMsgList::ReadMlst(int n) {
} }
ml->goldmark = goldmark; ml->goldmark = goldmark;
for(vector<Node>::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) { for(std::vector<Node>::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) {
if(strieql(msg.By(), x->name)) { if(strieql(msg.By(), x->name)) {
ml->high |= MLST_HIGH_FROM; ml->high |= MLST_HIGH_FROM;
msg.attr.fmu1(); msg.attr.fmu1();
@ -625,7 +625,7 @@ private:
gwindow window; gwindow window;
GMsg msg; GMsg msg;
vector<ThreadEntry> list; std::vector<ThreadEntry> list;
ThreadEntry t; ThreadEntry t;
uint h_offset; uint h_offset;
@ -856,7 +856,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
int attr = attrw; int attr = attrw;
for(vector<Node>::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) for(std::vector<Node>::iterator x = CFG->username.begin(); x != CFG->username.end(); x++)
if(strieql(msg.By(), x->name)) { if(strieql(msg.By(), x->name)) {
attr = attrh; attr = attrh;
break; break;

View File

@ -853,7 +853,7 @@ void Lookup(GMsg* msg, Addr* addr, char* name, int topline, char* status) {
strcpy(tmpname, name); strcpy(tmpname, name);
if(not CFG->addressmacro.empty()) { if(not CFG->addressmacro.empty()) {
vector<AddrMacro>::iterator n; std::vector<AddrMacro>::iterator n;
ptr = name; ptr = name;
strcpy(buf, ptr); strcpy(buf, ptr);
for(n=CFG->addressmacro.begin(); n != CFG->addressmacro.end(); n++) { for(n=CFG->addressmacro.begin(); n != CFG->addressmacro.end(); n++) {

View File

@ -87,18 +87,18 @@ 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
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) if(not quiet)
cout << "* Soundcard support was successfully initialized." << endl; std::cout << "* Soundcard support was successfully initialized." << std::endl;
atexit(ResetSound); atexit(ResetSound);
} }
else { else {
if(not quiet) if(not quiet)
cout << "* Soundcard support could NOT be initialized!" << endl; std::cout << "* Soundcard support could NOT be initialized!" << std::endl;
ResetSound(); ResetSound();
} }
break; break;
@ -179,7 +179,7 @@ int HandleGEvent(uint event) {
} }
if(CFG) { if(CFG) {
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(event == n->type) { if(event == n->type) {
switch(n->command) { switch(n->command) {

View File

@ -29,17 +29,17 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
vector<int> post_xparea; std::vector<int> post_xparea;
uint position; uint position;
ulong msgcount = 0; ulong msgcount = 0;
// ------------------------------------------------------------------ // ------------------------------------------------------------------
string &strtrimline(string &p) { std::string &strtrimline(std::string &p) {
if(not p.empty()) { if(not p.empty()) {
string::iterator trail = p.end(); std::string::iterator trail = p.end();
while(trail != p.begin()) { while(trail != p.begin()) {
--trail; --trail;
if(not strchr(" \t\r\n", *trail) and not issoftcr(*trail)) { if(not strchr(" \t\r\n", *trail) and not issoftcr(*trail)) {
@ -231,7 +231,7 @@ static bool have_origin(GMsg *msg) {
static void MakeMsg3(int& mode, GMsg* msg) { static void MakeMsg3(int& mode, GMsg* msg) {
int n; int n;
vector<gaka>::iterator u; std::vector<gaka>::iterator u;
msg->charsetlevel = 0; msg->charsetlevel = 0;
if(*AA->Xlatexport()) { if(*AA->Xlatexport()) {
@ -265,7 +265,7 @@ static void MakeMsg3(int& mode, GMsg* msg) {
msg->oorig = msg->orig; msg->oorig = msg->orig;
if(AA->isnet() and msg->orig.point) { if(AA->isnet() and msg->orig.point) {
for(u = CFG->aka.begin(); u != CFG->aka.end(); u++) { for(u = CFG->aka.begin(); u != CFG->aka.end(); u++) {
if(not memcmp(u, &msg->orig, sizeof(Addr))) { if(not memcmp(&(*u), &msg->orig, sizeof(Addr))) {
// Use fakenet to everybody // Use fakenet to everybody
if(u->pointnet) { if(u->pointnet) {
msg->oorig.net = u->pointnet; // Create fake address msg->oorig.net = u->pointnet; // Create fake address
@ -280,7 +280,7 @@ static void MakeMsg3(int& mode, GMsg* msg) {
DoKludges(mode, msg); DoKludges(mode, msg);
if(cc) { if(cc) {
string temp; std::string temp;
update_statuslinef(LNG->StatusCC, msg->to, msg->dest.make_string(temp).c_str()); update_statuslinef(LNG->StatusCC, msg->to, msg->dest.make_string(temp).c_str());
} }
@ -369,7 +369,7 @@ static void MakeMsg3(int& mode, GMsg* msg) {
cmsg->references = msg->references; cmsg->references = msg->references;
AA->NewMsgno(cmsg); AA->NewMsgno(cmsg);
{ {
string temp; std::string temp;
update_statuslinef(LNG->StatusCC, cmsg->to, cmsg->dest.make_string(temp).c_str()); update_statuslinef(LNG->StatusCC, cmsg->to, cmsg->dest.make_string(temp).c_str());
} }
@ -383,7 +383,7 @@ static void MakeMsg3(int& mode, GMsg* msg) {
cmsg->oorig = cmsg->orig; cmsg->oorig = cmsg->orig;
if(AA->isnet() and cmsg->orig.point) { if(AA->isnet() and cmsg->orig.point) {
for(u = CFG->aka.begin(); u != CFG->aka.end(); u++) { for(u = CFG->aka.begin(); u != CFG->aka.end(); u++) {
if(not memcmp(u, &cmsg->orig, sizeof(Addr))) { if(not memcmp(&(*u), &cmsg->orig, sizeof(Addr))) {
// Use fakenet to everybody // Use fakenet to everybody
if(u->pointnet) { if(u->pointnet) {
cmsg->oorig.net = u->pointnet; // Create fake address cmsg->oorig.net = u->pointnet; // Create fake address
@ -482,7 +482,7 @@ static void MakeMsg2(int& mode, int& status, int& forwstat, int& topline, GMsg*
if(status == MODE_CHANGE or (mode == MODE_FORWARD and status == MODE_SAVE)) { if(status == MODE_CHANGE or (mode == MODE_FORWARD and status == MODE_SAVE)) {
if(mode == MODE_CHANGE) { if(mode == MODE_CHANGE) {
if(stricmp(msg->By(), AA->Username().name)) { if(stricmp(msg->By(), AA->Username().name)) {
vector<Node>::iterator x; std::vector<Node>::iterator x;
for(n = 0, x = CFG->username.begin(); x != CFG->username.end(); n++, x++) { for(n = 0, x = CFG->username.begin(); x != CFG->username.end(); n++, x++) {
if(strieql(x->name, msg->By())) { if(strieql(x->name, msg->By())) {
n = 0; n = 0;

View File

@ -220,7 +220,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int origarea);
void Rot13(GMsg* msg); void Rot13(GMsg* msg);
void ResetMsg(GMsg* msg); void ResetMsg(GMsg* msg);
int DoCarboncopy(GMsg* msg, GMsg** carbon); int DoCarboncopy(GMsg* msg, GMsg** carbon);
void DoCrosspost(GMsg* msg, vector<int> &postareas); void DoCrosspost(GMsg* msg, std::vector<int> &postareas);
char* ParseInternetAddr(char* __string, char* __name, char* __addr); char* ParseInternetAddr(char* __string, char* __name, char* __addr);
@ -392,7 +392,7 @@ void maketitle();
void ProgMeter(int mode, int xx, int yy, long len, long barlen, int attr, long pos, long size); void ProgMeter(int mode, int xx, int yy, long len, long barlen, int attr, long pos, long size);
int ReadCfg(const char* cfg, int ignoreunknown=false); int ReadCfg(const char* cfg, int ignoreunknown=false);
void ScanMsgTxtForAddr(GMsg* msg); void ScanMsgTxtForAddr(GMsg* msg);
gkey SearchKey(gkey key, list<CmdKey>::iterator keys, int totkeys); gkey SearchKey(gkey key, std::list<CmdKey>::iterator keys, int totkeys);
int SearchTaglist(Echo* taglist, char* tag); int SearchTaglist(Echo* taglist, char* tag);
void set_title(const char* t, int p, int a); void set_title(const char* t, int p, int a);
void title_shadow(); void title_shadow();

View File

@ -388,7 +388,7 @@ void Area::RandomizeData(int mode) {
CFG->grp.GetItm(GRP_XLATIMPORT, adat->xlatimport, sizeof(adat->xlatimport)); CFG->grp.GetItm(GRP_XLATIMPORT, adat->xlatimport, sizeof(adat->xlatimport));
} }
vector<MailList>::iterator z; std::vector<MailList>::iterator z;
for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++) for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++)
if(strieql(echoid(), z->echoid)) { if(strieql(echoid(), z->echoid)) {
strcpy(adat->whoto, *z->contribution ? z->contribution : z->sender); strcpy(adat->whoto, *z->contribution ? z->contribution : z->sender);

View File

@ -815,7 +815,7 @@ int MsgIsTwit(GMsg* msg, bool& istwitto, bool& istwitsubj) {
istwitto = istwitsubj = false; istwitto = istwitsubj = false;
// Check for twit names // Check for twit names
vector<Node>::iterator tn; std::vector<Node>::iterator tn;
for(tn = CFG->twitname.begin(); tn != CFG->twitname.end(); tn++) { for(tn = CFG->twitname.begin(); tn != CFG->twitname.end(); tn++) {
if(msg->orig.match(tn->addr)) { if(msg->orig.match(tn->addr)) {
if(*tn->name == NUL or strwild(msg->By(), tn->name)) { if(*tn->name == NUL or strwild(msg->By(), tn->name)) {
@ -875,14 +875,14 @@ int LoadMessage(GMsg* msg, int margin) {
// Mark message as received, if it is for us // Mark message as received, if it is for us
if(msg->msgno and not AA->attr().hex()) { if(msg->msgno and not AA->attr().hex()) {
for(vector<Node>::iterator n = CFG->username.begin(); n != CFG->username.end(); n++) { for(std::vector<Node>::iterator n = CFG->username.begin(); n != CFG->username.end(); n++) {
// Check TO: // Check TO:
if(msg->dest.match(n->addr)) { if(msg->dest.match(n->addr)) {
if(strieql(n->name, msg->To())) { if(strieql(n->name, msg->To())) {
if(n->addr.net != GFTN_ALL or msg->dest.net == 0 or not AA->isnet()) if(n->addr.net != GFTN_ALL or msg->dest.net == 0 or not AA->isnet())
msg->attr.tou1(); // Set highlight mark msg->attr.tou1(); // Set highlight mark
else { else {
for(vector<gaka>::iterator x = CFG->aka.begin(); x != CFG->aka.end(); x++) { for(std::vector<gaka>::iterator x = CFG->aka.begin(); x != CFG->aka.end(); x++) {
if(msg->dest.match(x->addr)) { if(msg->dest.match(x->addr)) {
msg->attr.tou1(); // Set highlight mark msg->attr.tou1(); // Set highlight mark
break; break;
@ -898,7 +898,7 @@ int LoadMessage(GMsg* msg, int margin) {
if(n->addr.net != GFTN_ALL or msg->orig.net == 0 or not AA->isnet()) if(n->addr.net != GFTN_ALL or msg->orig.net == 0 or not AA->isnet())
msg->attr.fmu1(); // Set highlight mark msg->attr.fmu1(); // Set highlight mark
else { else {
for(vector<gaka>::iterator x = CFG->aka.begin(); x != CFG->aka.end(); x++) { for(std::vector<gaka>::iterator x = CFG->aka.begin(); x != CFG->aka.end(); x++) {
if(msg->orig.match(x->addr)) { if(msg->orig.match(x->addr)) {
msg->attr.fmu1(); // Set highlight mark msg->attr.fmu1(); // Set highlight mark
break; break;

View File

@ -320,7 +320,7 @@ void GotoMsgno() {
gwindow iwindow(whandle()); gwindow iwindow(whandle());
string fbuf = buf; std::string fbuf = buf;
gwinput2 iform(iwindow); gwinput2 iform(iwindow);
iform.setup(C_HEADW, C_HEADW, C_HEADI, _box_table(W_BHEAD, 13), true); iform.setup(C_HEADW, C_HEADW, C_HEADI, _box_table(W_BHEAD, 13), true);
iform.add_field(0, wrow, 8, 5, fbuf, 20, gwinput::cvt_none, gwinput::entry_new); iform.add_field(0, wrow, 8, 5, fbuf, 20, gwinput::cvt_none, gwinput::entry_new);
@ -524,7 +524,7 @@ int ExternUtil(GMsg* msg, int utilno) {
strcpy(editorfile, AddPath(CFG->goldpath, EDIT->File())); strcpy(editorfile, AddPath(CFG->goldpath, EDIT->File()));
mktemp(strcpy(tmpfile, AddPath(CFG->goldpath, "GDXXXXXX"))); mktemp(strcpy(tmpfile, AddPath(CFG->goldpath, "GDXXXXXX")));
vector<ExtUtil>::iterator extutil = CFG->externutil.begin(); std::vector<ExtUtil>::iterator extutil = CFG->externutil.begin();
for(int utlno=0; extutil != CFG->externutil.end(); utlno++, extutil++) { for(int utlno=0; extutil != CFG->externutil.end(); utlno++, extutil++) {
@ -749,9 +749,9 @@ void make_pathreport(const char* reportfile) {
gfile fp; gfile fp;
fp.fopen(reportfile, "wt"); fp.fopen(reportfile, "wt");
if(fp) { if(fp) {
string path; std::string path;
ftn_addr address; ftn_addr address;
vector<ftn_addr> alist; std::vector<ftn_addr> alist;
GMsg* msg = (GMsg*)throw_calloc(1, sizeof(GMsg)); GMsg* msg = (GMsg*)throw_calloc(1, sizeof(GMsg));
w_progress(MODE_NEW, C_INFOW, 0, AA->Msgn.Count(), "Generating PATH report"); w_progress(MODE_NEW, C_INFOW, 0, AA->Msgn.Count(), "Generating PATH report");
for(int n=AA->Msgn.Count(); n>=AA->lastread(); n--) { for(int n=AA->Msgn.Count(); n>=AA->lastread(); n--) {
@ -769,7 +769,7 @@ void make_pathreport(const char* reportfile) {
INam buf; INam buf;
strcpy(buf, msg->By()); strcpy(buf, msg->By());
strchg(buf, ' ', '_'); strchg(buf, ' ', '_');
string temp; std::string temp;
fp.printf("%s %s ", buf, address.make_string(temp).c_str()); fp.printf("%s %s ", buf, address.make_string(temp).c_str());
path = ""; path = "";
Line* line = msg->lin; Line* line = msg->lin;

View File

@ -112,7 +112,7 @@ char* UnfoldLine(char* mptr) {
int CheckMailinglists(GMsg* msg, int current) { int CheckMailinglists(GMsg* msg, int current) {
if(AA->isemail()) { if(AA->isemail()) {
vector<MailList>::iterator z; std::vector<MailList>::iterator z;
for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++) for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++)
if(z->sender_is_pattern) { if(z->sender_is_pattern) {
golded_search_manager srchmgr; golded_search_manager srchmgr;
@ -134,7 +134,7 @@ int CheckMailinglists(GMsg* msg, int current) {
int CheckMailinglists(const char* what, int current) { int CheckMailinglists(const char* what, int current) {
if(AA->isemail()) { if(AA->isemail()) {
vector<MailList>::iterator z; std::vector<MailList>::iterator z;
for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++) for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++)
if(not z->sender_is_pattern and strieql(what, z->sender)) { if(not z->sender_is_pattern and strieql(what, z->sender)) {
int areano = AL.AreaEchoToNo(z->echoid); int areano = AL.AreaEchoToNo(z->echoid);

View File

@ -217,7 +217,7 @@ void golded_search_manager::prepare_from_string(const char* prompt, int what) {
bool golded_search_manager::search(GMsg* msg, bool quick, bool shortcircuit) { bool golded_search_manager::search(GMsg* msg, bool quick, bool shortcircuit) {
search_item* item = items.begin(); std::vector<search_item>::iterator item = items.begin();
bool exit = false; bool exit = false;
bool and_cycle = false; bool and_cycle = false;
bool or_cycle = false; bool or_cycle = false;
@ -533,7 +533,7 @@ void AdvancedSearch(GMsg*, int&, int&) {
iform.setup(idle_color, active_color, edit_color, _box_table(border_type, 13), true); iform.setup(idle_color, active_color, edit_color, _box_table(border_type, 13), true);
string buffers[9*3 + 6]; std::string buffers[9*3 + 6];
int i = 0; int i = 0;
for(int r=0; r<9; r++) { for(int r=0; r<9; r++) {

View File

@ -41,7 +41,7 @@ bool is_user(const char* name) {
if(strieql(name, AA->Username().name)) if(strieql(name, AA->Username().name))
return true; return true;
// We should check all misspells too // We should check all misspells too
for(vector<Node>:: iterator u = CFG->username.begin(); u != CFG->username.end(); u++) for(std::vector<Node>:: iterator u = CFG->username.begin(); u != CFG->username.end(); u++)
if(strieql(name, u->name)) if(strieql(name, u->name))
return true; return true;
return false; return false;
@ -183,7 +183,7 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
if(AA->Templatematch() and not (CFG->tplno or AA->isnewsgroup() or AA->isemail())) { if(AA->Templatematch() and not (CFG->tplno or AA->isnewsgroup() or AA->isemail())) {
if(not ((mode == MODE_NEW or mode == MODE_REPLYCOMMENT or mode == MODE_FORWARD) if(not ((mode == MODE_NEW or mode == MODE_REPLYCOMMENT or mode == MODE_FORWARD)
and (AA->isecho() or AA->islocal()))) { and (AA->isecho() or AA->islocal()))) {
vector<Tpl>::iterator tp; std::vector<Tpl>::iterator tp;
for(tp = CFG->tpl.begin(); tp != CFG->tpl.end(); tp++) for(tp = CFG->tpl.begin(); tp != CFG->tpl.end(); tp++)
if(tp->match.net and msg->dest.match(tp->match)) { if(tp->match.net and msg->dest.match(tp->match)) {
strcpy(tplfile, tp->file); strcpy(tplfile, tp->file);
@ -680,7 +680,7 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
} }
// Invalidate kludge chars // Invalidate kludge chars
string& tempref = strtrim(oldmsg->line[n]->txt); std::string& tempref = strtrim(oldmsg->line[n]->txt);
replace(tempref.begin(), tempref.end(), CTRL_A, '@'); replace(tempref.begin(), tempref.end(), CTRL_A, '@');
quote = tempref.c_str(); quote = tempref.c_str();
@ -848,14 +848,14 @@ void ChangeMsg() {
AA->LoadMsg(reader_msg, reader_msg->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); AA->LoadMsg(reader_msg, reader_msg->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
} }
for(vector<Node>:: iterator u = CFG->username.begin(); u != CFG->username.end(); u++) for(std::vector<Node>:: iterator u = CFG->username.begin(); u != CFG->username.end(); u++)
// Check FROM: // Check FROM:
if(reader_msg->orig.match(u->addr)) { if(reader_msg->orig.match(u->addr)) {
if(strieql(u->name, reader_msg->By())) { if(strieql(u->name, reader_msg->By())) {
if(u->addr.net != GFTN_ALL or reader_msg->orig.net == 0 or not AA->isnet()) if(u->addr.net != GFTN_ALL or reader_msg->orig.net == 0 or not AA->isnet())
reader_keyok = NO; reader_keyok = NO;
else { else {
for(vector<gaka>::iterator x = CFG->aka.begin(); x != CFG->aka.end(); x++) { for(std::vector<gaka>::iterator x = CFG->aka.begin(); x != CFG->aka.end(); x++) {
if(reader_msg->orig.match(x->addr)) { if(reader_msg->orig.match(x->addr)) {
reader_keyok = NO; reader_keyok = NO;
break; break;

View File

@ -392,7 +392,7 @@ bool guserbase::edit_entry(uint idx) {
bool guserbase::find_entry(char* name, bool lookup) { bool guserbase::find_entry(char* name, bool lookup) {
if(not strblank(name)) { if(not strblank(name)) {
string tmpaddr; std::string tmpaddr;
gusrbaseentry old_entry = entry; gusrbaseentry old_entry = entry;
uint old_index = index; uint old_index = index;
@ -757,7 +757,7 @@ void guserbase::update_addressbook(GMsg* msg, bool reverse, bool force) {
// 5. It's the mailinglist's sender address // 5. It's the mailinglist's sender address
if(AA->isemail()) { if(AA->isemail()) {
vector<MailList>::iterator z; std::vector<MailList>::iterator z;
for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++) for(z = CFG->mailinglist.begin(); z != CFG->mailinglist.end(); z++)
if(strieql(z->sender, name) or strieql(z->sender, iaddr)) if(strieql(z->sender, name) or strieql(z->sender, iaddr))
return; return;

View File

@ -85,23 +85,23 @@ class guserbase;
class addressbook_form : public gwinput2 { class addressbook_form : public gwinput2 {
string macro; std::string macro;
string name; std::string name;
string fidoaddr; std::string fidoaddr;
string iaddr; std::string iaddr;
string pseudo; std::string pseudo;
string organisation; std::string organisation;
string snail1; std::string snail1;
string snail2; std::string snail2;
string snail3; std::string snail3;
string dataphone; std::string dataphone;
string voicephone; std::string voicephone;
string faxphone; std::string faxphone;
string homepage; std::string homepage;
string group; std::string group;
string comment1; std::string comment1;
string comment2; std::string comment2;
string comment3; std::string comment3;
bool validate(); bool validate();
void before(); void before();

View File

@ -452,9 +452,9 @@ static int KeyCmp(const gkey* a, const gkey* b) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
gkey SearchKey(gkey key, list<CmdKey>::iterator keys, int totkeys) { gkey SearchKey(gkey key, std::list<CmdKey>::iterator keys, int totkeys) {
list<CmdKey>::iterator kmin; std::list<CmdKey>::iterator kmin;
int again = 0; int again = 0;
do { do {

View File

@ -41,7 +41,7 @@ int edit_string(char* buf, int buf_size, char* title, int helpcat) {
gwinput2 iform(window); gwinput2 iform(window);
string buf2 = buf; std::string buf2 = buf;
iform.setup(C_ASKW, C_ASKW, C_ASKQ, _box_table(W_BASK, 13), true); iform.setup(C_ASKW, C_ASKW, C_ASKQ, _box_table(W_BASK, 13), true);
iform.add_field(0, 0, 1, 59, buf2, buf_size, gwinput::cvt_none, fieldupd); iform.add_field(0, 0, 1, 59, buf2, buf_size, gwinput::cvt_none, fieldupd);
vcurshow(); vcurshow();
@ -68,7 +68,7 @@ bool edit_pathname(char* buf, int buf_size, char* title, int helpcat) {
if(not edit_string(buf, buf_size, title, helpcat)) if(not edit_string(buf, buf_size, title, helpcat))
return false; return false;
vector<FileAlias>::iterator z; std::vector<FileAlias>::iterator z;
for(z = CFG->filealias.begin(); z != CFG->filealias.end(); z++) { for(z = CFG->filealias.begin(); z != CFG->filealias.end(); z++) {
if(strieql(buf, z->alias)) { if(strieql(buf, z->alias)) {
strcpy(buf, z->file); strcpy(buf, z->file);
@ -191,8 +191,9 @@ int AkaMatchOne(const ftn_addr* mask, const ftn_addr* addr) {
int AkaMatch(ftn_addr* match, const ftn_addr* addr) { int AkaMatch(ftn_addr* match, const ftn_addr* addr) {
int aka; int aka;
std::vector<AkaMatchG>::iterator am;
for(vector<AkaMatchG>::iterator am = CFG->akamatch.begin(), aka=0; am != CFG->akamatch.end(); am++, aka++) { for(am = CFG->akamatch.begin(), aka=0; am != CFG->akamatch.end(); am++, aka++) {
if(addr->match(am->mask)) { if(addr->match(am->mask)) {
int akano = GetAkaNo(am->aka); int akano = GetAkaNo(am->aka);
if(akano != -1) { if(akano != -1) {
@ -205,7 +206,7 @@ int AkaMatch(ftn_addr* match, const ftn_addr* addr) {
int bestaka = -1; int bestaka = -1;
int bestmatch = 0; int bestmatch = 0;
int matchaka = 0; int matchaka = 0;
vector<gaka>::iterator a; std::vector<gaka>::iterator a;
for(a = CFG->aka.begin(), aka = 0; a != CFG->aka.end(); aka++, a++) { for(a = CFG->aka.begin(), aka = 0; a != CFG->aka.end(); aka++, a++) {

View File

@ -114,15 +114,15 @@ class GAreaListScan {
private: private:
vector< pair<string, string> > container; std::vector< std::pair<std::string, std::string> > container;
vector< pair<string, string> >::iterator currposn; std::vector< std::pair<std::string, std::string> >::iterator currposn;
public: public:
inline GAreaListScan() { currposn = container.end(); } inline GAreaListScan() { currposn = container.end(); }
inline ~GAreaListScan() {} inline ~GAreaListScan() {}
inline void Add(pair<string, string> p) { container.push_back(p); currposn = container.end(); } inline void Add(std::pair<std::string, std::string> p) { container.push_back(p); currposn = container.end(); }
inline void Reset() { container.clear(); currposn = container.end(); } inline void Reset() { container.clear(); currposn = container.end(); }
@ -167,7 +167,7 @@ struct ggoldlast {
class Area; class Area;
typedef vector<Area *>::iterator area_iterator; typedef std::vector<Area *>::iterator area_iterator;
class AreaList { class AreaList {
@ -182,7 +182,7 @@ private:
public: public:
// Index of areas in the list // Index of areas in the list
vector<Area *> idx; std::vector<Area *> idx;
// Area pointer // Area pointer
area_iterator item; area_iterator item;

View File

@ -74,7 +74,7 @@ gposixdir::~gposixdir()
void gposixdir::cd(const char *name, bool relative) void gposixdir::cd(const char *name, bool relative)
{ {
string ndirname; std::string ndirname;
if(!*name) if(!*name)
name = "."; name = ".";
if(relative) { if(relative) {
@ -115,7 +115,7 @@ const gdirentry *gposixdir::nextentry(const char *mask, bool nameonly)
} }
ret.name = entries[last_entry]; ret.name = entries[last_entry];
ret.dirname = dirname.c_str(); ret.dirname = dirname.c_str();
string pn = ret.dirname; std::string pn = ret.dirname;
pn += "/"; pn += "/";
pn += ret.name; pn += ret.name;
size_t skipfrom; size_t skipfrom;

View File

@ -39,7 +39,7 @@
class gdirentry { class gdirentry {
public: public:
string name; std::string name;
struct stat stat_info; struct stat stat_info;
const char *dirname; const char *dirname;
gdirentry(); gdirentry();
@ -54,7 +54,7 @@ public:
class gposixdir { class gposixdir {
private: private:
string dirname; std::string dirname;
gdirentry ret; gdirentry ret;
gstrarray entries; gstrarray entries;
unsigned long last_entry; unsigned long last_entry;

View File

@ -66,8 +66,8 @@ public:
protected: protected:
vector<ops> ostk; std::vector<ops> ostk;
vector<int> vstk; std::vector<int> vstk;
ops pop_operator(); ops pop_operator();
int pop_value(); int pop_value();
@ -81,14 +81,14 @@ public:
void push_operator(ops o); void push_operator(ops o);
int evaluate_op(ops o, int y, int x); int evaluate_op(ops o, int y, int x);
int evaluate_ops(ops* o, int* y, int* x); int evaluate_ops(std::vector<ops>::iterator o, std::vector<int>::iterator y, std::vector<int>::iterator x);
}; };
// ------------------------------------------------------------------ // ------------------------------------------------------------------
inline int geval::evaluate_ops(ops* o, int* y, int* x) { inline int geval::evaluate_ops(std::vector<ops>::iterator o, std::vector<int>::iterator y, std::vector<int>::iterator x) {
return evaluate_op(*o, *y, *x); return evaluate_op(*o, *y, *x);
} }

View File

@ -26,6 +26,7 @@
#include <gdefs.h> #include <gdefs.h>
#include <geval.h> #include <geval.h>
#include <iterator>
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -50,8 +51,8 @@ int gevalhum::evaluate() {
while(ostk.size()) { while(ostk.size()) {
int* vptr = vstk.begin(); std::vector<int>::iterator vptr = vstk.begin();
ops* optr = ostk.begin(); std::vector<ops>::iterator optr = ostk.begin();
while(optr < ostk.end()) { while(optr < ostk.end()) {

View File

@ -254,7 +254,7 @@ int gfile::getftime(dword* __ftime) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
FILE* gfile::fopen(const string& __path, const char* __mode, int __shflag) { FILE* gfile::fopen(const std::string& __path, const char* __mode, int __shflag) {
return fopen(__path.c_str(), __mode, __shflag); return fopen(__path.c_str(), __mode, __shflag);
} }

View File

@ -119,7 +119,7 @@ public:
// ANSI-style streaming buffered I/O // ANSI-style streaming buffered I/O
FILE* fopen (const char* __path, const char* __mode, int __shflag=SH_DENYNO); FILE* fopen (const char* __path, const char* __mode, int __shflag=SH_DENYNO);
FILE* fopen (const string& __path, const char* __mode, int __shflag=SH_DENYNO); FILE* fopen (const std::string& __path, const char* __mode, int __shflag=SH_DENYNO);
FILE* fdopen (char* __mode); FILE* fdopen (char* __mode);
int fclose (); int fclose ();

View File

@ -129,38 +129,38 @@ struct Stamp {
#endif #endif
FILE* fsopen(const char* path, const char* type, int shflag); FILE* fsopen(const char* path, const char* type, int shflag);
inline FILE* fsopen(const string& path, const char* type, int shflag) { return fsopen(path.c_str(), type, shflag); } inline FILE* fsopen(const std::string& path, const char* type, int shflag) { return fsopen(path.c_str(), type, shflag); }
int is_dir(const char* path); int is_dir(const char* path);
inline int is_dir(const string& path) { return is_dir(path.c_str()); } inline int is_dir(const std::string& path) { return is_dir(path.c_str()); }
inline bool fexist(const char* filename) { return *filename ? ((access(filename, 0) == 0) and not is_dir(filename)) : false; } inline bool fexist(const char* filename) { return *filename ? ((access(filename, 0) == 0) and not is_dir(filename)) : false; }
inline bool fexist(const string& filename) { return fexist(filename.c_str()); } inline bool fexist(const std::string& filename) { return fexist(filename.c_str()); }
dword gfixstattime(time_t st_time); dword gfixstattime(time_t st_time);
dword GetFiletime(const char* file); dword GetFiletime(const char* file);
inline dword GetFiletime(const string& file) { return GetFiletime(file.c_str()); } inline dword GetFiletime(const std::string& file) { return GetFiletime(file.c_str()); }
inline long FiletimeCmp(const char* file1, const char* file2) { return long(GetFiletime(file1) - GetFiletime(file2)); } inline long FiletimeCmp(const char* file1, const char* file2) { return long(GetFiletime(file1) - GetFiletime(file2)); }
inline long FiletimeCmp(const string& file1, const string& file2) { return FiletimeCmp(file1.c_str(), file2.c_str()); } inline long FiletimeCmp(const std::string& file1, const std::string& file2) { return FiletimeCmp(file1.c_str(), file2.c_str()); }
long fsize(FILE* fp); long fsize(FILE* fp);
long GetFilesize(const char* file); long GetFilesize(const char* file);
const char* AddPath(const char* path, const char* file); const char* AddPath(const char* path, const char* file);
inline const char* AddPath(const string& path, const char* file) { return AddPath(path.c_str(), file); } inline const char* AddPath(const std::string& path, const char* file) { return AddPath(path.c_str(), file); }
inline const char* AddPath(const string& path, const string& file) { return AddPath(path.c_str(), file.c_str()); } inline const char* AddPath(const std::string& path, const std::string& file) { return AddPath(path.c_str(), file.c_str()); }
void MakePathname(char* pathname, const char* path, const char* name); void MakePathname(char* pathname, const char* path, const char* name);
void MakePathname(string& pathname, const string& path, const string& name); void MakePathname(std::string& pathname, const std::string& path, const std::string& name);
char* AddBackslash(char* p); char* AddBackslash(char* p);
string& AddBackslash(string& p); std::string& AddBackslash(std::string& p);
char* StripBackslash(char* p); char* StripBackslash(char* p);
char* PathCopy(char* dst, const char* src); char* PathCopy(char* dst, const char* src);
void PathCopy(string& dst, const char* src); void PathCopy(std::string& dst, const char* src);
void TouchFile(const char* __filename); void TouchFile(const char* __filename);
@ -170,7 +170,7 @@ void WipeFile(const char* file, int options);
const char* CleanFilename(const char* __file); const char* CleanFilename(const char* __file);
int strschg_environ(char* s); int strschg_environ(char* s);
int strschg_environ(string& s); int strschg_environ(std::string& s);
char* MapPath(char* map, bool reverse = false); char* MapPath(char* map, bool reverse = false);
inline char* ReMapPath(char* map) { return MapPath(map, true); }; inline char* ReMapPath(char* map) { return MapPath(map, true); };
@ -243,7 +243,7 @@ inline int chsize(int handle, long size) { return ftruncate(handle, size); }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
bool maketruepath(string &dirname); bool maketruepath(std::string &dirname);
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -385,7 +385,7 @@ int strschg_environ(char* s) {
if(*s == NUL) if(*s == NUL)
return 0; return 0;
string __s = s; std::string __s = s;
int rv = strschg_environ(__s); int rv = strschg_environ(__s);
if(rv) if(rv)
strxcpy(s, __s.c_str(), sizeof(Path)); strxcpy(s, __s.c_str(), sizeof(Path));

View File

@ -36,7 +36,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
string& AddBackslash(string& p) { std::string& AddBackslash(std::string& p) {
for(size_t posn = 0; (posn=p.find(GOLD_WRONG_SLASH_CHR, posn)) != p.npos; posn++) for(size_t posn = 0; (posn=p.find(GOLD_WRONG_SLASH_CHR, posn)) != p.npos; posn++)
p[posn] = GOLD_SLASH_CHR; p[posn] = GOLD_SLASH_CHR;
@ -50,7 +50,7 @@ string& AddBackslash(string& p) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Add path to filename, if no path is set // Add path to filename, if no path is set
void MakePathname(string& pathname, const string& path, const string& name) { void MakePathname(std::string& pathname, const std::string& path, const std::string& name) {
Path pn; Path pn;
MakePathname(pn, path.c_str(), name.c_str()); MakePathname(pn, path.c_str(), name.c_str());
@ -60,7 +60,7 @@ void MakePathname(string& pathname, const string& path, const string& name) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void PathCopy(string& dst, const char* src) { void PathCopy(std::string& dst, const char* src) {
dst = src; dst = src;
strschg_environ(dst); strschg_environ(dst);
@ -70,9 +70,9 @@ void PathCopy(string& dst, const char* src) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
int strschg_environ(string& s) { int strschg_environ(std::string& s) {
string fnd; std::string fnd;
int replaced = 0; int replaced = 0;
size_t posn, posn1; size_t posn, posn1;
@ -86,7 +86,7 @@ int strschg_environ(string& s) {
#ifndef __HAVE_DRIVES__ #ifndef __HAVE_DRIVES__
if(not s.empty() and (s[0] == '~')) { if(not s.empty() and (s[0] == '~')) {
string name; std::string name;
const char *p = s.c_str()+1; const char *p = s.c_str()+1;
if((s.length() != 1) and not isslash(*p)) { if((s.length() != 1) and not isslash(*p)) {
while(*p and not isslash(*p)) while(*p and not isslash(*p))
@ -95,7 +95,7 @@ int strschg_environ(string& s) {
name = getlogin(); name = getlogin();
struct passwd *pe = getpwnam(name.c_str()); struct passwd *pe = getpwnam(name.c_str());
if(pe != NULL) { if(pe != NULL) {
string dirname = pe->pw_dir; std::string dirname = pe->pw_dir;
dirname += "/"; dirname += "/";
if(isslash(*p)) if(isslash(*p))
++p; ++p;
@ -112,10 +112,10 @@ int strschg_environ(string& s) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
bool maketruepath(string &dirname) { bool maketruepath(std::string &dirname) {
bool ok = true; bool ok = true;
string ndirname; std::string ndirname;
char cwd[GMAXPATH]; char cwd[GMAXPATH];
getcwd(cwd, GMAXPATH); getcwd(cwd, GMAXPATH);
#ifdef __HAVE_DRIVES__ #ifdef __HAVE_DRIVES__

View File

@ -91,7 +91,7 @@ char* ftn_addr::reset(const char* str, char* dom, int domsizelimit) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void ftn_addr::reset(const string& str) { void ftn_addr::reset(const std::string& str) {
reset(str.c_str()); reset(str.c_str());
} }
@ -99,7 +99,7 @@ void ftn_addr::reset(const string& str) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void ftn_addr::reset(const string& str, string& dom, int domsizelimit) { void ftn_addr::reset(const std::string& str, std::string& dom, int domsizelimit) {
ftn_domain doms; ftn_domain doms;
reset(str.c_str(), doms, domsizelimit); reset(str.c_str(), doms, domsizelimit);
@ -129,7 +129,7 @@ static bool ftn_getaddrpart(word& part, const char* s) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
const char* ftn_addr::set(const string& str) { const char* ftn_addr::set(const std::string& str) {
return set(str.c_str()); return set(str.c_str());
} }
@ -137,7 +137,7 @@ const char* ftn_addr::set(const string& str) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
const char* ftn_addr::set(const string& str, string& dom, int domsizelimit) { const char* ftn_addr::set(const std::string& str, std::string& dom, int domsizelimit) {
ftn_domain doms; ftn_domain doms;
set(str.c_str(), doms, domsizelimit); set(str.c_str(), doms, domsizelimit);
@ -292,7 +292,7 @@ int ftn_addr::compare(const ftn_addr& other) const {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
string& ftn_addr::make_string(string& str) const { std::string& ftn_addr::make_string(std::string& str) const {
char buf[200]; char buf[200];
make_string(buf); make_string(buf);
@ -303,7 +303,7 @@ string& ftn_addr::make_string(string& str) const {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
string& ftn_addr::make_string(string& str, const string& dom, int domfmt) const { std::string& ftn_addr::make_string(std::string& str, const std::string& dom, int domfmt) const {
char buf[200]; char buf[200];
make_string(buf, dom.c_str(), domfmt); make_string(buf, dom.c_str(), domfmt);

View File

@ -80,7 +80,7 @@ public:
ftn_addr() : zone(0), net(0), node(0), point(0) {} ftn_addr() : zone(0), net(0), node(0), point(0) {}
ftn_addr(uint a); ftn_addr(uint a);
ftn_addr(const char* s); ftn_addr(const char* s);
ftn_addr(const string& s); ftn_addr(const std::string& s);
ftn_addr(const ftn_addr& a); ftn_addr(const ftn_addr& a);
ftn_addr(uint zn, uint nt, uint nd, uint pt); ftn_addr(uint zn, uint nt, uint nd, uint pt);
@ -94,21 +94,21 @@ public:
void set(const ftn_addr& a); void set(const ftn_addr& a);
void set(const void* a); void set(const void* a);
char* set(const char* str, char* dom=NULL, int domsizelimit=ftn::domain_limit); char* set(const char* str, char* dom=NULL, int domsizelimit=ftn::domain_limit);
const char* set(const string& str); const char* set(const std::string& str);
const char* set(const string& str, string& dom, int domsizelimit=ftn::domain_limit); const char* set(const std::string& str, std::string& dom, int domsizelimit=ftn::domain_limit);
void reset(); void reset();
void reset_fast(); void reset_fast();
void reset(const string& str); void reset(const std::string& str);
char* reset(const char* str, char* dom=NULL, int domsizelimit=ftn::domain_limit); char* reset(const char* str, char* dom=NULL, int domsizelimit=ftn::domain_limit);
void reset(const string& str, string& dom, int domsizelimit=ftn::domain_limit); void reset(const std::string& str, std::string& dom, int domsizelimit=ftn::domain_limit);
bool match(const ftn_addr& mask) const; bool match(const ftn_addr& mask) const;
bool equals(const ftn_addr& other) const; bool equals(const ftn_addr& other) const;
int compare(const ftn_addr& other) const; int compare(const ftn_addr& other) const;
string& make_string(string& str) const; std::string& make_string(std::string& str) const;
string& make_string(string& str, const string& dom, int domfmt=ftn::domain_last) const; std::string& make_string(std::string& str, const std::string& dom, int domfmt=ftn::domain_last) const;
char* make_string(char* str, const char* dom=NULL, int domfmt=ftn::domain_last) const; char* make_string(char* str, const char* dom=NULL, int domfmt=ftn::domain_last) const;
bool operator==(const ftn_addr& b) const; bool operator==(const ftn_addr& b) const;
@ -116,7 +116,7 @@ public:
ftn_addr& operator=(int n); ftn_addr& operator=(int n);
ftn_addr& operator=(const char* s); ftn_addr& operator=(const char* s);
ftn_addr& operator=(const string& s); ftn_addr& operator=(const std::string& s);
ftn_addr& operator=(const ftn_addr& a); ftn_addr& operator=(const ftn_addr& a);
}; };
@ -171,7 +171,7 @@ inline ftn_addr::ftn_addr(const char* s) : zone(0), net(0), node(0), point(0) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
inline ftn_addr::ftn_addr(const string& s) : zone(0), net(0), node(0), point(0) { inline ftn_addr::ftn_addr(const std::string& s) : zone(0), net(0), node(0), point(0) {
reset(s); reset(s);
} }
@ -219,7 +219,7 @@ inline bool ftn_addr::operator!=(const ftn_addr& b) const { return !equals(b); }
inline ftn_addr& ftn_addr::operator=(int n) { set_all(n); return *this; } inline ftn_addr& ftn_addr::operator=(int n) { set_all(n); return *this; }
inline ftn_addr& ftn_addr::operator=(const char* s) { reset(s); return *this; } inline ftn_addr& ftn_addr::operator=(const char* s) { reset(s); return *this; }
inline ftn_addr& ftn_addr::operator=(const string& s) { reset(s); return *this; } inline ftn_addr& ftn_addr::operator=(const std::string& s) { reset(s); return *this; }
inline ftn_addr& ftn_addr::operator=(const ftn_addr& a) { set_fast(a); return *this; } inline ftn_addr& ftn_addr::operator=(const ftn_addr& a) { set_fast(a); return *this; }

View File

@ -87,7 +87,7 @@ void ftn_attr::add(const ftn_attr& b) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Create string representation of an attribute set // Create string representation of an attribute set
string& ftn_attr::make_string(string& s) const { std::string& ftn_attr::make_string(std::string& s) const {
s = ""; s = "";
@ -138,7 +138,7 @@ string& ftn_attr::make_string(string& s) const {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void ftn_attr::get(const string& __s) { void ftn_attr::get(const std::string& __s) {
const char *s = __s.c_str(); const char *s = __s.c_str();
if(striinc("PVT", s)) pvt1(); if(striinc("PVT", s)) pvt1();

View File

@ -124,19 +124,19 @@ public:
ftn_attr() { reset(); } ftn_attr() { reset(); }
ftn_attr(const char* s) { get(s); } ftn_attr(const char* s) { get(s); }
ftn_attr(const string& s) { get(s); } ftn_attr(const std::string& s) { get(s); }
ftn_attr(const ftn_attr& o) { operator=(o); } ftn_attr(const ftn_attr& o) { operator=(o); }
void reset() { attr1 = attr2 = 0; } void reset() { attr1 = attr2 = 0; }
void add(const ftn_attr& b); void add(const ftn_attr& b);
void get(const string& s); void get(const std::string& s);
string& make_string(string& s) const; std::string& make_string(std::string& s) const;
bool equals(const ftn_attr& b) const; bool equals(const ftn_attr& b) const;
ftn_attr& operator=(const char* s) { get(s); return *this; } ftn_attr& operator=(const char* s) { get(s); return *this; }
ftn_attr& operator=(const string& s) { get(s); return *this; } ftn_attr& operator=(const std::string& s) { get(s); return *this; }
ftn_attr& operator=(const ftn_attr& o) { attr1=o.attr1; attr2=o.attr2; return *this; } ftn_attr& operator=(const ftn_attr& o) { attr1=o.attr1; attr2=o.attr2; return *this; }
bool operator==(const ftn_attr& b) const { return equals(b); } bool operator==(const ftn_attr& b) const { return equals(b); }
@ -485,7 +485,7 @@ typedef ftn_attr Attr;
inline void AttrAdd(Attr* a, Attr* b) { a->add(*b); } inline void AttrAdd(Attr* a, Attr* b) { a->add(*b); }
inline void GetAttribstr(Attr* attr, const char* attrs) { attr->get(attrs); } inline void GetAttribstr(Attr* attr, const char* attrs) { attr->get(attrs); }
inline char* MakeAttrStr(char* str, size_t maxlen, const Attr* attr) { string tmp; attr->make_string(tmp); strxcpy(str, tmp.c_str(), maxlen); return str; } inline char* MakeAttrStr(char* str, size_t maxlen, const Attr* attr) { std::string tmp; attr->make_string(tmp); strxcpy(str, tmp.c_str(), maxlen); return str; }
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -74,7 +74,7 @@ void gsearch::set_pattern(const char* a) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
bool gsearch::search(const string& str) { bool gsearch::search(const std::string& str) {
int discard_result; int discard_result;
return search(str, discard_result); return search(str, discard_result);
@ -83,7 +83,7 @@ bool gsearch::search(const string& str) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
bool gsearch::search(const string& str, int& result) { bool gsearch::search(const std::string& str, int& result) {
return search(str.c_str(), result); return search(str.c_str(), result);
} }

View File

@ -62,8 +62,8 @@ protected:
public: public:
// Configuration // Configuration
string id; std::string id;
string pattern; std::string pattern;
patterntype type; patterntype type;
bool case_sensitive; bool case_sensitive;
bool reverse; bool reverse;
@ -90,9 +90,9 @@ public:
// Search a string for the pattern. // Search a string for the pattern.
// Return true for success, false for failure. // Return true for success, false for failure.
bool search(const char* string); bool search(const char* string);
bool search(const string& str); bool search(const std::string& str);
bool search(const char* str, int& result); bool search(const char* str, int& result);
bool search(const string& str, int& result); bool search(const std::string& str, int& result);
gsearch& operator=(const gsearch& a); gsearch& operator=(const gsearch& a);

View File

@ -120,7 +120,7 @@ public:
areas_all areas_all
}; };
vector<search_item> items; std::vector<search_item> items;
search_direction direction; search_direction direction;
search_messages messages; search_messages messages;

View File

@ -37,7 +37,6 @@
#include <cstring> #include <cstring>
#include <gdefs.h> #include <gdefs.h>
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__EMX__) #if defined(__EMX__)
@ -70,7 +69,7 @@ char* strshr(char* str, int count);
char* strsrep(char* str, const char* search, const char* replace); char* strsrep(char* str, const char* search, const char* replace);
char* strltrim(char* str); char* strltrim(char* str);
char* strtrim(char* str); char* strtrim(char* str);
string& strtrim(string& p); std::string& strtrim(std::string& p);
char* struplow(char* str); char* struplow(char* str);
char* longdotstr(long num); // Convert a long to a dotted string: xxx.xxx.xxx.xxx char* longdotstr(long num); // Convert a long to a dotted string: xxx.xxx.xxx.xxx

View File

@ -39,7 +39,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
typedef vector<string> gstrarray; typedef std::vector<std::string> gstrarray;
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -451,10 +451,10 @@ char* strtrim(char* p) {
} }
string& strtrim(string& p) { std::string& strtrim(std::string& p) {
if(not p.empty()) { if(not p.empty()) {
string::iterator trail = p.end(); std::string::iterator trail = p.end();
while(trail != p.begin() and *(--trail) < '!') {} while(trail != p.begin() and *(--trail) < '!') {}
if(*trail > ' ') trail++; if(*trail > ' ') trail++;
p.erase(trail, p.end()); p.erase(trail, p.end());

View File

@ -35,6 +35,7 @@
#include <cstddef> #include <cstddef>
#include <gdefs.h> #include <gdefs.h>
#ifdef __UNIX__ #ifdef __UNIX__
#include <unistd.h>
#include <sys/times.h> #include <sys/times.h>
#endif #endif
#ifdef __OS2__ #ifdef __OS2__
@ -129,7 +130,7 @@ inline void usleep(long duration) { Sleep(duration); }
#endif #endif
#ifdef __UNIX__ #ifdef __UNIX__
inline Clock gclock() { struct tms z; return Clock(times(&z)*10/CLK_TCK); } inline Clock gclock() { struct tms z; return Clock(times(&z)*10/sysconf(_SC_CLK_TCK)); }
#else #else
inline Clock gclock() { return Clock(clock()*10/CLK_TCK); } inline Clock gclock() { return Clock(clock()*10/CLK_TCK); }
#endif #endif

View File

@ -50,7 +50,7 @@ Grp::Grp() {
Grp::~Grp() { Grp::~Grp() {
multimap<int, grp_stock>::iterator i; std::multimap<int, grp_stock>::iterator i;
for(currgrp = container.begin(); currgrp != container.end(); currgrp++) for(currgrp = container.begin(); currgrp != container.end(); currgrp++)
for(i = currgrp->second.begin(); i != currgrp->second.end(); i++) { for(i = currgrp->second.begin(); i != currgrp->second.end(); i++) {
if(i->second.type == TYPE_OBJECT) if(i->second.type == TYPE_OBJECT)
@ -66,10 +66,10 @@ Grp::~Grp() {
void Grp::AddGrp(const char* id) { void Grp::AddGrp(const char* id) {
string sid(id); std::string sid(id);
multimap<int, grp_stock> m; std::multimap<int, grp_stock> m;
m.insert(pair<int, grp_stock>(GRP_MEMBER, sid)); m.insert(std::pair<int, grp_stock>(GRP_MEMBER, sid));
container.push_back(pair<string, multimap<int, grp_stock> >(sid, m)); container.push_back(std::pair<std::string, std::multimap<int, grp_stock> >(sid, m));
currgrp = container.end()-1; currgrp = container.end()-1;
currgrpno = container.size()-1; currgrpno = container.size()-1;
} }
@ -80,7 +80,7 @@ void Grp::AddGrp(const char* id) {
void Grp::AddMbr(const char* id) { void Grp::AddMbr(const char* id) {
currgrp->second.insert(pair<int, grp_stock>(GRP_MEMBER, string(id))); currgrp->second.insert(std::pair<int, grp_stock>(GRP_MEMBER, std::string(id)));
} }
@ -88,7 +88,7 @@ void Grp::AddMbr(const char* id) {
const char* Grp::SetGrp(const char* id) { const char* Grp::SetGrp(const char* id) {
multimap<int, grp_stock>::iterator i; std::multimap<int, grp_stock>::iterator i;
for(currgrp = container.begin(), currgrpno = 0; currgrp != container.end(); currgrp++, currgrpno++) for(currgrp = container.begin(), currgrpno = 0; currgrp != container.end(); currgrp++, currgrpno++)
for(i = currgrp->second.find(GRP_MEMBER); (i != currgrp->second.end()) and (i->first == GRP_MEMBER); i++) for(i = currgrp->second.find(GRP_MEMBER); (i != currgrp->second.end()) and (i->first == GRP_MEMBER); i++)
if(strwild(id, i->second.data.string_item->c_str())) if(strwild(id, i->second.data.string_item->c_str()))
@ -102,7 +102,7 @@ const char* Grp::SetGrp(const char* id) {
void Grp::AddItm(int __type, bool __data) { void Grp::AddItm(int __type, bool __data) {
currgrp->second.insert(pair<int, grp_stock>(__type, __data)); currgrp->second.insert(std::pair<int, grp_stock>(__type, __data));
} }
@ -110,7 +110,7 @@ void Grp::AddItm(int __type, bool __data) {
void Grp::AddItm(int __type, char __data) { void Grp::AddItm(int __type, char __data) {
currgrp->second.insert(pair<int, grp_stock>(__type, __data)); currgrp->second.insert(std::pair<int, grp_stock>(__type, __data));
} }
@ -118,15 +118,15 @@ void Grp::AddItm(int __type, char __data) {
void Grp::AddItm(int __type, int __data) { void Grp::AddItm(int __type, int __data) {
currgrp->second.insert(pair<int, grp_stock>(__type, __data)); currgrp->second.insert(std::pair<int, grp_stock>(__type, __data));
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void Grp::AddItm(int __type, const string& __data) { void Grp::AddItm(int __type, const std::string& __data) {
currgrp->second.insert(pair<int, grp_stock>(__type, __data)); currgrp->second.insert(std::pair<int, grp_stock>(__type, __data));
} }
@ -137,7 +137,7 @@ void Grp::AddItm(int __type, void* __data, int __size) {
void *data = throw_malloc(__size+sizeof(int)); void *data = throw_malloc(__size+sizeof(int));
*((int *)data) = __size; *((int *)data) = __size;
memcpy((char *)data+sizeof(int), __data, __size); memcpy((char *)data+sizeof(int), __data, __size);
currgrp->second.insert(pair<int, grp_stock>(__type, data)); currgrp->second.insert(std::pair<int, grp_stock>(__type, data));
} }
@ -155,7 +155,7 @@ int Grp::GetItm(int __type, bool& __data, int __no) {
if(rv) { if(rv) {
if((__no >= rv) or (__no == -1)) if((__no >= rv) or (__no == -1))
__no = rand() % rv; __no = rand() % rv;
multimap<int, grp_stock>::iterator i = currgrp->second.find(__type); std::multimap<int, grp_stock>::iterator i = currgrp->second.find(__type);
while(__no--) i++; while(__no--) i++;
__data = i->second.data.bool_item; __data = i->second.data.bool_item;
} }
@ -179,7 +179,7 @@ int Grp::GetItm(int __type, char& __data, int __no) {
if(rv) { if(rv) {
if((__no >= rv) or (__no == -1)) if((__no >= rv) or (__no == -1))
__no = rand() % rv; __no = rand() % rv;
multimap<int, grp_stock>::iterator i = currgrp->second.find(__type); std::multimap<int, grp_stock>::iterator i = currgrp->second.find(__type);
while(__no--) i++; while(__no--) i++;
__data = i->second.data.char_item; __data = i->second.data.char_item;
} }
@ -203,7 +203,7 @@ int Grp::GetItm(int __type, int& __data, int __no) {
if(rv) { if(rv) {
if((__no >= rv) or (__no == -1)) if((__no >= rv) or (__no == -1))
__no = rand() % rv; __no = rand() % rv;
multimap<int, grp_stock>::iterator i = currgrp->second.find(__type); std::multimap<int, grp_stock>::iterator i = currgrp->second.find(__type);
while(__no--) i++; while(__no--) i++;
__data = i->second.data.int_item; __data = i->second.data.int_item;
} }
@ -215,7 +215,7 @@ int Grp::GetItm(int __type, int& __data, int __no) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
int Grp::GetItm(int __type, string& __data, int __no) { int Grp::GetItm(int __type, std::string& __data, int __no) {
// Return error if a current group is not set // Return error if a current group is not set
if(currgrpno == -1) if(currgrpno == -1)
@ -227,7 +227,7 @@ int Grp::GetItm(int __type, string& __data, int __no) {
if(rv) { if(rv) {
if((__no >= rv) or (__no == -1)) if((__no >= rv) or (__no == -1))
__no = rand() % rv; __no = rand() % rv;
multimap<int, grp_stock>::iterator i = currgrp->second.find(__type); std::multimap<int, grp_stock>::iterator i = currgrp->second.find(__type);
while(__no--) i++; while(__no--) i++;
__data = *(i->second.data.string_item); __data = *(i->second.data.string_item);
} }
@ -251,7 +251,7 @@ int Grp::GetItm(int __type, void* __data, int __size, int __no) {
if(rv) { if(rv) {
if((__no >= rv) or (__no == -1)) if((__no >= rv) or (__no == -1))
__no = rand() % rv; __no = rand() % rv;
multimap<int, grp_stock>::iterator i = currgrp->second.find(__type); std::multimap<int, grp_stock>::iterator i = currgrp->second.find(__type);
while(__no--) i++; while(__no--) i++;
void *data = i->second.data.object_item; void *data = i->second.data.object_item;
int local_size = *((int *)data); int local_size = *((int *)data);

View File

@ -132,19 +132,19 @@ private:
bool bool_item; bool bool_item;
char char_item; char char_item;
int int_item; int int_item;
string *string_item; std::string *string_item;
void *object_item; void *object_item;
} data; } data;
grp_stock(bool item) { type = TYPE_BOOL; data.bool_item = item; } grp_stock(bool item) { type = TYPE_BOOL; data.bool_item = item; }
grp_stock(char item) { type = TYPE_CHAR; data.char_item = item; } grp_stock(char item) { type = TYPE_CHAR; data.char_item = item; }
grp_stock(int item) { type = TYPE_INT; data.int_item = item; } grp_stock(int item) { type = TYPE_INT; data.int_item = item; }
grp_stock(const string& item) { type = TYPE_STRING; data.string_item = new string(item); throw_new(data.string_item); } grp_stock(const std::string& item) { type = TYPE_STRING; data.string_item = new std::string(item); throw_new(data.string_item); }
grp_stock(void *item) { type = TYPE_OBJECT; data.object_item = item; } grp_stock(void *item) { type = TYPE_OBJECT; data.object_item = item; }
}; };
vector< pair<string, multimap<int, grp_stock> > > container; std::vector< std::pair<std::string, std::multimap<int, grp_stock> > > container;
vector< pair<string, multimap<int, grp_stock> > >::iterator currgrp; std::vector< std::pair<std::string, std::multimap<int, grp_stock> > >::iterator currgrp;
public: public:
@ -160,13 +160,13 @@ public:
void AddItm(int __type, bool __data); void AddItm(int __type, bool __data);
void AddItm(int __type, char __data); void AddItm(int __type, char __data);
void AddItm(int __type, int __data); void AddItm(int __type, int __data);
void AddItm(int __type, const string& __data); void AddItm(int __type, const std::string& __data);
void AddItm(int __type, void* __data, int __size); void AddItm(int __type, void* __data, int __size);
int GetItm(int __type, bool& __data, int __no=-1); int GetItm(int __type, bool& __data, int __no=-1);
int GetItm(int __type, char& __data, int __no=-1); int GetItm(int __type, char& __data, int __no=-1);
int GetItm(int __type, int& __data, int __no=-1); int GetItm(int __type, int& __data, int __no=-1);
int GetItm(int __type, string& __data, int __no=-1); int GetItm(int __type, std::string& __data, int __no=-1);
int GetItm(int __type, void* __data, int __size, int __no=-1); int GetItm(int __type, void* __data, int __size, int __no=-1);
}; };

View File

@ -369,7 +369,7 @@ int wmove (int nsrow, int nscol);
int wopen (int srow, int scol, int erow, int ecol, int btype, int battr, int wattr, int sbattr=-1, int loattr=-1); int wopen (int srow, int scol, int erow, int ecol, int btype, int battr, int wattr, int sbattr=-1, int loattr=-1);
inline int wopen_ (int srow, int scol, int vlen, int hlen, int btype, int battr, int wattr, int sbattr=-1, int loattr=-1) { return wopen(srow, scol, srow+vlen-1, scol+hlen-1, btype, battr, wattr, sbattr, loattr); } inline int wopen_ (int srow, int scol, int vlen, int hlen, int btype, int battr, int wattr, int sbattr=-1, int loattr=-1) { return wopen(srow, scol, srow+vlen-1, scol+hlen-1, btype, battr, wattr, sbattr, loattr); }
int wperror (const char* message); int wperror (const char* message);
bool wpickfile (int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, bool title, string &filespec, VfvCP open, bool casesens=false); bool wpickfile (int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, bool title, std::string &filespec, VfvCP open, bool casesens=false);
int wpickstr (int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, char* strarr[], int initelem, VfvCP open); int wpickstr (int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, char* strarr[], int initelem, VfvCP open);
int wprintc (int wrow, int wcol, int attr, vchar ch); int wprintc (int wrow, int wcol, int attr, vchar ch);
int wprintf (const char* format, ...) __attribute__ ((format (printf, 1, 2))); int wprintf (const char* format, ...) __attribute__ ((format (printf, 1, 2)));

View File

@ -198,7 +198,7 @@ public:
void printc(int row, int col, int color, vchar ch); void printc(int row, int col, int color, vchar ch);
void prints(int row, int col, int color, const char* text); void prints(int row, int col, int color, const char* text);
void printvs(int row, int col, int color, const vchar* text); void printvs(int row, int col, int color, const vchar* text);
void prints(int row, int col, int color, const string& text); void prints(int row, int col, int color, const std::string& text);
void printns(int row, int col, int color, const char* text, int len, vchar fill=' ', int fill_color=-1); void printns(int row, int col, int color, const char* text, int len, vchar fill=' ', int fill_color=-1);
int printf(const char* format, ...) __attribute__ ((format (printf, 2, 3))); int printf(const char* format, ...) __attribute__ ((format (printf, 2, 3)));
@ -562,7 +562,7 @@ inline void gwindow::printvs(int row, int col, int color, const vchar* text) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
inline void gwindow::prints(int row, int col, int color, const string& text) { inline void gwindow::prints(int row, int col, int color, const std::string& text) {
prints(row, col, color, text.c_str()); prints(row, col, color, text.c_str());
} }

View File

@ -118,7 +118,7 @@ static void pre_exit(char** p, int numelems) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
bool wpickfile(int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, bool title, string &filespec, VfvCP open, bool casesens) { bool wpickfile(int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, bool title, std::string &filespec, VfvCP open, bool casesens) {
Path cwd, dir, namext, tcwd, path, spec; Path cwd, dir, namext, tcwd, path, spec;

View File

@ -59,7 +59,7 @@ public:
int buf_pos; int buf_pos;
int buf_len; int buf_len;
string& destination; std::string& destination;
int id; int id;
int row; int row;
@ -71,7 +71,7 @@ public:
field* prev; field* prev;
field* next; field* next;
field(gwinput* iform, int idnum, int wrow, int wcol, int field_width, string& dest, int dest_size, int cvt, int mode); field(gwinput* iform, int idnum, int wrow, int wcol, int field_width, std::string& dest, int dest_size, int cvt, int mode);
~field(); ~field();
bool visible(); bool visible();
@ -148,7 +148,7 @@ public:
void setup(int i_attr, int a_attr, int e_attr, vchar fill, bool fill_acs); void setup(int i_attr, int a_attr, int e_attr, vchar fill, bool fill_acs);
void add_field(int idnum, int wrow, int wcol, int field_width, string& dest, int dest_size, int cvt=gwinput::cvt_none, int mode=gwinput::entry_conditional); void add_field(int idnum, int wrow, int wcol, int field_width, std::string& dest, int dest_size, int cvt=gwinput::cvt_none, int mode=gwinput::entry_conditional);
bool first(int id=0); bool first(int id=0);
bool next(); bool next();

View File

@ -101,7 +101,7 @@ void gwinput::after() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void gwinput::add_field(int idnum, int wrow, int wcol, int field_width, string& dest, int dest_size, int cvt, int mode) { void gwinput::add_field(int idnum, int wrow, int wcol, int field_width, std::string& dest, int dest_size, int cvt, int mode) {
field* fld = new field(this, idnum, wrow, wcol, field_width, dest, dest_size, cvt, mode); field* fld = new field(this, idnum, wrow, wcol, field_width, dest, dest_size, cvt, mode);
throw_new(fld); throw_new(fld);
@ -618,7 +618,7 @@ bool gwinput::handle_key(gkey key) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
gwinput::field::field(gwinput* iform, int idnum, int wrow, int wcol, int field_width, string& dest, int dest_size, int cvt, int mode) gwinput::field::field(gwinput* iform, int idnum, int wrow, int wcol, int field_width, std::string& dest, int dest_size, int cvt, int mode)
: destination(dest) : destination(dest)

View File

@ -254,7 +254,7 @@ void gareafile::GetAreasBBS(char* name, char* origin, char* options) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << areafile << endl; std::cout << "* Reading " << areafile << std::endl;
bool firstline = true; bool firstline = true;

View File

@ -110,7 +110,7 @@ public:
byte pmscanexcl : 1; // TRUE if listed with AREAPMSCANEXCL byte pmscanexcl : 1; // TRUE if listed with AREAPMSCANEXCL
byte pmscanincl : 1; // TRUE if listed with AREAPMSCANINCL byte pmscanincl : 1; // TRUE if listed with AREAPMSCANINCL
int setorigin(string& origin); int setorigin(std::string& origin);
bool isfts1() const { return !!(msgbase & GMB_FTS1); } bool isfts1() const { return !!(msgbase & GMB_FTS1); }
bool isopus() const { return !!(msgbase & GMB_OPUS); } bool isopus() const { return !!(msgbase & GMB_OPUS); }
@ -146,10 +146,10 @@ public:
static int autoid; static int autoid;
Echo echoid; // Echo tag Echo echoid; // Echo tag
Desc desc; // Area description Desc desc; // Area description
Path path; // Path to message area Path path; // Path to message area
string origin; // Origin std::string origin; // Origin
AreaCfg() { reset(); } AreaCfg() { reset(); }
~AreaCfg() { } ~AreaCfg() { }
@ -265,7 +265,7 @@ protected:
void ReadFMail116(FILE* fp, char* path, char* file, char* options); void ReadFMail116(FILE* fp, char* path, char* file, char* options);
#endif #endif
#ifndef GCFG_NOFIDOCONF #ifndef GCFG_NOFIDOCONF
bool ReadHPTLine(FILE* f, string* s, bool add=false, int state=0); bool ReadHPTLine(FILE* f, std::string* s, bool add=false, int state=0);
void ReadHPTFile(char* path, char* file, char* options, char* origin, int group); void ReadHPTFile(char* path, char* file, char* options, char* origin, int group);
#endif #endif
#ifndef GCFG_NOIMAIL #ifndef GCFG_NOIMAIL

View File

@ -96,7 +96,7 @@ void gareafile::ReadCrashmail(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
char buf[4000]; char buf[4000];
char key[30]; char key[30];

View File

@ -51,14 +51,14 @@ void gareafile::ReadDB130(char* tag, char* dbpath) {
setvbuf(fp1, NULL, _IOFBF, 8192); setvbuf(fp1, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file1 << endl; std::cout << "* 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)
cout << "* Reading " << file2 << endl; std::cout << "* Reading " << file2 << std::endl;
while(fread(&AA1, sizeof(DB130_AA1), 1, fp1) == 1) { while(fread(&AA1, sizeof(DB130_AA1), 1, fp1) == 1) {
@ -122,7 +122,7 @@ void gareafile::ReadDB1046(char* file, char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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)) {
@ -185,7 +185,7 @@ void gareafile::ReadDB1047A22(char* file, int reclen, char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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)) {
@ -249,7 +249,7 @@ void gareafile::ReadDB2011(char* file, int reclen, char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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)) {
@ -337,7 +337,7 @@ void gareafile::ReadDBridge(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -67,7 +67,7 @@ void gareafile::ReadDutchie(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fgets(buf, 255, fp)) { while(fgets(buf, 255, fp)) {

View File

@ -51,7 +51,7 @@ void gareafile::ReadEzycom102(FILE* fp, char* path, char* file, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(constant, sizeof(CONSTANTRECORD), 1, fp); fread(constant, sizeof(CONSTANTRECORD), 1, fp);
fclose(fp); fclose(fp);
@ -192,7 +192,7 @@ void gareafile::ReadEzycom102(FILE* fp, char* path, char* file, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
int record = 1; int record = 1;

View File

@ -52,7 +52,7 @@ void gareafile::ReadEzycom110(FILE* fp, char* path, char* file, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(constant, sizeof(CONSTANTRECORD), 1, fp); fread(constant, sizeof(CONSTANTRECORD), 1, fp);
fclose(fp); fclose(fp);
@ -193,7 +193,7 @@ void gareafile::ReadEzycom110(FILE* fp, char* path, char* file, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
int record = 1; int record = 1;
@ -311,7 +311,7 @@ void gareafile::ReadEzycom(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
char _verstr[9]; char _verstr[9];
fread(_verstr, 9, 1, fp); fread(_verstr, 9, 1, fp);
@ -320,7 +320,7 @@ void gareafile::ReadEzycom(char* tag) {
strp2c(_verstr); strp2c(_verstr);
if(strnicmp(_verstr, "1.02", 4) < 0) { if(strnicmp(_verstr, "1.02", 4) < 0) {
cout << "* Error: Ezycom v" << _verstr << " is not supported - Skipping." << endl; std::cout << "* 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

@ -82,7 +82,7 @@ void gareafile::ReadFrontDoor(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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
@ -121,7 +121,7 @@ void gareafile::ReadFrontDoor(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -194,7 +194,7 @@ void gareafile::ReadFastecho(char* tag) {
if(fh != -1) { if(fh != -1) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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
@ -206,7 +206,7 @@ void gareafile::ReadFastecho(char* tag) {
else if(revision == 6) else if(revision == 6)
ReadFastecho142(fh); ReadFastecho142(fh);
else else
cout << "* Error: FastEcho system file revision level " << revision << " is not supported - Skipping." << endl; std::cout << "* Error: FastEcho system file revision level " << revision << " is not supported - Skipping." << std::endl;
close(fh); close(fh);
} }

View File

@ -89,7 +89,7 @@ void gareafile::ReadFidoPCB(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
int areas = 0; int areas = 0;
fparea* area = NULL; fparea* area = NULL;

View File

@ -298,7 +298,7 @@ void gareafile::ReadFMail(char* tag) {
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
cout << "* Error: Unknown FMail config revision " << setfill('0') << setw(4) << hex << ar_rev << "h - Skipping." << endl; std::cout << "* Error: Unknown FMail config revision " << std::setfill('0') << std::setw(4) << std::hex << ar_rev << "h - Skipping." << std::endl;
} }
} }
} }

View File

@ -87,7 +87,7 @@ void gareafile::ReadGEcho(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(&sysrev, sizeof(word), 1, fp); fread(&sysrev, sizeof(word), 1, fp);
rewind(fp); rewind(fp);
@ -110,10 +110,10 @@ void gareafile::ReadGEcho(char* tag) {
if(ge_version >= 102) { if(ge_version >= 102) {
_fidomsgtype = (gesetup->extraoptions & OPUSDATES) ? GMB_OPUS : GMB_FTS1; _fidomsgtype = (gesetup->extraoptions & OPUSDATES) ? GMB_OPUS : GMB_FTS1;
if((_fidomsgtype == GMB_FTS1) and (fidomsgtype == GMB_OPUS)) { if((_fidomsgtype == GMB_FTS1) and (fidomsgtype == GMB_OPUS)) {
cout << std::cout <<
"* Warning - FTS-1 format is used for *.MSG. For better compatibility set this" << endl << "* 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)." << endl << "* in GSETUP: Miscellanous->GEcho Options->MSG compatibilty = Opus (not Fido)." << std::endl <<
"* To disable this warning, set FIDOMSGTYPE FTS1 in your GoldED setup." << endl; "* To disable this warning, set FIDOMSGTYPE FTS1 in your GoldED setup." << std::endl;
} }
} }
@ -335,7 +335,7 @@ void gareafile::ReadGEcho(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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 +436,7 @@ void gareafile::ReadGEcho(char* tag) {
} }
} }
else else
cout << "* Error: GEcho system file revision level " << sysrev << " is not supported - Skipping." << endl; std::cout << "* Error: GEcho system file revision level " << sysrev << " is not supported - Skipping." << std::endl;
} }
throw_free(gesetup); throw_free(gesetup);
} }

View File

@ -39,9 +39,9 @@ static bool comment_char = '#';
// ------------------------------------------------------------------ // ------------------------------------------------------------------
bool gareafile::ReadHPTLine(FILE* f, string* s, bool add, int state) { bool gareafile::ReadHPTLine(FILE* f, std::string* s, bool add, int state) {
string str; std::string str;
char buf[81]; char buf[81];
if(fgets(buf, 81, f) == NULL) if(fgets(buf, 81, f) == NULL)
@ -57,7 +57,7 @@ bool gareafile::ReadHPTLine(FILE* f, string* s, bool add, int state) {
} }
} }
string::iterator ptr = str.begin(); std::string::iterator ptr = str.begin();
// state 0: normal state // state 0: normal state
// 1: between "" // 1: between ""
@ -99,7 +99,7 @@ bool gareafile::ReadHPTLine(FILE* f, string* s, bool add, int state) {
case ' ': case ' ':
case '\t': case '\t':
{ {
string::iterator i = ptr; std::string::iterator i = ptr;
while((i != str.end()) and isspace(*i)) while((i != str.end()) and isspace(*i))
++i; ++i;
if(*i != '#') if(*i != '#')
@ -262,11 +262,11 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
aa.reset(); aa.reset();
string s; std::string s;
while(ReadHPTLine(fp, &s)) { while(ReadHPTLine(fp, &s)) {
if(not s.empty()) { if(not s.empty()) {
@ -286,7 +286,7 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
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)) {
cout << "* Error: Unknown fidoconfig version " << ver_maj << '.' << ver_min << " - Skipping." << endl; std::cout << "* 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

@ -47,7 +47,7 @@ void gareafile::ReadIMail160(char* options, char* file, char* impath) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(CF, sizeof(im_config_type), 1, fp); fread(CF, sizeof(im_config_type), 1, fp);
fclose(fp); fclose(fp);
@ -75,7 +75,7 @@ void gareafile::ReadIMail160(char* options, char* file, char* impath) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fread(&AR, sizeof(areas_record_type), 1, fp) == 1) { while(fread(&AR, sizeof(areas_record_type), 1, fp) == 1) {
@ -105,7 +105,7 @@ void gareafile::ReadIMail160(char* options, char* file, char* impath) {
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 {
cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << endl; std::cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl;
continue; continue;
} }
break; break;

View File

@ -57,7 +57,7 @@ void gareafile::ReadIMail170(char* options, char* file, char* impath) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(CF, sizeof(im_config_type), 1, fp); fread(CF, sizeof(im_config_type), 1, fp);
fclose(fp); fclose(fp);
@ -85,7 +85,7 @@ void gareafile::ReadIMail170(char* options, char* file, char* impath) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fread(&AR, sizeof(areas_record_type), 1, fp) == 1) { while(fread(&AR, sizeof(areas_record_type), 1, fp) == 1) {
@ -115,7 +115,7 @@ void gareafile::ReadIMail170(char* options, char* file, char* impath) {
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 {
cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << endl; std::cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl;
continue; continue;
} }
break; break;

View File

@ -57,7 +57,7 @@ void gareafile::ReadIMail185(char* options, char* file, char* impath) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(CF, sizeof(im_config_type), 1, fp); fread(CF, sizeof(im_config_type), 1, fp);
fclose(fp); fclose(fp);
@ -85,7 +85,7 @@ void gareafile::ReadIMail185(char* options, char* file, char* impath) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fread(&AR, sizeof(mail_area_type), 1, fp) == 1) { while(fread(&AR, sizeof(mail_area_type), 1, fp) == 1) {
@ -115,7 +115,7 @@ void gareafile::ReadIMail185(char* options, char* file, char* impath) {
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 {
cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << endl; std::cout << "* Warning: Invalid board " << AR.brd << " (" << AR.aname << ") in IMAIL.AR - Skipping." << std::endl;
continue; continue;
} }
break; break;
@ -218,7 +218,7 @@ void gareafile::ReadIMail(char* tag) {
#endif #endif
} }
} }
cout << "* Error: IMAIL " << imver[0] << '.' << setfill('0') << setw(2) << imver[1] << " (structure revision " << imstructver[0] << '.' << setfill('0') << setw(2) << imstructver[1] << ") is not supported - Skipping." << endl; 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

@ -68,7 +68,7 @@ void gareafile::ReadInterMail(char* tag) {
_ctl* ctl = (_ctl*)throw_calloc(1, sizeof(_ctl)); _ctl* ctl = (_ctl*)throw_calloc(1, sizeof(_ctl));
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
fp.fread(ctl, sizeof(_ctl)); fp.fread(ctl, sizeof(_ctl));
@ -135,7 +135,7 @@ void gareafile::ReadInterMail(char* tag) {
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
FOLDER* _folder = (FOLDER*)throw_calloc(1, sizeof(FOLDER)); FOLDER* _folder = (FOLDER*)throw_calloc(1, sizeof(FOLDER));
@ -179,7 +179,7 @@ void gareafile::ReadInterMail(char* tag) {
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
OLDFOLDER* _folder = (OLDFOLDER*)throw_calloc(1, sizeof(OLDFOLDER)); OLDFOLDER* _folder = (OLDFOLDER*)throw_calloc(1, sizeof(OLDFOLDER));
@ -213,7 +213,7 @@ void gareafile::ReadInterMail(char* tag) {
} }
} }
else { else {
cout << "* Error: InterMail revision " << setfill('0') << setw(4) << hex << ctl->sysrev << "h is not supported - Skipping." << endl; std::cout << "* Error: InterMail revision " << std::setfill('0') << std::setw(4) << std::hex << ctl->sysrev << "h is not supported - Skipping." << std::endl;
} }
throw_free(ctl); throw_free(ctl);
} }

View File

@ -68,7 +68,7 @@ void gareafile::ReadLoraBBS(char* tag) {
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* 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));
@ -135,7 +135,7 @@ void gareafile::ReadLoraBBS(char* tag) {
fp.setvbuf(NULL, _IOFBF, 8192); fp.setvbuf(NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
_sysmsg* sysmsg = (_sysmsg*)throw_calloc(1, sizeof(_sysmsg)); _sysmsg* sysmsg = (_sysmsg*)throw_calloc(1, sizeof(_sysmsg));

View File

@ -49,7 +49,7 @@ void gareafile::ReadMaximus3(char* mxpath, char* areafile, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << areafile << endl; std::cout << "* 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;
@ -71,7 +71,7 @@ void gareafile::ReadMaximus3(char* mxpath, char* areafile, char* options) {
setvbuf(fp, NULL, _IOFBF, 32000); setvbuf(fp, NULL, _IOFBF, 32000);
if(not quiet) if(not quiet)
cout << "* Reading " << areafile << endl; std::cout << "* Reading " << areafile << std::endl;
long areasize = fsize(fp)-4; long areasize = fsize(fp)-4;

View File

@ -60,7 +60,7 @@ void gareafile::ReadME2(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fgets(buf, 255, fp)) { while(fgets(buf, 255, fp)) {

View File

@ -79,7 +79,7 @@ void gareafile::ReadOpus(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fread(&msgsys, sizeof(_msgsys), 1, fp) == 1) { while(fread(&msgsys, sizeof(_msgsys), 1, fp) == 1) {
@ -135,7 +135,7 @@ void gareafile::ReadOpus(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -86,7 +86,7 @@ void gareafile::ReadPCBoard(char* tag) {
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
int _line = 0; int _line = 0;
@ -117,7 +117,7 @@ void gareafile::ReadPCBoard(char* tag) {
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
// Get configuration file version // Get configuration file version
fp.fread(&fido_version, 2); fp.fread(&fido_version, 2);
@ -163,7 +163,7 @@ void gareafile::ReadPCBoard(char* tag) {
fp.fopen(_file, "rb"); fp.fopen(_file, "rb");
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
word cfgver = 0; word cfgver = 0;
fp.fread(&cfgver, 2); fp.fread(&cfgver, 2);
if(cfgver == 3) { if(cfgver == 3) {
@ -179,7 +179,7 @@ void gareafile::ReadPCBoard(char* tag) {
fp.fopen(_file, "rb"); fp.fopen(_file, "rb");
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
word cfgver = 0; word cfgver = 0;
fp.fread(&cfgver, 2); fp.fread(&cfgver, 2);
if(cfgver == 3) { if(cfgver == 3) {
@ -201,7 +201,7 @@ void gareafile::ReadPCBoard(char* tag) {
fp.fopen(_file, "rb"); fp.fopen(_file, "rb");
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
word cfgver = 0; word cfgver = 0;
fp.fread(&cfgver, 2); fp.fread(&cfgver, 2);
if(cfgver == 3) { if(cfgver == 3) {
@ -249,7 +249,7 @@ void gareafile::ReadPCBoard(char* tag) {
if(fp.isopen()) { if(fp.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
gfile fp2; gfile fp2;
_file = AddPath(_cnamespath, ".add"); _file = AddPath(_cnamespath, ".add");
@ -257,7 +257,7 @@ void gareafile::ReadPCBoard(char* tag) {
if(fp2.isopen()) { if(fp2.isopen()) {
if(not quiet) if(not quiet)
cout << "* Reading " << _file << endl; std::cout << "* Reading " << _file << std::endl;
word _recsize = 0; word _recsize = 0;
fp.fread(&_recsize, 2); fp.fread(&_recsize, 2);

View File

@ -65,7 +65,7 @@ void gareafile::ReadProBoard(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(cfg, sizeof(Config), 1, fp); fread(cfg, sizeof(Config), 1, fp);
@ -81,7 +81,7 @@ void gareafile::ReadProBoard(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(aka, akasz, 1, fp); fread(aka, akasz, 1, fp);
fclose(fp); fclose(fp);
@ -95,7 +95,7 @@ void gareafile::ReadProBoard(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -43,7 +43,7 @@ void gareafile::ReadQEchoFile(char* file, char* options, char* origin) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
while(fgets(buf, sizeof(buf), fp)) { while(fgets(buf, sizeof(buf), fp)) {

View File

@ -64,7 +64,7 @@ void gareafile::ReadQFront(char* tag) {
fp = fsopen(file, "rb", sharemode); fp = fsopen(file, "rb", sharemode);
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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]);
@ -79,7 +79,7 @@ void gareafile::ReadQFront(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -53,7 +53,7 @@ void gareafile::ReadQ260(char* qbpath, char* origin, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(cfg, sizeof(Q260CfgRecT), 1, fp); fread(cfg, sizeof(Q260CfgRecT), 1, fp);
@ -141,7 +141,7 @@ void gareafile::ReadQ276(char* qbpath, char* origin, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(cfg, sizeof(Q276CfgRecT), 1, fp); fread(cfg, sizeof(Q276CfgRecT), 1, fp);
@ -157,7 +157,7 @@ void gareafile::ReadQ276(char* qbpath, char* origin, char* options) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -75,7 +75,7 @@ void gareafile::ReadRemoteAccess(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(config, sizeof(CONFIGrecord), 1, fp); fread(config, sizeof(CONFIGrecord), 1, fp);
fclose(fp); fclose(fp);
@ -98,7 +98,7 @@ void gareafile::ReadRemoteAccess(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* 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

@ -76,7 +76,7 @@ void gareafile::ReadRaEcho(char* tag) {
} }
if(raever == 0) { if(raever == 0) {
if(not quiet) if(not quiet)
cout << "* Could not determine version of RA-ECHO - skipping." << endl; std::cout << "* Could not determine version of RA-ECHO - skipping." << std::endl;
return; return;
} }
@ -86,7 +86,7 @@ void gareafile::ReadRaEcho(char* tag) {
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
areano = 1; areano = 1;
while(fread(&area, raever, 1, fp) == 1) { while(fread(&area, raever, 1, fp) == 1) {

View File

@ -54,7 +54,7 @@ void gareafile::ReadSquishFile(char* path, char* file, char* options, char* orig
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
aa.reset(); aa.reset();

View File

@ -76,7 +76,7 @@ void gareafile::ReadSuperBBS(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(config, sizeof(ConfigRecordT), 1, fp); fread(config, sizeof(ConfigRecordT), 1, fp);
STRNP2C(config->OriginLine); STRNP2C(config->OriginLine);
@ -87,7 +87,7 @@ void gareafile::ReadSuperBBS(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
fread(sconfig, sizeof(ExtraConfigT), 1, fp); fread(sconfig, sizeof(ExtraConfigT), 1, fp);
fclose(fp); fclose(fp);
@ -103,7 +103,7 @@ void gareafile::ReadSuperBBS(char* tag) {
if(fp) { if(fp) {
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
for(int n=0; n<200; n++) { for(int n=0; n<200; n++) {
@ -171,8 +171,8 @@ void gareafile::ReadSuperBBS(char* tag) {
} }
} }
else { else {
cout << "* Error: Unsupported version of SuperBBS: " << std::cout << "* Error: Unsupported version of SuperBBS: " <<
(word)(sconfig->VersionNumber >> 8) << '.' << (word)(sconfig->VersionNumber & 0xFF) << endl; (word)(sconfig->VersionNumber >> 8) << '.' << (word)(sconfig->VersionNumber & 0xFF) << std::endl;
} }
} }
} }

View File

@ -74,7 +74,7 @@ void gareafile::ReadTimedFile(char* path, char* file, char* options, char* origi
setvbuf(fp, NULL, _IOFBF, 8192); setvbuf(fp, NULL, _IOFBF, 8192);
if(not quiet) if(not quiet)
cout << "* Reading " << file << endl; std::cout << "* Reading " << file << std::endl;
aa.reset(); aa.reset();

Some files were not shown because too many files have changed in this diff Show More