Random fixes

This commit is contained in:
Alexander S. Aganichev 2002-09-29 16:06:10 +00:00
parent 20ba1cd738
commit 253849ef65
13 changed files with 199 additions and 118 deletions

View File

@ -21,7 +21,7 @@ LIBEXT=.a
CXX=$(CC)
else
ifneq ($(DJGPP),)
CAT=type
CAT=command.com /c type
CC=gcc
CXX=gpp
AR=ar

View File

@ -12,6 +12,11 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
+ Added EchoAreaDefaults support to Fidoconfig parser.
+ Synchronet configuration parser now will use short description
instead of internal code as echoid for the Fidonet areas.
- Fixed keyboard macro handling broken somewhere in pre-1.1.5s.
- Fixed Synchronet configuration parser :-)

View File

@ -970,88 +970,6 @@ void AreaList::GetAreaDesc(char* val) {
}
// ------------------------------------------------------------------
// Reset area data
void AreaCfg::reset() {
*echoid = *desc = *path = NUL;
origin = "";
areaid = 0;
groupid = 0;
originno = 0;
board = 0;
msgbase = 0;
aka.reset();
type = 0;
scan = 0;
scanexcl = 0;
scanincl = 0;
pmscan = 0;
pmscanexcl = 0;
pmscanincl = 0;
attr.reset();
}
// ------------------------------------------------------------------
// Set area description
const char* AreaCfg::setdesc(const char* _desc) {
return strxcpy(desc, _desc, sizeof(Desc));
}
// ------------------------------------------------------------------
// Set area echoid
const char* AreaCfg::setautoid(const char* _echoid) {
return strxcpy(echoid, CFG->areaautoid ? "" : _echoid, sizeof(Echo));
}
// ------------------------------------------------------------------
// Set area echoid
const char* AreaCfg::setechoid(const char* _echoid) {
return strxcpy(echoid, _echoid, sizeof(Echo));
}
// ------------------------------------------------------------------
// Set area path/filename
const char* AreaCfg::setpath(const char* _path) {
return StripQuotes(strxcpy(path, _path, sizeof(Path)));
}
// ------------------------------------------------------------------
// Set area origin
int AreaCfgBase::setorigin(std::string& _origin) {
if(not strblank(_origin.c_str())) {
// Check if it already exists
gstrarray::iterator n;
for(n = CFG->origin.begin(), originno = 0; n != CFG->origin.end(); originno++, n++)
if(*n == _origin)
return originno;
// Not found, so add it
CfgOrigin(_origin.c_str());
// originno = CFG->origin.size()-1;
}
return originno;
}
// ------------------------------------------------------------------
Area::Area(gmo_area* a) {
@ -1119,5 +1037,36 @@ char* MapPath(char* map, bool reverse) {
}
// ------------------------------------------------------------------
// Set area origin
int AreaCfgBase::setorigin(std::string& _origin) {
if(not strblank(_origin.c_str())) {
// Check if it already exists
gstrarray::iterator n;
for(n = CFG->origin.begin(), originno = 0; n != CFG->origin.end(); originno++, n++)
if(*n == _origin)
return originno;
// Not found, so add it
CfgOrigin(_origin.c_str());
// originno = CFG->origin.size()-1;
}
return originno;
}
// ------------------------------------------------------------------
// Set area echoid
const char* AreaCfg::setautoid(const char* _echoid) {
return strxcpy(echoid, CFG->areaautoid ? "" : _echoid, sizeof(Echo));
}
// ------------------------------------------------------------------

View File

@ -76,6 +76,84 @@ const char* AreaCfg::setorigin(const char* s) {
}
// ------------------------------------------------------------------
// Reset area data
void AreaCfg::reset() {
*echoid = *desc = *path = NUL;
origin = "";
areaid = 0;
groupid = 0;
originno = 0;
board = 0;
msgbase = 0;
aka.reset();
type = GMB_NONE;
scan = 0;
scanexcl = 0;
scanincl = 0;
pmscan = 0;
pmscanexcl = 0;
pmscanincl = 0;
attr.reset();
}
// ------------------------------------------------------------------
// Set area description
const char* AreaCfg::setdesc(const char* _desc) {
return strxcpy(desc, _desc, sizeof(Desc));
}
// ------------------------------------------------------------------
// Set area echoid
const char* AreaCfg::setechoid(const char* _echoid) {
return strxcpy(echoid, _echoid, sizeof(Echo));
}
// ------------------------------------------------------------------
// Set area path/filename
const char* AreaCfg::setpath(const char* _path) {
return StripQuotes(strxcpy(path, _path, sizeof(Path)));
}
// ------------------------------------------------------------------
AreaCfg& AreaCfg::operator=(const AreaCfg& AC) {
strcpy(this->echoid, AC.echoid);
strcpy(this->desc, AC.desc);
strcpy(this->path, AC.path);
this->origin = AC.origin;
this->areaid = AC.areaid;
this->groupid = AC.groupid;
this->originno = AC.originno;
this->board = AC.board;
this->msgbase = AC.msgbase;
this->aka = AC.aka;
this->type = AC.type;
this->scan = AC.scan;
this->scanexcl = AC.scanexcl;
this->scanincl = AC.scanincl;
this->pmscan = AC.pmscan;
this->pmscanexcl = AC.pmscanexcl;
this->pmscanincl = AC.pmscanincl;
this->attr = AC.attr;
return *this;
}
// ------------------------------------------------------------------
EchoListClass::EchoListClass() {
@ -473,12 +551,4 @@ bool gareafile::ReadAreafile(word crc, char* parameters) {
}
// ------------------------------------------------------------------
AreaCfg& AreaCfg::operator=(const AreaCfg&) {
return *this;
}
// ------------------------------------------------------------------

View File

@ -67,6 +67,8 @@ const uint GMB_NEWSGROUP = 0x0008;
const uint GMB_LOCAL = 0x0010;
const uint GMB_QWK = 0x1000;
const uint GMB_SOUP = 0x2000;
const uint GMB_NONE = 0x00ff;
const uint GMB_DEFAULT = 0xf00f;
// ------------------------------------------------------------------

View File

@ -52,6 +52,39 @@ const int LEN_SLNAME = 40; // Sub/Dir long name
const int LEN_SQWKNAME = 10;
// ------------------------------------------------------------------
// Bit values for sub[x].misc
const int SUB_NSCAN = (1L<<0); // Scan this sub-board for new msgs
const int SUB_YSCAN = (1L<<1); // Scan for new messages to you only
const int SUB_SSCAN = (1L<<2); // Scan this sub-board for msgs to you
const int SUB_QNET = (1L<<3); // Sub-board is netted via QWK network
const int SUB_PNET = (1L<<4); // Sub-board is netted via PostLink
const int SUB_FIDO = (1L<<5); // Sub-board is netted via FidoNet
const int SUB_PRIV = (1L<<6); // Allow private posts on sub
const int SUB_PONLY = (1L<<7); // Private posts only
const int SUB_ANON = (1L<<8); // Allow anonymous posts on sub
const int SUB_AONLY = (1L<<9); // Anonymous only
const int SUB_NAME = (1L<<10); // Must use real names
const int SUB_DEL = (1L<<11); // Allow users to delete messages
const int SUB_DELLAST = (1L<<12); // Allow users to delete last msg only
const int SUB_FORCED = (1L<<13); // Sub-board is forced scanning
const int SUB_NOTAG = (1L<<14); // Don't add tag or origin lines
const int SUB_TOUSER = (1L<<15); // Prompt for to user on posts
const int SUB_ASCII = (1L<<16); // ASCII characters only
const int SUB_QUOTE = (1L<<17); // Allow online quoting
const int SUB_NSDEF = (1L<<18); // New-Scan on by default
const int SUB_UNUSED = (1L<<19); // Currently unused
const int SUB_FAST = (1L<<20); // Fast storage mode
const int SUB_KILL = (1L<<21); // Kill read messages automatically
const int SUB_KILLP = (1L<<22); // Kill read pvt messages automatically
const int SUB_SYSPERM =(1L<<23); // Sysop messages are permament
const int SUB_GATE = (1L<<24); // Gateway between Network types
const int SUB_LZH = (1L<<25); // Use LZH compression for msgs
const int SUB_SSDEF = (1L<<26); // Default ON for Scan for Your msgs
const int SUB_HYPER = (1L<<27); // Hyper allocation
// ------------------------------------------------------------------
typedef struct { // Message group info

View File

@ -90,7 +90,7 @@ void gareafile::ReadCrashmailCfg(const char* file) {
size_t jbcpos;
AreaCfg aa;
aa.reset();
aa.type = 0xff;
aa.type = GMB_NONE;
address[0] = NUL;
domain[0] = NUL;
@ -140,7 +140,7 @@ void gareafile::ReadCrashmailCfg(const char* file) {
ReadCrashmail(path);
break;
case CRC_NETMAILDIR:
if(aa.type != 0xff) {
if(aa.type != GMB_NONE) {
if(not unconfirmed)
AddNewArea(aa);
aa.reset();
@ -159,7 +159,7 @@ void gareafile::ReadCrashmailCfg(const char* file) {
case CRC_AREA:
case CRC_NETMAIL:
case CRC_LOCALAREA:
if(aa.type != 0xff) {
if(aa.type != GMB_NONE) {
if(not unconfirmed)
AddNewArea(aa);
aa.reset();
@ -167,7 +167,7 @@ void gareafile::ReadCrashmailCfg(const char* file) {
unconfirmed = false;
jbstrcpy(tmp, buf, 100, &jbcpos);
if(strieql(tmp, "DEFAULT") or strnieql(tmp, "DEFAULT_", 8)) {
aa.type = 0xff;
aa.type = GMB_NONE;
break;
}
switch(crc16) {
@ -201,10 +201,10 @@ void gareafile::ReadCrashmailCfg(const char* file) {
break;
default:
aa.reset();
aa.type = 0xff;
aa.type = GMB_NONE;
break;
}
if(aa.type == 0xff)
if(aa.type == GMB_NONE)
break;
jbstrcpy(path, buf, sizeof(Path), &jbcpos);
aa.setpath(path);
@ -226,7 +226,7 @@ void gareafile::ReadCrashmailCfg(const char* file) {
break;
}
}
if(aa.type != 0xff) {
if(aa.type != GMB_NONE) {
if(not unconfirmed) {
AddNewArea(aa);
}

View File

@ -168,8 +168,9 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
const word CRC_SYSOP = 0x967F;
const word CRC_VERSION = 0xF78F;
const word CRC_COMMENTCHAR = 0xE2CC;
const word CRC_ECHOAREADEFAULTS = 0x2CBB;
AreaCfg aa;
AreaCfg aa, ad;
Path buf2;
FILE* fp = fsopen(file, "rb", sharemode);
@ -180,6 +181,7 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
std::cout << "* Reading " << file << std::endl;
aa.reset();
ad.reset();
std::string s;
while(ReadHPTLine(fp, &s)) {
@ -189,7 +191,9 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
char *alptr = throw_xstrdup(s.c_str());
char *ptr = alptr;
aa.type = 0xFF;
aa.type = GMB_NONE;
aa.msgbase = fidomsgtype;
aa.groupid = group;
char* key;
char* val = ptr;
@ -235,18 +239,30 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
aa.type = GMB_LOCAL;
break;
case CRC_ECHOAREA:
aa = ad;
aa.type = GMB_ECHO;
break;
case CRC_ECHOAREADEFAULTS:
ad.reset();
aa.type = GMB_DEFAULT;
break;
}
if(aa.type != 0xFF) {
if(aa.type != GMB_NONE) {
// Get echoid
gettok(&key, &val);
aa.setechoid(key);
if(aa.type == GMB_DEFAULT) {
// Get path
gettok(&key, &val);
*key = NUL;
}
else {
// Get echoid
gettok(&key, &val);
aa.setechoid(key);
// Get path
gettok(&key, &val);
}
// If not pass-through
if(not strieql("Passthrough", key)) {
@ -254,8 +270,6 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
if(strchg(key, '[', '%') != 0)
strchg(key, ']', '%');
aa.setpath(key);
aa.msgbase = fidomsgtype;
aa.groupid = group;
gettok(&key, &val);
@ -316,19 +330,27 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
gettok(&key, &val);
}
aa.setorigin(origin);
switch(aa.type) {
case GMB_NET:
aa.attr = attribsnet;
AddNewArea(aa);
break;
case GMB_ECHO:
aa.attr = attribsecho;
AddNewArea(aa);
break;
case GMB_LOCAL:
aa.attr = attribslocal;
AddNewArea(aa);
break;
case GMB_DEFAULT:
ad = aa;
break;
default:
break;
}
aa.setorigin(origin);
AddNewArea(aa);
}
aa.reset();

View File

@ -247,7 +247,7 @@ void gareafile::ReadSpaceCtl(const char* file) {
while(fgets(buf, 4000, fp) != NULL) {
aa.type = 0xFF;
aa.type = GMB_NONE;
char* key;
char* val = buf;
@ -285,7 +285,7 @@ void gareafile::ReadSpaceCtl(const char* file) {
break;
}
if(aa.type != 0xFF) {
if(aa.type != GMB_NONE) {
aa.aka = primary_aka;

View File

@ -63,7 +63,7 @@ void gareafile::ReadSquishFile(char* path, char* file, char* options, char* orig
char* ptr = strskip_wht(strtrim(buf));
if(*ptr != ';' and *ptr) {
aa.type = 0xFF;
aa.type = GMB_NONE;
char* key;
char* val = ptr;
@ -97,7 +97,7 @@ void gareafile::ReadSquishFile(char* path, char* file, char* options, char* orig
break;
}
if(aa.type != 0xFF) {
if(aa.type != GMB_NONE) {
// Get echoid
getkeyval(&key, &val);

View File

@ -91,7 +91,7 @@ void gareafile::ReadSynchronet(char* tag) {
aa.type = GMB_ECHO;
aa.attr = attribsecho;
aa.msgbase = GMB_SMB;
aa.setechoid(sub.code);
aa.setechoid((sub.misc & SUB_FIDO) ? sub.sname : sub.code);
aa.setdesc(sub.lname);
aa.groupid = 0x8000 + sub.grp;
if(*sub.data_dir)

View File

@ -83,7 +83,7 @@ void gareafile::ReadTimedFile(char* path, char* file, char* options, char* origi
char* ptr = strskip_wht(strtrim(buf));
if(*ptr != ';' and *ptr) {
aa.type = 0xFF;
aa.type = GMB_NONE;
char* key;
char* val = ptr;
@ -161,7 +161,7 @@ void gareafile::ReadTimedFile(char* path, char* file, char* options, char* origi
break;
}
if(aa.type != 0xFF) {
if(aa.type != GMB_NONE) {
// Get description
getkeyval(&key, &val);

View File

@ -60,7 +60,7 @@ void gareafile::ReadTmailFile(char* file, char* options, char* origin) {
char* ptr = strskip_wht(strtrim(buf));
if(*ptr != '%' and *ptr) {
aa.type = 0xFF;
aa.type = GMB_NONE;
char* key;
char* val = ptr;