This commit is contained in:
Alexander S. Aganichev
2001-04-15 19:24:44 +00:00
parent 54e47b7b0a
commit 4934ba030c
72 changed files with 348 additions and 348 deletions

View File

@@ -164,7 +164,7 @@ int EzycomArea::raw_open() {
int _sopen_access = data->omode | O_BINARY;
int _sopen_permit = 0;
if(NOT fexist(ret_mess_xxx(data->ezyfile,1))) {
if(not fexist(ret_mess_xxx(data->ezyfile,1))) {
_sopen_access |= O_CREAT;
_sopen_permit = S_STDRW;
}
@@ -193,7 +193,7 @@ int EzycomArea::raw_open() {
break;
}
Path _path;
if(NOT is_dir(ret_mess_area(_path))) {
if(not is_dir(ret_mess_area(_path))) {
mkdir(ret_mess_area(_path), S_IWUSR);
_tryagain++;
}
@@ -218,10 +218,10 @@ void EzycomArea::test_raw_open(int __fileline) {
_isopen = raw_open();
if(NOT _isopen) {
if(not _isopen) {
// Tell the world
if((errno != EACCES) OR PopupLocked(++_tries, false, data->ezyfile) == false) {
if((errno != EACCES) or PopupLocked(++_tries, false, data->ezyfile) == false) {
// User requested to exit
WideLog->erropen(__FILE__, __fileline);
@@ -231,7 +231,7 @@ void EzycomArea::test_raw_open(int __fileline) {
OpenErrorExit();
}
}
} while(NOT _isopen);
} while(not _isopen);
// Remove the popup window
if(_tries)
@@ -266,7 +266,7 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) {
Path _path;
*_path = NUL;
char* _ptr = getenv("EZY");
if(_ptr AND *_ptr) {
if(_ptr and *_ptr) {
_ptr = strcpy(_path, _ptr);
char* _ptr2 = strchr(_ptr, ' ');
if(_ptr2)
@@ -275,12 +275,12 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) {
}
const char* _file = "";
_ptr = getenv("TASK");
if(_ptr AND *_ptr) {
if(_ptr and *_ptr) {
char _tmp[20];
sprintf(_tmp, "CONFIG.%u", atoi(_ptr));
_file = AddPath(_path, _tmp);
}
if(NOT fexist(_file))
if(not fexist(_file))
_file = AddPath(_path, "CONFIG.EZY");
ezycomwide->ver = 102;
@@ -308,7 +308,7 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) {
ezycomwide->user->extfh = ::sopen(AddPath(ezycomwide->userbasepath, "USERSEXT.BBS"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(ezycomwide->user->extfh != -1) {
ezycomwide->user->find(_username);
if(NOT ezycomwide->user->found) {
if(not ezycomwide->user->found) {
WideLog->printf("* User \"%s\" not found in %sUSERS.BBS.", _username, ezycomwide->userbasepath);
ezycomwide->user->add(_username);
WideLog->printf("* Now added with user number %u.", ezycomwide->user->index);
@@ -424,7 +424,7 @@ void EzycomArea::suspend() {
void EzycomArea::resume() {
GFTRK("EzycomResume");
if(NOT raw_open()) {
if(not raw_open()) {
Path _path;
WideLog->ErrOpen();
WideLog->printf("! A Ezycom msgbase file could not be opened.");

View File

@@ -35,7 +35,7 @@ void EzycomArea::raw_scan(int __keep_index) {
GFTRK("EzycomRawScan");
int _wasopen = isopen;
if(NOT _wasopen) {
if(not _wasopen) {
isopen++;
data_open();
test_raw_open(__LINE__);
@@ -73,7 +73,7 @@ void EzycomArea::raw_scan(int __keep_index) {
while(1) {
// Set lastread pointer
if((*_msgnoptr >= _lastread) AND (_lastread_reln == 0)) {
if((*_msgnoptr >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = *_msgnoptr;
_lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0);
break;
@@ -85,7 +85,7 @@ void EzycomArea::raw_scan(int __keep_index) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -101,10 +101,10 @@ void EzycomArea::raw_scan(int __keep_index) {
::close(_fh);
}
if(NOT __keep_index)
if(not __keep_index)
Msgn->Reset();
if(NOT _wasopen) {
if(not _wasopen) {
raw_close();
data_close();
isopen--;

View File

@@ -88,7 +88,7 @@ int EzycomArea::load_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
__msg->attr.rrq(__hdr.netattr & EZYC_NETATTR_RREQ);
__msg->attr.arq(__hdr.netattr & EZYC_NETATTR_AREQ);
__msg->attr.rrc(__hdr.netattr & EZYC_NETATTR_RREC);
__msg->attr.uns(((__hdr.msgattr & EZYC_MSGATTR_NETPEND) OR (__hdr.msgattr & EZYC_MSGATTR_ECHOPEND)) ? 1 : 0);
__msg->attr.uns(((__hdr.msgattr & EZYC_MSGATTR_NETPEND) or (__hdr.msgattr & EZYC_MSGATTR_ECHOPEND)) ? 1 : 0);
__msg->ezycom.extattr = __hdr.extattr;
__msg->timesread = (__hdr.extattr & EZYC_EXTATTR_SEEN) ? 1 : 0;

View File

@@ -69,7 +69,7 @@ void EzycomArea::unlock() {
void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
int _was_locked = data->islocked;
if(NOT _was_locked)
if(not _was_locked)
lock();
if(__mode & GMSG_NEW)
@@ -140,7 +140,7 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
// Write the message text
uint _size = strlen(__msg->txt) + 1;
if((__mode & GMSG_NEW) OR (_size > __hdr.messagelength))
if((__mode & GMSG_NEW) or (_size > __hdr.messagelength))
__hdr.startposition = filelength(data->fhtxt);
lseekset(data->fhtxt, __hdr.startposition);
write(data->fhtxt, __msg->txt, _size);
@@ -238,7 +238,7 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
Msgn->Append(__msg->msgno);
}
if(NOT _was_locked)
if(not _was_locked)
unlock();
GFTRK(NULL);

View File

@@ -80,10 +80,10 @@ int FidoArea::test_open(const char* __file, int __openmode, int __sharemode, int
_fh = ::sopen(__file, __openmode, __sharemode, S_STDRW);
if(_fh == -1) {
if((errno != EACCES) OR (PopupLocked(++_tries, false, __file) == false)) {
if((errno != EACCES) or (PopupLocked(++_tries, false, __file) == false)) {
// Return instead of halting if requested
if(errno != EACCES AND NOT __fail) {
if((errno != EACCES) and not __fail) {
GFTRK(NULL);
return _fh;
}
@@ -142,7 +142,7 @@ void FidoInit(const char* fidolastread, int fidohwmarks, int fidonullfix, int fi
fidowide->user->fh = ::sopen(userfile, O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(fidowide->user->fh != -1) {
fidowide->user->find(_username);
if(NOT fidowide->user->found) {
if(not fidowide->user->found) {
WideLog->printf("* User \"%s\" not found in %s.", _username, userfile);
fidowide->user->add(_username);
WideLog->printf("* Now added with user number %u.", fidowide->user->index);

View File

@@ -89,7 +89,7 @@ void FidoArea::raw_scan(bool __scanpm) {
while(1) {
// Set lastread pointer
if((*_msgnoptr >= _lastread) AND (_lastread_reln == 0)) {
if((*_msgnoptr >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = *_msgnoptr;
_lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0);
break;
@@ -101,7 +101,7 @@ void FidoArea::raw_scan(bool __scanpm) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -112,7 +112,7 @@ void FidoArea::raw_scan(bool __scanpm) {
// Read highwater mark
data->highwatermark = 0;
if(isecho() AND wide->fidohwmarks) {
if(isecho() and wide->fidohwmarks) {
_fh = test_open(AddPath(path(), "1.msg"), O_RDONLY|O_BINARY, WideSharemode);
if(_fh != -1) {
read(_fh, &_hdr, sizeof(FidoHdr));

View File

@@ -117,9 +117,9 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
__msg->attr.lok(not (st.st_mode & S_IWUSR));
// Set the unsent attribute
if(isnet() OR (isecho() AND NOT wide->fidohwmarks))
__msg->attr.uns((__hdr.attr & FIDO_LOCAL) AND NOT (__hdr.attr & FIDO_SENT));
else if(isecho() AND wide->fidohwmarks) {
if(isnet() or (isecho() and not wide->fidohwmarks))
__msg->attr.uns((__hdr.attr & FIDO_LOCAL) and not (__hdr.attr & FIDO_SENT));
else if(isecho() and wide->fidohwmarks) {
__msg->attr.uns(data->highwatermark < __msg->msgno);
__msg->attr.snt(data->highwatermark >= __msg->msgno);
}

View File

@@ -72,7 +72,7 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
// Never create a new 1.MSG in echo or local areas.
if(__msg->msgno == 1) {
if(NOT isnet()) {
if(not isnet()) {
__msg->msgno = 2;
build_msgname(_msgfile, __msg->msgno);
}
@@ -120,9 +120,8 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
int _fh = test_open(_msgfile, _omode, WideSharemode, YES);
// Get date/time of message file
if(NOT(__mode & GMSG_NEW)) {
if(NOT __msg->attr.upd())
fstat(_fh, &st);
if(not (__mode & GMSG_NEW) and not __msg->attr.upd()) {
fstat(_fh, &st);
}
memset(&__hdr, 0, sizeof(FidoHdr));
@@ -189,13 +188,11 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
::close(_fh);
// Reset date/time of message file
if(NOT(__mode & GMSG_NEW)) {
if(NOT __msg->attr.upd()) {
struct utimbuf t;
t.actime = st.st_atime;
t.modtime = st.st_mtime;
utime(_msgfile, &t);
}
if(not (__mode & GMSG_NEW) and not __msg->attr.upd()) {
struct utimbuf t;
t.actime = st.st_atime;
t.modtime = st.st_mtime;
utime(_msgfile, &t);
}
// If the message has locked status, make it read-only

View File

@@ -63,7 +63,7 @@ int FidoArea::renumber() {
// In echo or local, start with 2.MSG so we don't conflict
// with highwater marks, unless there is already a 1.MSG
ulong _msgno1st = 1;
if((NOT isnet()) AND (Msgn->at(0) != 1))
if(not isnet() and (Msgn->at(0) != 1))
_msgno1st++;
// Renumber *.MSG files
@@ -105,7 +105,7 @@ int FidoArea::renumber() {
read(_fh, &_hdr, sizeof(FidoHdr));
// Update the replylinks
if(_hdr.replyto OR _hdr.reply1st) {
if(_hdr.replyto or _hdr.reply1st) {
_hdr.replyto = (word)Msgn->ToReln(_hdr.replyto);
_hdr.reply1st = (word)Msgn->ToReln(_hdr.reply1st);
lseekset(_fh, 0);

View File

@@ -81,7 +81,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
scn = NULL;
// Open complete msgbase, create if none exists
if(NOT fexist(AddPath(path, __HUDSON ? "msghdr" HUDS_EXT : "msghdr" GOLD_EXT))) {
if(not fexist(AddPath(path, __HUDSON ? "msghdr" HUDS_EXT : "msghdr" GOLD_EXT))) {
WideLog->printf("* Creating new msgbase at %s", path);
raw_open(O_CREAT);
if(filelength(fhinf) == 0) {
@@ -108,7 +108,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
long _hdrsize = filelength(fhhdr)/(long)sizeof(HudsHdr);
long _idxsize = filelength(fhidx)/(long)sizeof(HudsIdx);
long _toisize = filelength(fhtoi)/(long)sizeof(HudsToIdx);
if((_hdrsize != _idxsize) OR (_hdrsize != _toisize)) {
if((_hdrsize != _idxsize) or (_hdrsize != _toisize)) {
raw_close();
HGWarnRebuild();
WideLog->ErrIndex();
@@ -137,7 +137,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
ra2usersbbs = 2;
// If it matches both of them
if(hudsmatch AND ra2match) {
if(hudsmatch and ra2match) {
// Check version in CONFIG.RA to make sure
Path rapath, file;
@@ -158,7 +158,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
}
// If it does not match either of them
if(NOT hudsmatch AND NOT ra2match) {
if(not hudsmatch and not ra2match) {
WideLog->ErrIndex();
WideLog->printf("! The users.bbs file has an incorrect size.");
WideLog->printf(": %susers.bbs, %lu bytes.", path, len);
@@ -200,7 +200,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
if(userno == -1) {
user->fh = fhusr;
user->find(_username);
if(NOT user->found) {
if(not user->found) {
WideLog->printf("* User \"%s\" not found in %susers%s.", _username, path, __HUDSON ? HUDS_EXT : GOLD_EXT);
user->add(_username);
WideLog->printf("* Now added with user number %u.", user->index);

View File

@@ -206,7 +206,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::lock() {
GFTRK("HudsLock");
if(NOT islocked AND WideCanLock) {
if(not islocked and WideCanLock) {
long _tries = 0;
@@ -251,7 +251,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::unlock() {
GFTRK("HudsUnlock");
if(islocked AND WideCanLock) {
if(islocked and WideCanLock) {
::unlock(fhinf, sizeof(HudsInfo)+1, 1);
islocked = false;
}
@@ -317,7 +317,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan() {
if(_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO)) {
register int _idxboard = _msgidx_ptr->board;
if(_idxboard AND (_idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD))) {
if(_idxboard and (_idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD))) {
_scan = scn + (_idxboard - 1);
@@ -326,11 +326,11 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan() {
_scan->count++;
// Set first message number
if(NOT _scan->firstmsgno)
if(not _scan->firstmsgno)
_scan->firstmsgno = _scan->lastmsgno;
// Set lastread pointer
if((_scan->lastmsgno >= _scan->lastread) AND (_scan->lastreadreln == 0)) {
if((_scan->lastmsgno >= _scan->lastread) and (_scan->lastreadreln == 0)) {
_scan->lastreadfound = _scan->lastmsgno;
_scan->lastreadreln = _scan->count - (_scan->lastmsgno != _scan->lastread ? 1 : 0);
}
@@ -358,7 +358,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan() {
while(_board < (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)) {
// Check/fix lastreads
if(_scan->count AND (_scan->lastreadfound != _scan->lastread)) {
if(_scan->count and (_scan->lastreadfound != _scan->lastread)) {
if(_scan->lastread > _scan->lastmsgno)
_scan->lastreadreln = _scan->count;
else if(_scan->lastread < _scan->firstmsgno)
@@ -403,7 +403,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
if(!wide)
wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide);
if(wide->iswideopen AND NOT wide->iswidescanned)
if(wide->iswideopen and not wide->iswidescanned)
wide->scan();
// Get wide scan data if any
@@ -419,7 +419,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
// Open the msgbase if it wasn't already
int _was_open = wide->isopen;
if(NOT _was_open)
if(not _was_open)
wide->open();
// Get the number of active msgs in the area
@@ -448,14 +448,14 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
while(_msgidx_count < _msgidx_total) {
// Is it our board and is the msg not deleted?
if((_msgidx_ptr->board == _board) AND (_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO))) {
if((_msgidx_ptr->board == _board) and (_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO))) {
// Get message number
_lastmsgno = _msgidx_ptr->msgno;
_msg_count++;
// Set first message number
if(NOT _firstmsgno)
if(not _firstmsgno)
_firstmsgno = _lastmsgno;
// Transfer data to the index
@@ -463,7 +463,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
*_msgno_ptr++ = _lastmsgno;
// Set lastread pointer
if((_lastmsgno >= _lastread) AND (_lastread_reln == 0)) {
if((_lastmsgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _lastmsgno;
_lastread_reln = _msg_count - (_lastmsgno != _lastread ? 1 : 0);
}
@@ -479,7 +479,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
}
// If the exact lastread was not found
if(_msg_count AND (_lastreadfound != _lastread)) {
if(_msg_count and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -514,7 +514,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
}
// Close the msgbase again if we opened it in here
if(NOT _was_open)
if(not _was_open)
wide->close();
}
@@ -572,7 +572,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan_pm() {
GFTRK("HudsWideScanPM");
if(NOT iswidescanned)
if(not iswidescanned)
scan();
ispmscanned = true;
@@ -602,7 +602,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan_pm() {
// Skip msgs in invalid boards
idxboard = idxptr->board;
if(NOT(idxboard AND (idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)))) {
if(not (idxboard and (idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)))) {
invalidboards++;
continue;
}
@@ -669,7 +669,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan_area_pm()
if(!wide)
wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide);
if(wide->iswideopen AND NOT wide->ispmscanned)
if(wide->iswideopen and not wide->ispmscanned)
wide->scan_pm();
// Get wide scan data if any

View File

@@ -103,7 +103,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
// Lock msgbase before doing anything
int _was_locked = wide->islocked;
if(NOT _was_locked)
if(not _was_locked)
lock();
// Find header index
@@ -175,7 +175,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
// If the msg is new or the text is too large to fit
uint _txtlen = strlen(__msg->txt)+1;
if((__mode & GMSG_NEW) OR (_txtlen > ((long)__msg->txtlength*255L)))
if((__mode & GMSG_NEW) or (_txtlen > ((long)__msg->txtlength*255L)))
__hdr.startrec = (msgn_t)(filelength(wide->fhtxt)/256L);
// Calculate the number of text records to write
@@ -270,9 +270,9 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
write(wide->fhinf, &wide->msginfo, sizeof(HudsInfo));
// Update scanning files
if((__hdr.msgattr & HUDS_NETTRANS) OR (__mode & GMSG_DELETE))
if((__hdr.msgattr & HUDS_NETTRANS) or (__mode & GMSG_DELETE))
wide->update_netecho(__HUDSON ? "netmail" HUDS_EXT : "netmail" GOLD_EXT, _hdridx, __hdr.msgattr & HUDS_DELETED);
if((__hdr.msgattr & HUDS_ECHOTRANS) OR (__mode & GMSG_DELETE))
if((__hdr.msgattr & HUDS_ECHOTRANS) or (__mode & GMSG_DELETE))
wide->update_netecho(__HUDSON ? "echomail" HUDS_EXT : "echomail" GOLD_EXT, _hdridx, __hdr.msgattr & HUDS_DELETED);
if(__mode & GMSG_NEW) {
@@ -285,7 +285,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
}
// Unlock msgbase after use
if(NOT _was_locked)
if(not _was_locked)
unlock();
GFTRK(NULL);

View File

@@ -69,7 +69,7 @@ int JamArea::test_open(const char* file) {
if(fh == -1) {
// Tell the world
if((errno != EACCES) OR (PopupLocked(++tries, false, file) == false)) {
if((errno != EACCES) or (PopupLocked(++tries, false, file) == false)) {
WideLog->ErrOpen();
raw_close();
WideLog->printf("! A JAM msgbase file could not be opened.");
@@ -100,7 +100,7 @@ void JamArea::raw_open() {
sprintf(file, "%s.jhr", path()); data->fhjhr = test_open(file);
sprintf(file, "%s.jdx", path()); data->fhjdx = test_open(file);
sprintf(file, "%s.jlr", path()); data->fhjlr = test_open(file);
if(NOT just_scanning) {
if(not just_scanning) {
sprintf(file, "%s.jdt", path()); data->fhjdt = test_open(file);
if(not jamwide->smapihw) {
sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
@@ -182,7 +182,7 @@ void JamArea::open_area() {
}
// If user was not found, init the lastread with our values
if(NOT founduser) {
if(not founduser) {
data->lastrec.usercrc = wide->usercrc;
data->lastrec.userid = wide->userid;
data->lastrec.lastread = 0;
@@ -203,8 +203,8 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
// Open the msgbase if it wasn't already
int _was_open = isopen;
if(NOT _was_open) {
if(NOT __keep_index OR __scanpm)
if(not _was_open) {
if(not __keep_index or __scanpm)
just_scanning = true;
isopen++;
data_open();
@@ -241,14 +241,14 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
register JamIndex* _jdxptr = _jdxbuf;
// Fill message index
while(_msgno<_total) {
while(_msgno < _total) {
if(_jdxptr->hdroffset != 0xFFFFFFFFL) {
_active++;
if(NOT _firstmsgno)
if(not _firstmsgno)
_firstmsgno = _msgno;
if(__keep_index)
*_msgndxptr++ = _msgno;
if((_msgno >= _lastread) AND (_lastread_reln == 0)) {
if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno;
_lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0));
}
@@ -259,7 +259,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -298,8 +298,8 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
JamHdr hdr;
lseekset(data->fhjhr, idx->hdroffset);
read(data->fhjhr, &hdr, sizeof(JamHdr));
if(NOT (hdr.attribute & JAMATTR_READ)) {
if(NOT (hdr.attribute & JAMATTR_DELETED)) {
if(not (hdr.attribute & JAMATTR_READ)) {
if(not (hdr.attribute & JAMATTR_DELETED)) {
PMrk->Append(hdr.messagenumber);
}
}
@@ -328,7 +328,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
throw_free(_jdxbuf);
// Close the msgbase again if we opened it in here
if(NOT _was_open) {
if(not _was_open) {
raw_close();
data_close();
isopen--;

View File

@@ -89,8 +89,8 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
__msg->attr.lok(__hdr.attribute & JAMATTR_LOCKED);
__msg->attr.del(__hdr.attribute & JAMATTR_DELETED);
if(isnet() OR isecho())
__msg->attr.uns(__msg->attr.loc() AND NOT __msg->attr.snt());
if(isnet() or isecho())
__msg->attr.uns(__msg->attr.loc() and not __msg->attr.snt());
else
__msg->attr.uns0();
@@ -140,7 +140,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
switch(_subfieldptr->loid) {
case JAMSUB_OADDRESS:
if(NOT _got_oaddr) {
if(not _got_oaddr) {
_got_oaddr = true;
__msg->oorig.set(_buf, __msg->odom);
__msg->orig = __msg->oorig;
@@ -161,7 +161,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
break;
case JAMSUB_DADDRESS:
if(NOT _got_daddr) {
if(not _got_daddr) {
_got_daddr = true;
__msg->odest.set(_buf, __msg->ddom);
__msg->dest = __msg->odest;
@@ -184,7 +184,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
__msg->msgid.reset_fast();
if(atoi(__msg->msgids)) {
__msg->msgid.set(__msg->msgids, __msg->odom);
if(__msg->msgid.net AND (__msg->orig.net == 0))
if(__msg->msgid.net and (__msg->orig.net == 0))
__msg->orig = __msg->msgid;
}
break;
@@ -304,10 +304,10 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
throw_free(_subfield);
// Get reply numbers in chain
if(wide->lookreplies AND __msg->link.first()) {
if(wide->lookreplies and __msg->link.first()) {
int r = 0;
ulong m = __msg->link.first();
while(m AND (r<__msg->link.list_max())) {
while(m and (r < __msg->link.list_max())) {
JamHdr _rhdr;
memset(&_rhdr, 0, sizeof(JamHdr));
lseekset(data->fhjdx, m-data->hdrinfo.basemsgnum, sizeof(JamIndex));

View File

@@ -40,7 +40,7 @@ void JamArea::lock() {
GFTRK("JamArea::lock");
if(NOT data->islocked AND WideCanLock) {
if(not data->islocked and WideCanLock) {
long _tries = 0;
@@ -121,7 +121,7 @@ void JamArea::add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word _
void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
int _was_locked = data->islocked;
if(NOT _was_locked)
if(not _was_locked)
lock();
// Reset header
@@ -138,7 +138,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
// Get message text size
char* _txtcpy = NULL;
if(__msg->txt AND (__mode & GMSG_TXT)) {
if(__msg->txt and (__mode & GMSG_TXT)) {
// Work on a copy of the original msg text
_txtcpy = throw_strdup(__msg->txt);
@@ -368,7 +368,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
// Delete msg if requested
if(__mode & GMSG_DELETE) {
if(NOT was_deleted)
if(not was_deleted)
data->hdrinfo.activemsgs--;
__hdr.attribute |= JAMATTR_DELETED;
_idx.usercrc = 0xFFFFFFFFL;
@@ -447,7 +447,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
scan();
}
if(NOT _was_locked) {
if(not _was_locked) {
lseekset(data->fhjhr, 0);
write(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo));
unlock();

View File

@@ -140,7 +140,7 @@ void PcbInit(const char* path, int userno) {
pcbwide->user->usershdrsize = pcbwide->usershdrsize;
if(pcbwide->userno == -1) {
pcbwide->user->find(_username);
if(NOT pcbwide->user->found) {
if(not pcbwide->user->found) {
pcbwide->userno = 0;
//WideLog->printf("* User \"%s\" not found in %sUSERS.", _username, _path);
//pcbwide->user->add(_username);

View File

@@ -97,7 +97,7 @@ void PcbWideOpen() {
GFTRK("PcbWideOpen");
if(NOT pcbwide->isopen) {
if(not pcbwide->isopen) {
pcbwide->fhusr = PcbWideTestOpen(pcbwide->users);
pcbwide->fhinf = PcbWideTestOpen(pcbwide->usersinf);
@@ -201,7 +201,7 @@ void PcbArea::raw_open() {
GFTRK("PcbRawOpen");
if(NOT just_scanning)
if(not just_scanning)
data->fhmsg = test_open(path());
data->fhidx = test_open(AddPath(path(), ".idx"));
@@ -217,8 +217,8 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
// Open the msgbase if it wasn't already
int _was_open = isopen;
if(NOT _was_open) {
if(NOT __keep_index)
if(not _was_open) {
if(not __keep_index)
just_scanning = true;
isopen++;
data_open();
@@ -227,7 +227,7 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
}
int _was_wideopen = wide->isopen;
if(NOT _was_wideopen)
if(not _was_wideopen)
PcbWideOpen();
// Load the base header
@@ -272,11 +272,11 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
if(_idxptr->offset > 0) {
_active++;
_lastmsgno = _idxptr->num;
if(NOT _firstmsgno)
if(not _firstmsgno)
_firstmsgno = _lastmsgno;
if(__keep_index)
*_msgndxptr++ = _lastmsgno;
if((_lastmsgno >= _lastread) AND (_lastread_reln == 0)) {
if((_lastmsgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _lastmsgno;
_lastread_reln = (uint)(_active - (_lastmsgno != _lastread ? 1 : 0));
}
@@ -285,7 +285,7 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -338,11 +338,11 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
// Free the .IDX buffer
throw_free(_idxbuf);
if(NOT _was_wideopen)
if(not _was_wideopen)
PcbWideClose();
// Close the msgbase again if we opened it in here
if(NOT _was_open) {
if(not _was_open) {
raw_close();
data_close();
isopen--;

View File

@@ -55,10 +55,10 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Convert attributes
__msg->pcboard.status = __hdr.status;
if(NOT islocal())
if(not islocal())
__msg->attr.uns(__hdr.date[5] != '\xC4');
__msg->attr.pvt(__hdr.status == '*' OR __hdr.status == '+');
__msg->attr.rcv(__hdr.status == '+' OR __hdr.status == '-' OR __hdr.status == '`' OR __hdr.status == '^' OR __hdr.status == '#');
__msg->attr.pvt((__hdr.status == '*') or (__hdr.status == '+'));
__msg->attr.rcv((__hdr.status == '+') or (__hdr.status == '-') or (__hdr.status == '`') or (__hdr.status == '^') or (__hdr.status == '#'));
__msg->attr.del(__hdr.activestatus == 226);
__msg->pcboard.exthdrflags = __hdr.exthdrflags;
@@ -104,7 +104,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Read the message text, trim spaces and translate PCB linefeeds
read(data->fhmsg, _tmptxt, _msgsize);
strtrim(_tmptxt);
if(NOT wide->foreign)
if(not wide->foreign)
strchg(_tmptxt, 0xE3, 0x0D);
//int _line = 0;
@@ -138,7 +138,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Get address and attribute from FidoPCB
if(isnet()) {
_line++;
if((_line == 1) AND (*_begline == '(' /*)*/)) {
if((_line == 1) and (*_begline == '(' /*)*/)) {
Addr _addr;
_addr.ResetFast();
char* _ptr = _begline + 1;
@@ -148,7 +148,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
_ptr += 5;
}
_addr.set(strskip_wht(_ptr));
if(NOT _incoming AND strieql(__msg->by, WideUsername[0])) {
if(not _incoming and strieql(__msg->by, WideUsername[0])) {
__msg->dest = _addr;
__msg->odest = _addr;
}
@@ -157,7 +157,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
__msg->oorig = _addr;
}
}
else if((_line == 2) AND (*_begline == '(' /*)*/)) {
else if((_line == 2) and (*_begline == '(' /*)*/)) {
_src[-1] = NUL;
if(striinc("HOLD", _begline))
__msg->attr.hld1();
@@ -184,7 +184,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
if(*_eto)
strxcpy(__msg->to, _eto, sizeof(__msg->to));
if(isnet() AND NOT isemail()) {
if(isnet() and not isemail()) {
char* ptr = strchr(__msg->by, '@');
if(ptr) {
*ptr++ = NUL;
@@ -226,7 +226,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
throw_free(_tmptxt);
if(NOT(__mode & GMSG_TXT))
if(not (__mode & GMSG_TXT))
throw_release(__msg->txt);
GFTRK(NULL);

View File

@@ -41,7 +41,7 @@ void PcbArea::lock() {
GFTRK("PcbLock");
if(NOT data->islocked) {
if(not data->islocked) {
if(WideCanLock) {
long _tries = 0;
while(::lock(data->fhmsg, 16, 6) == -1) {
@@ -78,7 +78,7 @@ void PcbArea::unlock() {
GFTRK("PcbUnlock");
if(WideCanLock AND data->islocked)
if(WideCanLock and data->islocked)
::unlock(data->fhmsg, 16, 6);
lseekset(data->fhmsg, 0);
memset(data->base.locked, ' ', 6);
@@ -101,7 +101,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Lock and refresh base
int _was_locked = data->islocked;
if(NOT _was_locked)
if(not _was_locked)
lock();
// Reset header
@@ -145,7 +145,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
}
}
else {
if(_status AND NOT _pvt)
if(_status and not _pvt)
__hdr.status = _status;
else if(_pvt)
__hdr.status = '*';
@@ -154,19 +154,18 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
}
_idx.status = __hdr.status;
__hdr.activestatus = (__mode & GMSG_DELETE) ? '\xE2' : '\xE1';
__hdr.echoed = ((isnet() OR isecho()) AND NOT isinternet()) ? 'E' : ' ';
__hdr.echoed = ((isnet() or isecho()) and not isinternet()) ? 'E' : ' ';
// Convert dates and times
char _dtbuf[9];
struct tm* _tm = gmtime(&__msg->written);
memcpy(__hdr.date, strftimei(_dtbuf, 9, __msg->attr.uns() ? "%d-%m-%y" : "%d-%m\xC4%y", _tm), 8);
memcpy(__hdr.time, strftimei(_dtbuf, 6, "%H:%M", _tm), 5);
int _year = _tm->tm_year % 100;
_idx.date = (word)YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday);
_idx.date = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
if(__msg->link.first()) {
__hdr.hasreply = 'R';
_tm = gmtime(&__msg->pcboard.reply_written);
_year = _tm->tm_year % 100;
int _year = _tm->tm_year % 100;
__hdr.replydate = L2B((10000L*_year) + (100L*(_tm->tm_mon+1)) + _tm->tm_mday);
memcpy(__hdr.replytime, strftimei(_dtbuf, 6, "%H:%M", _tm), 5);
}
@@ -216,11 +215,11 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
uint _txtlen = 0;
if(__mode & GMSG_TXT) {
__msg->txtlength = _txtlen = strlen(__msg->txt);
if((_tolen > 25) OR isnet()) {
if((_tolen > 25) or isnet()) {
__msg->txtlength += sizeof(PcbExtHdr);
__hdr.exthdrflags |= 0x01;
}
if((_bylen > 25) OR isnet()) {
if((_bylen > 25) or isnet()) {
__msg->txtlength += sizeof(PcbExtHdr);
__hdr.exthdrflags |= 0x02;
}
@@ -230,7 +229,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
}
// Translate msg text to PCB linefeeds if running non-foreign system
if(NOT wide->foreign)
if(not wide->foreign)
strchg(__msg->txt, 0x0D, 0xE3);
// Calculate new number of blocks
@@ -256,7 +255,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
uint _txtlenwritten = 0;
// Write extended headers
if((_tolen > 25) OR isnet()) {
if((_tolen > 25) or isnet()) {
PcbExtHdr _ehdr;
_ehdr.id = 0x40FF;
_ehdr.colon = ':';
@@ -275,7 +274,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
_txtlenwritten += sizeof(PcbExtHdr);
}
}
if((_bylen > 25) OR isnet()) {
if((_bylen > 25) or isnet()) {
PcbExtHdr _ehdr;
_ehdr.id = 0x40FF;
_ehdr.colon = ':';
@@ -326,7 +325,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
int _imm = __msg->attr.imm();
int _cra = __msg->attr.cra();
int _zon = __msg->attr.zon();
if(_hld OR _imm OR _cra OR _zon) {
if(_hld or _imm or _cra or _zon) {
strcpy(_sbuf, "(" /*)*/);
if(_hld)
strcat(_sbuf, "HOLD,");
@@ -357,22 +356,22 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
}
// Translate back
if(NOT wide->foreign)
if(not wide->foreign)
strchg(__msg->txt, 0xE3, 0x0D);
}
if(NOT(__mode & GMSG_DELETE)) {
if(not (__mode & GMSG_DELETE)) {
// Set the mail waiting flag
int _status = true;
// Reset it if the msg is being received
if((__mode & GMSG_UPDATE) AND __msg->attr.rcv())
if((__mode & GMSG_UPDATE) and __msg->attr.rcv())
_status = false;
// Don't touch the flag if the msg was already received
if(NOT (_status AND __msg->attr.rcv()))
if(not (_status and __msg->attr.rcv()))
pcbwide->user->update_mail_waiting(__msg->to, board(), _status);
}
if((__mode & GMSG_TXT) AND (__mode & GMSG_UPDATE)) {
if((__mode & GMSG_TXT) and (__mode & GMSG_UPDATE)) {
__msg->msgno = oldmsgno;
__msg->txtstart = oldtxtstart;
__msg->txtlength = oldtxtlength;
@@ -380,7 +379,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
}
// Unlock and update base
if(NOT _was_locked)
if(not _was_locked)
unlock();
GFTRK(NULL);

View File

@@ -122,7 +122,7 @@ void XbbsWideClose();
// ------------------------------------------------------------------
// When not in OS/2, use DUMMY AdeptXBBS functions
#if not defined(__OS2__)
#if !defined(__OS2__)
#ifndef GMB_NOXBBS
inline void XbbsInit(const char*, int) { }

View File

@@ -93,7 +93,7 @@ void SquishInit(const char* userpath, int userno, int direct, int recycle, int s
squishwide->user->fh = ::sopen(userfile, O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(squishwide->user->fh != -1) {
squishwide->user->find(_username);
if(NOT squishwide->user->found) {
if(not squishwide->user->found) {
WideLog->printf("* User \"%s\" not found in %s.", _username, userfile);
squishwide->user->add(_username);
WideLog->printf("* Now added with user number %u.", squishwide->user->index);

View File

@@ -93,7 +93,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
}
// Open Squish files for scanning unless they are already open
if(NOT isopen) {
if(not isopen) {
data->idx = NULL;
data->base.totalmsgs = 0;
@@ -108,7 +108,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
// If there appear to be only one record, experience shows that
// there may in fact be zero! So check the *.SQD base record for
// the exact number of msgs in this case or if requested.
if((data->base.totalmsgs == 1) OR (wide->squishscan == SQS_API)) {
if((data->base.totalmsgs == 1) or (wide->squishscan == SQS_API)) {
// Open, read and close data file
data->fhsqd = ::sopen(AddPath(path(), ".sqd"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
@@ -157,9 +157,9 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
*_msgndxptr++ = _msgno;
// Check for premature end of index (free frames)
if((_msgno <= _lastmsgno) OR (_msgno == 0xFFFFFFFFL)) {
if((_msgno <= _lastmsgno) or (_msgno == 0xFFFFFFFFL)) {
_active--;
if((_msgno == _lastmsgno) AND _active == 1) {
if((_msgno == _lastmsgno) and (_active == 1)) {
_lastread_reln = 0;
_active = 0;
}
@@ -167,7 +167,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
}
// Get the lastread
if((_msgno >= _lastread) AND (_lastread_reln == 0)) {
if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno;
_lastread_reln = _active - (_msgno != _lastread ? 1 : 0);
}
@@ -177,7 +177,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)

View File

@@ -71,15 +71,15 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
read(_fhsqd, _src, (uint)_frm.ctlsize);
// Convert Squish control info to true kludges
while(*_src AND (*_src == CTRL_A) AND _src[1]) {
while(*_src and (*_src == CTRL_A) and _src[1]) {
// Copy the kludge char unless it's the AREA: line
if(NOT ((*(dword*)(_src+1) == CHR4_AREA) AND strneql(_src+1, "AREA:", 5)))
if(not ((*(dword*)(_src+1) == CHR4_AREA) and strneql(_src+1, "AREA:", 5)))
*_dest++ = *_src;
_src++;
// Copy the rest of the kludge and add a CR termination
while((*_src != CTRL_A) AND *_src)
while((*_src != CTRL_A) and *_src)
*_dest++ = *_src++;
*_dest++ = CR;
}
@@ -156,7 +156,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
__msg->attr.lok(__hdr.attr & MSGLOK);
if(isnet()) {
__msg->attr.uns(__msg->attr.loc() AND NOT __msg->attr.snt());
__msg->attr.uns(__msg->attr.loc() and not __msg->attr.snt());
if(wide->direct and __msg->attr.hld() and __msg->attr.cra()) {
// Translate hld+cra to dir attribute
__msg->attr.dir1();
@@ -165,7 +165,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
}
}
else if(isecho())
__msg->attr.uns(__msg->attr.loc() AND ((__hdr.attr & MSGSCANNED) ? 0 : 1));
__msg->attr.uns(__msg->attr.loc() and ((__hdr.attr & MSGSCANNED) ? 0 : 1));
else
__msg->attr.uns0();

View File

@@ -42,7 +42,7 @@ void SquishArea::lock() {
GFTRK("SquishLock");
if(NOT data->islocked) {
if(not data->islocked) {
if(WideCanLock) {
long _tries = 0;
while(::lock(data->fhsqd, 0, 1) == -1) {
@@ -72,7 +72,7 @@ void SquishArea::unlock() {
GFTRK("SquishUnlock");
if(WideCanLock AND data->islocked)
if(WideCanLock and data->islocked)
::unlock(data->fhsqd, 0, 1);
lseekset(data->fhsqd, 0);
write(data->fhsqd, &data->base, sizeof(SqshBase));
@@ -164,7 +164,7 @@ void SquishArea::delete_msg(uint __reln) {
GFTRK("SquishDeleteMsg");
int _was_locked = data->islocked;
if(NOT _was_locked)
if(not _was_locked)
lock();
// Setup some local variables for speed
@@ -203,7 +203,7 @@ void SquishArea::delete_msg(uint __reln) {
if(lastread)
lastread--;
if(NOT _was_locked)
if(not _was_locked)
unlock();
GFTRK(NULL);
@@ -342,10 +342,10 @@ uint SquishArea::find_msgn(ulong __tagn) {
register SqshIdx* tag = data->idx;
register uint tags = (uint)data->base.totalmsgs;
if(__tagn AND tags AND (__tagn > tag[tags-1].msgno))
if(__tagn and tags and (__tagn > tag[tags-1].msgno))
return 0;
if(tags AND __tagn) {
if(tags and __tagn) {
register long _mid;
register long _left = 0;
@@ -462,7 +462,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
SqshFrm _oldfrm, _newfrm;
dword _newframe = SQFRAME_NULL;
dword _oldframe = _idx ? _idx[_reln].offset : _base.endframe;
if(NOT(__mode & GMSG_NEW)) {
if(not (__mode & GMSG_NEW)) {
// Get the original frame and see if there is still room for the msg
read_frm(_oldframe, &_oldfrm);
@@ -477,7 +477,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
// If there is a max msgs limit and are we writing a new
// msg, delete msgs to (hopefully) make room for this msg
if(_base.maxmsgs AND (__mode & GMSG_NEW))
if(_base.maxmsgs and (__mode & GMSG_NEW))
while(_base.maxmsgs <= _base.totalmsgs)
delete_msg((uint)_base.protmsgs);

View File

@@ -88,7 +88,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
}
// Open WildCat! files for scanning unless they are already open
if(NOT isopen) {
if(not isopen) {
data->idx = NULL;
data->base.recsize = 0;
@@ -131,13 +131,13 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
_active++;
_msgno = (_ixptr++)->msgno;
if(NOT _firstmsgno)
if(not _firstmsgno)
_firstmsgno = _msgno;
if(__keep_index)
*_msgndxptr++ = _msgno;
// Get the lastread
if((_msgno >= _lastread) AND (_lastread_reln == 0)) {
if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno;
_lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0));
}
@@ -147,7 +147,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -168,7 +168,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
}
// Free index buffer if just counting
if(NOT __keep_index OR __scanpm)
if(not __keep_index or __scanpm)
throw_release(data->idx);
if(_was_data == NULL) {

View File

@@ -90,13 +90,13 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
__msg->written = __msg->arrived = __msg->received = 0;
if(__hdr.msgdate AND __hdr.msgtime) {
if(__hdr.msgdate and __hdr.msgtime) {
JDN2YMD(__hdr.msgdate+1, &_year, &_month, &_day);
_time = __hdr.msgtime-1;
_hour = (unsigned)(_time / 3600L);
_minute = (unsigned)((_time % 3600L) / 60L);
_second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*60L));
_tm.tm_year = _year;
_tm.tm_year = _year - 1900;
_tm.tm_mon = _month - 1;
_tm.tm_mday = _day;
_tm.tm_hour = _hour;
@@ -110,13 +110,13 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
__msg->written = a + a - b;
}
if(__hdr.readdate AND __hdr.readtime) {
if(__hdr.readdate and __hdr.readtime) {
JDN2YMD(__hdr.readdate+1, &_year, &_month, &_day);
_time = __hdr.readtime-1;
_hour = (unsigned)(_time / 3600L);
_minute = (unsigned)((_time % 3600L) / 60L);
_second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*60L));
_tm.tm_year = _year;
_tm.tm_year = _year - 1900;
_tm.tm_mon = _month - 1;
_tm.tm_mday = _day;
_tm.tm_hour = _hour;

View File

@@ -41,7 +41,7 @@ void WCatArea::lock() {
GFTRK("WCatLock");
if(NOT data->islocked) {
if(not data->islocked) {
if(WideCanLock) {
long _tries = 0;
while(::lock(data->fhix, 0, 1) == -1) {
@@ -70,7 +70,7 @@ void WCatArea::lock() {
void WCatArea::unlock() {
GFTRK("WCatUnlock");
if(WideCanLock AND data->islocked)
if(WideCanLock and data->islocked)
::unlock(data->fhix, 0, 1);
data->islocked = false;
@@ -83,7 +83,7 @@ void WCatArea::unlock() {
void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
int _was_locked = data->islocked;
if(NOT _was_locked)
if(not _was_locked)
lock();
memset(&__hdr, 0, sizeof(WCatHdr));
@@ -114,21 +114,19 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
strc2p(strxcpy(__hdr.subject, __msg->re, sizeof(__hdr.subject)));
if(!*__msg->wildcat.network AND (isnet() OR isecho()))
if(not *__msg->wildcat.network and (isnet() or isecho()))
strcpy(__msg->wildcat.network, "FTSC");
strc2p(strcpy(__hdr.network, __msg->wildcat.network));
if(__msg->written) {
struct tm* _tm = gmtime(&__msg->written);
int _year = _tm->tm_year % 100;
__hdr.msgdate = (word)(YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday)-1);
__hdr.msgdate = (word)(YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday)-1);
__hdr.msgtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1;
}
if(__msg->received) {
struct tm* _tm = gmtime(&__msg->received);
int _year = _tm->tm_year % 100;
__hdr.readdate = (word)YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readdate = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1;
}
@@ -198,7 +196,7 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
n++;
}
if((__mode & GMSG_NEW) OR (_size > __hdr.msgbytes)) {
if((__mode & GMSG_NEW) or (_size > __hdr.msgbytes)) {
if(_size > __hdr.msgbytes) {
ulong _magic = MagicHeaderInactive;
lseekset(data->fhdat, data->idx[_reln].offset);
@@ -220,7 +218,7 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
throw_free(_txt);
}
if(NOT _was_locked)
if(not _was_locked)
unlock();
GFTRK(NULL);

View File

@@ -253,7 +253,7 @@ extern int xbbsdatano;
// ------------------------------------------------------------------
#if not defined(__OS2__)
#if !defined(__OS2__)
inline void XbbsArea::open() { }
inline void XbbsArea::save_lastread() { }
inline void XbbsArea::close() { }

View File

@@ -169,7 +169,7 @@ void XbbsInit(const char* path, int userno) {
xbbswide->user->fh = ::sopen(AddPath(xbbswide->path, "Users"), O_RDONLY|O_BINARY, WideSharemode);
if(xbbswide->user->fh != -1) {
xbbswide->user->find(_username);
if(NOT xbbswide->user->found) {
if(not xbbswide->user->found) {
xbbswide->userno = 0;
//WideLog->printf("* User \"%s\" not found in %sUsers.", _username, xbbswide->path);
//xbbswide->user->add(_username);

View File

@@ -98,7 +98,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
}
// Open AdeptXBBS files for scanning unless they are already open
if(NOT isopen) {
if(not isopen) {
data->idx = NULL;
data->idx_size = 0;
@@ -138,13 +138,13 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
_active++;
_msgno = _active;
if(NOT _firstmsgno)
if(not _firstmsgno)
_firstmsgno = _msgno;
if(__keep_index)
*_msgndxptr++ = _msgno;
// Get the lastread
if((_msgno >= _lastread) AND (_lastread_reln == 0)) {
if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno;
_lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0));
}
@@ -154,7 +154,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
}
// If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) {
if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest?
if(_lastread > _lastmsgno)
@@ -175,7 +175,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
}
// Free index buffer if just counting
if(NOT __keep_index OR __scanpm)
if(not __keep_index or __scanpm)
throw_release(data->idx);
if(_was_data == NULL) {

View File

@@ -118,13 +118,13 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
// Set the unsent attribute
#if 0
if(isnet())
__msg->attr.uns((__msg->attr.loc() AND NOT __msg->attr.snt()) OR (__hdr.xflags & XFLAGS_MSGNET));
__msg->attr.uns((__msg->attr.loc() and not __msg->attr.snt()) or (__hdr.xflags & XFLAGS_MSGNET));
else
__msg->attr.uns(__hdr.xflags & XFLAGS_MSGECHO);
#endif
if(isnet() OR isecho())
__msg->attr.uns(NOT(__hdr.xflags & XFLAGS_MSGSCANNED));
if(isnet() or isecho())
__msg->attr.uns(not (__hdr.xflags & XFLAGS_MSGSCANNED));
__msg->adeptxbbs.iflags = __hdr.iflags;
__msg->adeptxbbs.oflags = __hdr.oflags;

View File

@@ -182,7 +182,7 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
__hdr.xflags |= (ushort)(__msg->attr.arc() ? XFLAGS_MSGARCHIVED : 0);
__hdr.xflags |= (ushort)(__msg->attr.tag() ? XFLAGS_MSGTAGGED : 0);
if(NOT (__mode & GMSG_UPDATE)) {
if(not (__mode & GMSG_UPDATE)) {
if(__msg->attr.uns()) {
__hdr.xflags &= ~(XFLAGS_MSGSCANNED|XFLAGS_MSGGSCAN|XFLAGS_MSGRSCAN);
if(isnet())
@@ -212,7 +212,7 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
// Write the message text
uint _size = strlen(__msg->txt) + 1;
if((__mode & GMSG_NEW) OR (_size > __hdr.length))
if((__mode & GMSG_NEW) or (_size > __hdr.length))
__hdr.start = filelength(data->fhtext);
lseekset(data->fhtext, __hdr.start);
lock_file(data->fhtext, __hdr.start, 640L*1024L);
@@ -263,14 +263,14 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
unlock_file(data->fhindex, position, sizeof(XbbsIdx));
}
if(NOT(__mode & GMSG_DELETE)) {
if(not (__mode & GMSG_DELETE)) {
// Add/update personal mail record
int _addpm = true;
// Remove it if the msg is being received
if((__mode & GMSG_UPDATE) AND __msg->attr.rcv())
if((__mode & GMSG_UPDATE) and __msg->attr.rcv())
_addpm = false;
// Don't touch it if the msg was already received
if(NOT (_addpm AND __msg->attr.rcv())) {
if(not (_addpm and __msg->attr.rcv())) {
// Only do it if the person is on this BBS
if(wide->user->find(__msg->to))
update_personal_mail(__msg, __hdr, _addpm);
@@ -378,7 +378,7 @@ void XbbsArea::update_personal_mail(gmsg* __msg, XbbsHdr& __hdr, int __addpm) {
if(_pmirecs) {
lseekset(fh, 0);
::write(fh, _pmilist, sizeof(XbbsPmi)*_pmirecs);
if(_pmiptr AND !__addpm)
if(_pmiptr and not __addpm)
chsize(fh, sizeof(XbbsPmi)*_pmirecs);
::close(fh);
}