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

@ -12,6 +12,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, April xx 2001 Notes for GoldED+ 1.1.5, April xx 2001
______________________________________________________________________ ______________________________________________________________________
- Fixed Y2K bug in WildCat! and PCBoard bases.
- Fixed cursor position in XlatImport menu when Auto encoding - Fixed cursor position in XlatImport menu when Auto encoding
selected. selected.
@ -171,6 +173,7 @@ ______________________________________________________________________
@cdtime current time in MS_DateTimeFmt format @cdtime current time in MS_DateTimeFmt format
@fpgp either e-mail or name from "From" field @fpgp either e-mail or name from "From" field
@dpgp either e-mail or name from "To" field @dpgp either e-mail or name from "To" field
@osver operation system version
- Fixed bug in expanding fixed lenght macroses. - Fixed bug in expanding fixed lenght macroses.

View File

@ -21,7 +21,7 @@ To do:
* Try to save position in message after printing, changing xlat table, * Try to save position in message after printing, changing xlat table,
etc. etc.
* Major xlat/recode engine update (in progress). * Major xlat/recode engine update (in progress).
* CUI in /lnx and input prompts. * CUI in input prompts.
* Activating built-in MIME-QP convertor by key (on whole message). * Activating built-in MIME-QP convertor by key (on whole message).
* Postpone. * Postpone.
* Highlight up to 3 groups of users by different color. * Highlight up to 3 groups of users by different color.
@ -43,8 +43,6 @@ ______________________________________________________________________
To fix: To fix:
* UUdecoder not 100% reliable: any volunteers for uulib maintaining? * UUdecoder not 100% reliable: any volunteers for uulib maintaining?
* Adding e-mail's to addressbook from UUCP gated messages.
* QUOTEHARDTERM is always NO.
* Need some workarounds on -install feature under Linux (UNIX). * Need some workarounds on -install feature under Linux (UNIX).
* Win32 (only when runned under Win9x) version does not support case * Win32 (only when runned under Win9x) version does not support case
insensitive search of regexp's for high part of ASCII table. That's insensitive search of regexp's for high part of ASCII table. That's
@ -55,7 +53,6 @@ ______________________________________________________________________
Known wishes that not currently planned (any volunteers?): Known wishes that not currently planned (any volunteers?):
* FREQ catcher (not 100% reliable detects files)
* Interactive Twit-list edition. * Interactive Twit-list edition.
* Pass areaname, message number, etc. to external utility. * Pass areaname, message number, etc. to external utility.
* Hide empty areas / areas without new messages from arealist. * Hide empty areas / areas without new messages from arealist.

View File

@ -34,7 +34,7 @@
#ifndef GMB_NOEZY #ifndef GMB_NOEZY
#include <gmoezyc.h> #include <gmoezyc.h>
#endif #endif
#if not defined(GMB_NOHUDS) and not defined(GMB_NOGOLD) #if !defined(GMB_NOHUDS) && !defined(GMB_NOGOLD)
#include <gmohuds.h> #include <gmohuds.h>
#endif #endif
#ifndef GMB_NOJAM #ifndef GMB_NOJAM

View File

@ -207,7 +207,7 @@ void AreaList::AddNewArea(AreaCfg* aa) {
#endif #endif
#ifndef GMB_NOXBBS #ifndef GMB_NOXBBS
case MT_ADEPTXBBS: case MT_ADEPTXBBS:
#if not defined(__OS2__) #if !defined(__OS2__)
return; return;
#else #else
if(*aa->path == NUL) if(*aa->path == NUL)
@ -224,7 +224,7 @@ void AreaList::AddNewArea(AreaCfg* aa) {
#ifndef GMB_NOJAM #ifndef GMB_NOJAM
case MT_JAM: case MT_JAM:
#endif #endif
#if not defined(GMB_NOJAM) or not defined(GMB_NOSQSH) #if !defined(GMB_NOJAM) || !defined(GMB_NOSQSH)
if(*aa->path == NUL) if(*aa->path == NUL)
return; return;
MapPath(aa->path); MapPath(aa->path);

View File

@ -127,7 +127,7 @@ CmdKey DefaultKeyset[] = {
{ Key_C_U , KK_EditUnDelete , KT_E }, { Key_C_U , KK_EditUnDelete , KT_E },
{ Key_A_BS , KK_EditUndo , KT_E }, { Key_A_BS , KK_EditUndo , KT_E },
{ Key_A_Z , KK_EditZapQuoteBelow , KT_E }, { Key_A_Z , KK_EditZapQuoteBelow , KT_E },
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ Key_C_Ins , KK_EditCopy , KT_E }, { Key_C_Ins , KK_EditCopy , KT_E },
{ Key_S_Del , KK_EditCut , KT_E }, { Key_S_Del , KK_EditCut , KT_E },
{ Key_C_Del , KK_EditDelete , KT_E }, { Key_C_Del , KK_EditDelete , KT_E },
@ -366,7 +366,7 @@ tglobalkey globalkeys[] = {
{ CRC_HEADERTOGGLESCANNED , KK_HeaderToggleScanned , KT_H }, // 0x0459 { CRC_HEADERTOGGLESCANNED , KK_HeaderToggleScanned , KT_H }, // 0x0459
{ CRC_READTOGGLEHIDDEN , KK_ReadToggleHidden , KT_R }, // 0x04CE { CRC_READTOGGLEHIDDEN , KK_ReadToggleHidden , KT_R }, // 0x04CE
{ CRC_EDITIMPORTTEXT , KK_EditImportText , KT_E }, // 0x0586 { CRC_EDITIMPORTTEXT , KK_EditImportText , KT_E }, // 0x0586
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SEND , Key_S_End , 0 }, // 0x0590 { CRC_K_SEND , Key_S_End , 0 }, // 0x0590
#endif #endif
{ CRC_READGOTOPREVMSG , KK_ReadGotoPrevMsg , KT_R }, // 0x06D9 { CRC_READGOTOPREVMSG , KK_ReadGotoPrevMsg , KT_R }, // 0x06D9
@ -413,7 +413,7 @@ tglobalkey globalkeys[] = {
{ CRC_AREAABORT , KK_AreaAbort , KT_A }, // 0x1E02 { CRC_AREAABORT , KK_AreaAbort , KT_A }, // 0x1E02
{ CRC_READTOGGLEMARK , KK_ReadToggleMark , KT_R }, // 0x1E64 { CRC_READTOGGLEMARK , KK_ReadToggleMark , KT_R }, // 0x1E64
{ CRC_READFIDORENUMBER , KK_ReadFidoRenumber , KT_R }, // 0x1E7C { CRC_READFIDORENUMBER , KK_ReadFidoRenumber , KT_R }, // 0x1E7C
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SDEL , Key_S_Del , 0 }, // 0x1EB9 { CRC_K_SDEL , Key_S_Del , 0 }, // 0x1EB9
#endif #endif
{ CRC_EDITCOPY , KK_EditCopy , KT_E }, // 0x1F77 { CRC_EDITCOPY , KK_EditCopy , KT_E }, // 0x1F77
@ -491,7 +491,7 @@ tglobalkey globalkeys[] = {
{ CRC_K_AZ , Key_A_Z , 0 }, // 0x405A { CRC_K_AZ , Key_A_Z , 0 }, // 0x405A
{ CRC_K_ADEL , Key_A_Del , 0 }, // 0x40C0 { CRC_K_ADEL , Key_A_Del , 0 }, // 0x40C0
{ CRC_NODEMACRO , KK_NodeMacro , KT_N }, // 0x4129 { CRC_NODEMACRO , KK_NodeMacro , KT_N }, // 0x4129
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SUP , Key_S_Up , 0 }, // 0x4151 { CRC_K_SUP , Key_S_Up , 0 }, // 0x4151
#endif #endif
{ CRC_AREAGOTOFIRST , KK_AreaGotoFirst , KT_A }, // 0x41CB { CRC_AREAGOTOFIRST , KK_AreaGotoFirst , KT_A }, // 0x41CB
@ -552,7 +552,7 @@ tglobalkey globalkeys[] = {
{ CRC_EDITEXPORTTEXT , KK_EditExportText , KT_E }, // 0x5AED { CRC_EDITEXPORTTEXT , KK_EditExportText , KT_E }, // 0x5AED
{ CRC_EDITLOOKUPORIG , KK_EditLookupOrig , KT_E }, // 0x5AFB { CRC_EDITLOOKUPORIG , KK_EditLookupOrig , KT_E }, // 0x5AFB
{ CRC_AREAHEAT , KK_AreaHeat , KT_A }, // 0x5B15 { CRC_AREAHEAT , KK_AreaHeat , KT_A }, // 0x5B15
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SRIGHT , Key_S_Rgt , 0 }, // 0x5B1F { CRC_K_SRIGHT , Key_S_Rgt , 0 }, // 0x5B1F
#endif #endif
{ CRC_READGOTONEXTAREA , KK_ReadGotoNextArea , KT_R }, // 0x5B23 { CRC_READGOTONEXTAREA , KK_ReadGotoNextArea , KT_R }, // 0x5B23
@ -709,12 +709,12 @@ tglobalkey globalkeys[] = {
{ CRC_READQUITNOW , KK_ReadQuitNow , KT_R }, // 0xAC15 { CRC_READQUITNOW , KK_ReadQuitNow , KT_R }, // 0xAC15
{ CRC_HEADERTOGGLEUPDREQ , KK_HeaderToggleUpdreq , KT_H }, // 0xAC35 { CRC_HEADERTOGGLEUPDREQ , KK_HeaderToggleUpdreq , KT_H }, // 0xAC35
{ CRC_EDITDELLINE , KK_EditDelLine , KT_E }, // 0xACCF { CRC_EDITDELLINE , KK_EditDelLine , KT_E }, // 0xACCF
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SPGDN , Key_S_PgDn , 0 }, // 0xAD44 { CRC_K_SPGDN , Key_S_PgDn , 0 }, // 0xAD44
#endif #endif
{ CRC_READSOUNDKILL , KK_ReadSoundkill , KT_R }, // 0xAE29 { CRC_READSOUNDKILL , KK_ReadSoundkill , KT_R }, // 0xAE29
{ CRC_LISTUNDEFINE , KK_ListUndefine , KT_M }, // 0xAF86 { CRC_LISTUNDEFINE , KK_ListUndefine , KT_M }, // 0xAF86
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SHOME , Key_S_Home , 0 }, // 0xAF9D { CRC_K_SHOME , Key_S_Home , 0 }, // 0xAF9D
#endif #endif
{ CRC_READTOGGLEQUOTE , KK_ReadToggleQuote , KT_R }, // 0xB293 { CRC_READTOGGLEQUOTE , KK_ReadToggleQuote , KT_R }, // 0xB293
@ -728,7 +728,7 @@ tglobalkey globalkeys[] = {
{ CRC_K_CINS , Key_C_Ins , 0 }, // 0xBA0E { CRC_K_CINS , Key_C_Ins , 0 }, // 0xBA0E
{ CRC_READGOTONEXTUNREAD , KK_ReadGotoNextUnread , KT_R }, // 0xBA34 { CRC_READGOTONEXTUNREAD , KK_ReadGotoNextUnread , KT_R }, // 0xBA34
{ CRC_READADDRESSBOOK , KK_ReadAddressbook , KT_R }, // 0xBAC1 { CRC_READADDRESSBOOK , KK_ReadAddressbook , KT_R }, // 0xBAC1
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SPGUP , Key_S_PgUp , 0 }, // 0xBC5A { CRC_K_SPGUP , Key_S_PgUp , 0 }, // 0xBC5A
#endif #endif
{ CRC_FILEABORT , KK_FileAbort , KT_F }, // 0xBCED { CRC_FILEABORT , KK_FileAbort , KT_F }, // 0xBCED
@ -742,13 +742,13 @@ tglobalkey globalkeys[] = {
{ CRC_READTOGGLEROT13 , KK_ReadToggleROT13 , KT_R }, // 0xC157 { CRC_READTOGGLEROT13 , KK_ReadToggleROT13 , KT_R }, // 0xC157
{ CRC_EDITTOGGLECASE , KK_EditToggleCase , KT_E }, // 0xC282 { CRC_EDITTOGGLECASE , KK_EditToggleCase , KT_E }, // 0xC282
{ CRC_FILEGOTOLAST , KK_FileGotoLast , KT_F }, // 0xC40A { CRC_FILEGOTOLAST , KK_FileGotoLast , KT_F }, // 0xC40A
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SINS , Key_S_Ins , 0 }, // 0xC40B { CRC_K_SINS , Key_S_Ins , 0 }, // 0xC40B
#endif #endif
{ CRC_AREASCANPM , KK_AreaScanPM , KT_A }, // 0xC4FF { CRC_AREASCANPM , KK_AreaScanPM , KT_A }, // 0xC4FF
{ CRC_READMSGEND , KK_ReadMsgEnd , KT_R }, // 0xC5AD { CRC_READMSGEND , KK_ReadMsgEnd , KT_R }, // 0xC5AD
{ CRC_AREATOGGLE , KK_AreaToggle , KT_A }, // 0xC734 { CRC_AREATOGGLE , KK_AreaToggle , KT_A }, // 0xC734
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SLEFT , Key_S_Lft , 0 }, // 0xC902 { CRC_K_SLEFT , Key_S_Lft , 0 }, // 0xC902
#endif #endif
{ CRC_HEADERTOGGLEORPHAN , KK_HeaderToggleOrphan , KT_H }, // 0xC98A { CRC_HEADERTOGGLEORPHAN , KK_HeaderToggleOrphan , KT_H }, // 0xC98A
@ -805,7 +805,7 @@ tglobalkey globalkeys[] = {
{ CRC_READGOTOPREVAREA , KK_ReadGotoPrevArea , KT_R }, // 0xEECB { CRC_READGOTOPREVAREA , KK_ReadGotoPrevArea , KT_R }, // 0xEECB
{ CRC_READFINDALL , KK_ReadFindAll , KT_R }, // 0xEF19 { CRC_READFINDALL , KK_ReadFindAll , KT_R }, // 0xEF19
{ CRC_NODEDOSSHELL , KK_NodeDosShell , KT_N }, // 0xF084 { CRC_NODEDOSSHELL , KK_NodeDosShell , KT_N }, // 0xF084
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SDOWN , Key_S_Dwn , 0 }, // 0xF0FB { CRC_K_SDOWN , Key_S_Dwn , 0 }, // 0xF0FB
#endif #endif
{ CRC_READCHANGEXLATIMPORT , KK_ReadChangeXlatImport , KT_R }, // 0xF169 { CRC_READCHANGEXLATIMPORT , KK_ReadChangeXlatImport , KT_R }, // 0xF169

View File

@ -510,7 +510,7 @@ const word CRC_K_SPACE = 0x1281;
const word CRC_KK_MACRO = 0x4BE9; const word CRC_KK_MACRO = 0x4BE9;
const word CRC_KK_AUTO = 0x60E2; const word CRC_KK_AUTO = 0x60E2;
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
const word CRC_K_SINS = 0xC40B; const word CRC_K_SINS = 0xC40B;
const word CRC_K_SDEL = 0x1EB9; const word CRC_K_SDEL = 0x1EB9;
const word CRC_K_SHOME = 0xAF9D; const word CRC_K_SHOME = 0xAF9D;

View File

@ -317,7 +317,7 @@ int MakeColor(char* colors) {
char* ink_; char* ink_;
char* paper_; char* paper_;
#if defined(__UNIX__) or defined(__USE_NCURSES__) #if defined(__UNIX__) || defined(__USE_NCURSES__)
blink = 0; blink = 0;
#else #else
blink = (stridela("blinking", colors) ? 128 : 0); blink = (stridela("blinking", colors) ? 128 : 0);

View File

@ -551,7 +551,6 @@ struct MLst {
time_t arrived; time_t arrived;
time_t received; time_t received;
char goldmark; char goldmark;
bool initialized;
}; };

View File

@ -120,7 +120,7 @@ void Area::DeleteMsg(GMsg* msg, int direction) {
if(isnet() and isfido()) if(isnet() and isfido())
TouchNetscan(false); TouchNetscan(false);
if(not issmb() and not (isjam() and not CFG->switches.get(jamharddelete))) { if(not issmb() and not iswildcat() and not (isjam() and not CFG->switches.get(jamharddelete))) {
// Remove message from internal table // Remove message from internal table
Msgn.Del(msg->msgno); Msgn.Del(msg->msgno);
} }

View File

@ -143,7 +143,7 @@ void Cleanup(void) {
freonkey(); // Free all onkeys (macros) freonkey(); // Free all onkeys (macros)
FreePastebuf(); // Free the internal editor cut'n'paste buffer FreePastebuf(); // Free the internal editor cut'n'paste buffer
#if not defined(__UNIX__) and not defined(__USE_NCURSES__) #if !defined(__UNIX__) && !defined(__USE_NCURSES__)
if(CFG->screenpalette[16]) if(CFG->screenpalette[16])
gvid->setpalette(gvid->orig.color.palette); gvid->setpalette(gvid->orig.color.palette);
@ -286,13 +286,11 @@ int ShellToDos(char* command, char* message, int cls, int cursor, int pause) {
if(CFG->screenpalette[16]) if(CFG->screenpalette[16])
gvid->setpalette(gvid->orig.color.palette); gvid->setpalette(gvid->orig.color.palette);
#if defined(__UNIX__) and not defined(__USE_NCURSES__) #if defined(__USE_NCURSES__)
gkbd_tty_reset();
#endif
#ifdef __USE_NCURSES__
def_prog_mode(); def_prog_mode();
reset_shell_mode(); reset_shell_mode();
#elif defined(__UNIX__)
gkbd_tty_reset();
#endif #endif
// Write message on screen // Write message on screen

View File

@ -528,7 +528,7 @@ void CreateFileMsgs(int mode, GMsg* msg) {
); );
} }
sprintf(subj, "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", fspec[x].path, fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password); sprintf(subj, "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", fspec[x].path, fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password);
#if not defined(__UNIX__) #if !defined(__UNIX__)
strupr(subj); strupr(subj);
#endif #endif

View File

@ -429,7 +429,7 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
vcurshow(); vcurshow();
if(not (hedit.lookup or AA->isnet())) { if(not (hedit.lookup or AA->isnet())) {
char date2[25] = {""}; char date2[25] = "";
strsetsz(date2, view.width - CFG->disphdrdateset.pos); strsetsz(date2, view.width - CFG->disphdrdateset.pos);
view.window.prints(3, CFG->disphdrdateset.pos, view.to_color, date2); view.window.prints(3, CFG->disphdrdateset.pos, view.to_color, date2);
} }

View File

@ -565,7 +565,7 @@ void Initialize(int argc, char* argv[]) {
"-M Mute sounds. Disables all noises in GoldED+." << endl << "-M Mute sounds. Disables all noises in GoldED+." << endl <<
"-N Disable share-compatible file opens during startup." << endl << "-N Disable share-compatible file opens during startup." << endl <<
"-NOSCAN Temporarily disable area scan during startup." << endl << "-NOSCAN Temporarily disable area scan during startup." << endl <<
#if defined(GUTLOS_FUNCS) and not defined(__MSDOS__) #if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
"-P Increase program priority to run faster." << endl << "-P Increase program priority to run faster." << 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." << endl <<

View File

@ -71,7 +71,7 @@ class GMsgList : public gwinpick {
gwindow window; gwindow window;
GMsg msg; GMsg msg;
vector<MLst> mlst; MLst **mlst;
uint msgmark2; uint msgmark2;
void open(); // Called after window is opened void open(); // Called after window is opened
@ -86,8 +86,19 @@ public:
void Run(); void Run();
GMsgList() { memset(&msg, 0, sizeof(GMsg)); }; GMsgList() {
~GMsgList() { ResetMsg(&msg); }; memset(&msg, 0, sizeof(GMsg));
mlst = NULL;
maximum_index = AA->Msgn.Count()-1;
};
~GMsgList() {
ResetMsg(&msg);
if(mlst) {
for(uint i=0; i<= maximum_index; i++)
throw_xdelete(mlst[i]);
throw_free(mlst);
}
};
}; };
@ -113,11 +124,14 @@ void GMsgList::close() {
void GMsgList::ReadMlst(int n) { void GMsgList::ReadMlst(int n) {
MLst* ml = &mlst[n]; MLst* ml = mlst[n];
if(ml->initialized) if(ml != NULL)
return; return;
ml = mlst[n] = new MLst;
throw_new(ml);
ml->high = 0; ml->high = 0;
strcpy(ml->marks, " "); strcpy(ml->marks, " ");
@ -164,11 +178,11 @@ void GMsgList::ReadMlst(int n) {
ml->high |= MLST_HIGH_FROM; ml->high |= MLST_HIGH_FROM;
// Highlight if unread // Highlight if unread
if(msg.timesread == 0 and CFG->switches.get(highlightunread)) if((msg.timesread == 0) and CFG->switches.get(highlightunread))
ml->high |= MLST_HIGH_UNREAD; ml->high |= MLST_HIGH_UNREAD;
// Highlight if unsent // Highlight if unsent
if(msg.attr.uns()and not msg.attr.rcv() and not msg.attr.del()) if(msg.attr.uns() and not msg.attr.rcv() and not msg.attr.del())
ml->high |= MLST_HIGH_UNSENT; ml->high |= MLST_HIGH_UNSENT;
ml->written = msg.written; ml->written = msg.written;
@ -187,8 +201,8 @@ void GMsgList::do_delayed() {
// Update header and statusline // Update header and statusline
if(AA->Msglistheader()) { if(AA->Msglistheader()) {
ReadMlst(index); ReadMlst(index);
AA->LoadMsg(&msg, mlst[index].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); AA->LoadMsg(&msg, mlst[index]->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
mlst[index].goldmark = goldmark; mlst[index]->goldmark = goldmark;
int mlstwh = whandle(); int mlstwh = whandle();
HeaderView->Use(AA, &msg); HeaderView->Use(AA, &msg);
HeaderView->Paint(); HeaderView->Paint();
@ -197,7 +211,7 @@ void GMsgList::do_delayed() {
if(CFG->switches.get(msglistviewsubj)) { if(CFG->switches.get(msglistviewsubj)) {
ReadMlst(index); ReadMlst(index);
wtitle(mlst[index].re, TCENTER|TBOTTOM, tattr); wtitle(mlst[index]->re, TCENTER|TBOTTOM, tattr);
} }
if(CFG->switches.get(msglistpagebar)) if(CFG->switches.get(msglistpagebar))
@ -243,7 +257,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
int resiz = mlst_resiz + fldadd2; int resiz = mlst_resiz + fldadd2;
ReadMlst(idx); ReadMlst(idx);
MLst* ml = &mlst[idx]; MLst* ml = mlst[idx];
int wattr_, hattr_, mattr_; int wattr_, hattr_, mattr_;
if(isbar) { if(isbar) {
@ -379,12 +393,12 @@ bool GMsgList::handle_key() {
case KK_ListToggleMark: case KK_ListToggleMark:
{ {
ulong temp = AA->Mark.Find(mlst[index].msgno); ulong temp = AA->Mark.Find(mlst[index]->msgno);
if(temp) { if(temp) {
AA->Mark.DelReln(temp); AA->Mark.DelReln(temp);
} }
else { else {
AA->Mark.Add(mlst[index].msgno); AA->Mark.Add(mlst[index]->msgno);
} }
} }
if(index < maximum_index) if(index < maximum_index)
@ -394,24 +408,24 @@ bool GMsgList::handle_key() {
break; break;
case KK_ListToggleBookMark: case KK_ListToggleBookMark:
if(AA->bookmark == mlst[index].msgno) { if(AA->bookmark == mlst[index]->msgno) {
mlst[index].marks[0] = ' '; mlst[index]->marks[0] = ' ';
AA->bookmark = 0; AA->bookmark = 0;
mlst[index].high &= ~MLST_HIGH_BOOK; mlst[index]->high &= ~MLST_HIGH_BOOK;
display_bar(); display_bar();
} }
else { else {
long prevbm = AA->Msgn.ToReln(AA->bookmark-1); long prevbm = AA->Msgn.ToReln(AA->bookmark-1);
long newbm = index; long newbm = index;
AA->bookmark = mlst[index].msgno; AA->bookmark = mlst[index]->msgno;
mlst[index].marks[0] = MMRK_BOOK; mlst[index]->marks[0] = MMRK_BOOK;
mlst[index].high |= MLST_HIGH_BOOK; mlst[index]->high |= MLST_HIGH_BOOK;
display_bar(); display_bar();
if(prevbm) { if(prevbm) {
if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) { if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) {
ReadMlst(prevbm); ReadMlst(prevbm);
mlst[prevbm].marks[0] = ' '; mlst[prevbm]->marks[0] = ' ';
mlst[prevbm].high &= ~MLST_HIGH_BOOK; mlst[prevbm]->high &= ~MLST_HIGH_BOOK;
index = prevbm; index = prevbm;
position += prevbm - newbm; position += prevbm - newbm;
display_line(); display_line();
@ -427,16 +441,16 @@ bool GMsgList::handle_key() {
long prevbm = AA->Msgn.ToReln(AA->bookmark-1); long prevbm = AA->Msgn.ToReln(AA->bookmark-1);
long newbm = index; long newbm = index;
index = prevbm; index = prevbm;
AA->bookmark = mlst[newbm].msgno; AA->bookmark = mlst[newbm]->msgno;
if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) { if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) {
mlst[newbm].marks[0] = MMRK_BOOK; mlst[newbm]->marks[0] = MMRK_BOOK;
mlst[newbm].high |= MLST_HIGH_BOOK; mlst[newbm]->high |= MLST_HIGH_BOOK;
index = newbm; index = newbm;
display_line(); display_line();
index = prevbm; index = prevbm;
ReadMlst(index); ReadMlst(index);
mlst[index].marks[0] = ' '; mlst[index]->marks[0] = ' ';
mlst[index].high &= ~MLST_HIGH_BOOK; mlst[index]->high &= ~MLST_HIGH_BOOK;
position += prevbm - newbm; position += prevbm - newbm;
display_bar(); display_bar();
} }
@ -506,6 +520,15 @@ bool GMsgList::handle_key() {
void GMsgList::Run() { void GMsgList::Run() {
if(maximum_index == 0) {
aborted = true;
return;
}
index = AA->Msgn.ToReln(reader_msg->msgno)-1;
minimum_index = 0;
msgmark2 = AA->Msgn.ToReln(AA->bookmark);
ypos = AA->Msglistheader() ? 6 : 1; // Window Starting Row ypos = AA->Msglistheader() ? 6 : 1; // Window Starting Row
xpos = 0; // Window Starting Column xpos = 0; // Window Starting Column
ylen = MAXROW-3-ypos; // Window Height ylen = MAXROW-3-ypos; // Window Height
@ -521,11 +544,6 @@ void GMsgList::Run() {
helpcat = H_MessageBrowser; // Window Help Category helpcat = H_MessageBrowser; // Window Help Category
listwrap = CFG->switches.get(displistwrap); listwrap = CFG->switches.get(displistwrap);
index = AA->Msgn.ToReln(reader_msg->msgno)-1;
minimum_index = 0;
maximum_index = AA->Msgn.Count()-1;
msgmark2 = AA->Msgn.ToReln(AA->bookmark);
if(AA->Msglistdate() != MSGLISTDATE_NONE) { if(AA->Msglistdate() != MSGLISTDATE_NONE) {
if(AA->Msglistdate() != MSGLISTDATE_WRITTEN) { if(AA->Msglistdate() != MSGLISTDATE_WRITTEN) {
if(AA->ishudson() or AA->isgoldbase() or AA->ispcboard()) if(AA->ishudson() or AA->isgoldbase() or AA->ispcboard())
@ -540,23 +558,18 @@ void GMsgList::Run() {
fldadd1 = (MAXCOL-80)/3; fldadd1 = (MAXCOL-80)/3;
fldadd2 = (MAXCOL-80) - (fldadd1*2); fldadd2 = (MAXCOL-80) - (fldadd1*2);
mlst.clear(); mlst = (MLst **)throw_malloc(sizeof(MLst *) * (maximum_index + 1));
MLst dummy_mlst;
dummy_mlst.initialized = false;
for(uint i=0; i<= maximum_index; i++) for(uint i=0; i<= maximum_index; i++)
mlst.push_back(dummy_mlst); mlst[i] = NULL;
maximum_position = MinV((uint)maximum_index, (uint)ylen - 1); maximum_position = MinV((uint)maximum_index, (uint)ylen - 1);
if(mlst.size() != 0) run_picker();
run_picker();
else
aborted = true;
if(not aborted) { if(not aborted) {
ReadMlst(index); ReadMlst(index);
AA->set_lastread(AA->Msgn.ToReln(mlst[index].msgno)); AA->set_lastread(AA->Msgn.ToReln(mlst[index]->msgno));
} }
} }
@ -766,7 +779,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
GenTree(buf2, idx); GenTree(buf2, idx);
#if defined(__UNIX__) and not defined(__USE_NCURSES__) #if defined(__UNIX__) && !defined(__USE_NCURSES__)
gvid_boxcvt(buf2); gvid_boxcvt(buf2);
#endif #endif

View File

@ -100,6 +100,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
MakeAttrStr(attr, sizeof(attr), &msg->attr); MakeAttrStr(attr, sizeof(attr), &msg->attr);
const char *xmailer = get_informative_string(); const char *xmailer = get_informative_string();
const char *osver = ggetosstring();
time_t t = time(NULL); time_t t = time(NULL);
struct tm* written_tm = localtime(&t); struct tm* written_tm = localtime(&t);
@ -364,6 +365,8 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
continue; continue;
if(tokenxchg(dst, "@widepid", xmailer)) if(tokenxchg(dst, "@widepid", xmailer))
continue; continue;
if(tokenxchg(dst, "@osver", osver))
continue;
if(tokenxchg(dst, "@osslash", __gver_platform__)) if(tokenxchg(dst, "@osslash", __gver_platform__))
continue; continue;
if(tokenxchg(dst, "@subject", modereptr)) if(tokenxchg(dst, "@subject", modereptr))

View File

@ -106,7 +106,7 @@ const char* __gver_shortver__ = __GVER_SVER__(__GVER_MAJOR__,__GVER_MINOR__,__GV
#define __GVER_SHORTPLATFORM__ "LNX" #define __GVER_SHORTPLATFORM__ "LNX"
#define __GVER_SHORTLOGNAME__ "L" #define __GVER_SHORTLOGNAME__ "L"
#define __GVER_CFGEXT__ ".gel" #define __GVER_CFGEXT__ ".gel"
#elif defined(__FreeBSD__) or defined(__OpenBSD__) #elif defined(__FreeBSD__) || defined(__OpenBSD__)
#define __GVER_PLATFORM__ "/BSD" #define __GVER_PLATFORM__ "/BSD"
#define __GVER_SHORTPLATFORM__ "BSD" #define __GVER_SHORTPLATFORM__ "BSD"
#define __GVER_SHORTLOGNAME__ "B" #define __GVER_SHORTLOGNAME__ "B"

View File

@ -154,12 +154,6 @@ template <class T> inline bool make_bool(T a) { return a ? true : fal
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Legacy defines // Legacy defines
#ifndef AND
#define NOT !
#define AND &&
#define OR ||
#endif
#define RngV in_range #define RngV in_range
#define AbsV absolute #define AbsV absolute
#define CmpV compare_two #define CmpV compare_two

View File

@ -55,7 +55,7 @@ extern "C" {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if (defined(__BORLANDC__) and defined(__OS2__)) or defined(__UNIX__) or defined(__EMX__) #if (defined(__BORLANDC__) && defined(__OS2__)) || defined(__UNIX__) || defined(__EMX__)
long filelength(int handle) { long filelength(int handle) {
@ -133,7 +133,7 @@ int unlock(int handle, long ofs, long length)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__UNIX__) or defined(__CYGWIN__) #if defined(__UNIX__) || defined(__CYGWIN__)
int lock(int handle, long offset, long length) { int lock(int handle, long offset, long length) {
@ -151,7 +151,7 @@ int lock(int handle, long offset, long length) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__UNIX__) or defined(__CYGWIN__) #if defined(__UNIX__) || defined(__CYGWIN__)
int unlock(int handle, long offset, long length) { int unlock(int handle, long offset, long length) {
@ -169,7 +169,7 @@ int unlock(int handle, long offset, long length) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__MINGW32__) or defined(_MSC_VER) #if defined(__MINGW32__) || defined(_MSC_VER)
int lock(int fh, long offs, long len) { int lock(int fh, long offs, long len) {
@ -182,7 +182,7 @@ int lock(int fh, long offs, long len) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__MINGW32__) or defined(_MSC_VER) #if defined(__MINGW32__) || defined(_MSC_VER)
int unlock(int fh, long offs, long len) { int unlock(int fh, long offs, long len) {

View File

@ -39,7 +39,7 @@
#include <cstdio> #include <cstdio>
#include <string> #include <string>
#include <gshare.h> #include <gshare.h>
#if not defined(__UNIX__) #if !defined(__UNIX__)
#include <io.h> #include <io.h>
#endif #endif
@ -83,7 +83,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Misc. defines // Misc. defines
#if defined(__MSDOS__) or defined(__OS2__) or defined(__WIN32__) #if defined(__MSDOS__) || defined(__OS2__) || defined(__WIN32__)
#define GOLD_SLASH_CHR '\\' // Backslash #define GOLD_SLASH_CHR '\\' // Backslash
#define GOLD_SLASH_STR "\\" #define GOLD_SLASH_STR "\\"
#define GOLD_WRONG_SLASH_CHR '/' // Fwrdslash #define GOLD_WRONG_SLASH_CHR '/' // Fwrdslash
@ -119,11 +119,11 @@ struct Stamp {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Prototypes // Prototypes
#if not defined(__GNUC__) or defined(__MINGW32__) #if !defined(__GNUC__) || defined(__MINGW32__)
#define mkdir(path,unused) mkdir(path) #define mkdir(path,unused) mkdir(path)
#endif #endif
#ifdef __EMX__ // untested !!! #ifdef __EMX__
#define getcwd _getcwd2 #define getcwd _getcwd2
#define chdir _chdir2 #define chdir _chdir2
#endif #endif
@ -190,7 +190,7 @@ extern "C" {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if (defined(__BORLANDC__) and defined(__OS2__)) or defined(__UNIX__) or defined(__EMX__) #if (defined(__BORLANDC__) && defined(__OS2__)) || defined(__UNIX__) || defined(__EMX__)
long filelength(int fh); long filelength(int fh);
#endif #endif
@ -215,13 +215,13 @@ int unlock(int handle, long offset, long length);
#undef sopen #undef sopen
#endif #endif
#if not defined(__DJGPP__) and defined(__GNUC__) #if !defined(__DJGPP__) && defined(__GNUC__)
int lock(int handle, long offset, long length); int lock(int handle, long offset, long length);
int unlock(int handle, long offset, long length); int unlock(int handle, long offset, long length);
inline long tell(int fh) { return lseek(fh, 0, SEEK_CUR); } inline long tell(int fh) { return lseek(fh, 0, SEEK_CUR); }
#endif #endif
#if not defined(__MINGW32__) and not defined(__EMX__) and defined(__GNUC__) #if !defined(__MINGW32__) && !defined(__EMX__) && defined(__GNUC__)
inline int eof(int h) { inline int eof(int h) {
return tell(h) > filelength(h); return tell(h) > filelength(h);
@ -236,7 +236,7 @@ inline int sopen(const char* path, int access, int shflag, int mode) {
#endif #endif
#if defined(__UNIX__) or defined(__CYGWIN__) #if defined(__UNIX__) || defined(__CYGWIN__)
inline int chsize(int handle, long size) { return ftruncate(handle, size); } inline int chsize(int handle, long size) { return ftruncate(handle, size); }
#endif #endif

View File

@ -94,7 +94,7 @@ long GetFilesize(const char* file) {
dword gfixstattime(time_t st_time) { dword gfixstattime(time_t st_time) {
#if defined(__MINGW32__) or defined(__CYGWIN__) #if defined(__MINGW32__) || defined(__CYGWIN__)
struct tm &f = *gmtime(&st_time); struct tm &f = *gmtime(&st_time);
#else #else
struct tm &f = *localtime(&st_time); struct tm &f = *localtime(&st_time);
@ -106,7 +106,7 @@ dword gfixstattime(time_t st_time) {
t.ft_hour = f.tm_hour; t.ft_hour = f.tm_hour;
t.ft_min = f.tm_min; t.ft_min = f.tm_min;
t.ft_tsec = f.tm_sec / 2; t.ft_tsec = f.tm_sec / 2;
#if defined(__MINGW32__) or defined(__CYGWIN__) #if defined(__MINGW32__) || defined(__CYGWIN__)
union { union {
DWORD t; DWORD t;
struct { struct {

View File

@ -43,7 +43,7 @@
#include <windows.h> #include <windows.h>
#endif #endif
#if defined(__UNIX__) and not defined(__USE_NCURSES__) #if defined(__UNIX__) && !defined(__USE_NCURSES__)
#include <gkbdunix.h> #include <gkbdunix.h>
#endif #endif
@ -78,7 +78,7 @@ int curses_initialized = 0;
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Global keyboard data // Global keyboard data
#if defined(__WIN32__) and not defined(__USE_NCURSES__) #if defined(__WIN32__) && !defined(__USE_NCURSES__)
HANDLE gkbd_hin; HANDLE gkbd_hin;
DWORD gkbd_kbdmode; DWORD gkbd_kbdmode;
int gkbd_nt; int gkbd_nt;
@ -171,13 +171,13 @@ GKbd::GKbd() {
extkbd = _farpeekb (_dos_ds, 0x0496) & (1 << 4); extkbd = _farpeekb (_dos_ds, 0x0496) & (1 << 4);
#elif defined(__MSDOS__) #elif defined(__MSDOS__)
extkbd = *((byte*)0x0496) & (1 << 4); extkbd = *((byte*)0x0496) & (1 << 4);
#elif defined(__OS2__) or defined(__WIN32__) #elif defined(__OS2__) || defined(__WIN32__)
extkbd = true; extkbd = true;
#endif #endif
Init(); Init();
#if defined(__UNIX__) and not defined(__USE_NCURSES__) #if defined(__UNIX__) && !defined(__USE_NCURSES__)
gkbd_keymap_init(); gkbd_keymap_init();
@ -908,7 +908,7 @@ bool is_numpad_key(const INPUT_RECORD& inp) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Numpad translation table // Numpad translation table
#elif defined(__MSDOS__) or defined(__OS2__) #elif defined(__MSDOS__) || defined(__OS2__)
const word numpad_keys[] = { const word numpad_keys[] = {
0x4737, 0x4838, 0x4939, 0x0000, 0x4737, 0x4838, 0x4939, 0x0000,

View File

@ -221,7 +221,7 @@
#define Key_S_F11 0x8700 // S <F11> - - E - #define Key_S_F11 0x8700 // S <F11> - - E -
#define Key_S_F12 0x8800 // S <F12> - - E - #define Key_S_F12 0x8800 // S <F12> - - E -
#define Key_S_Tab 0x0F00 // S <Tab> - - - - #define Key_S_Tab 0x0F00 // S <Tab> - - - -
#if not defined(__UNIX__) or defined(__USE_NCURSES__) #if !defined(__UNIX__) || defined(__USE_NCURSES__)
#define Key_S_Ins 0xD200 // S <Ins> Grey - G E T #define Key_S_Ins 0xD200 // S <Ins> Grey - G E T
#define Key_S_Lft 0xCB00 // S <Left> Grey - G E T #define Key_S_Lft 0xCB00 // S <Left> Grey - G E T
#define Key_S_PgDn 0xD100 // S <PgDn> Grey - G E T #define Key_S_PgDn 0xD100 // S <PgDn> Grey - G E T

View File

@ -172,7 +172,7 @@ inline void i86::genint(int intno) {
} }
#if defined(__WATCOMC__) and defined(__386__) #if defined(__WATCOMC__) && defined(__386__)
inline int __dpmi_allocate_dos_memory(long len, int &buf) { inline int __dpmi_allocate_dos_memory(long len, int &buf) {
i86 cpu; i86 cpu;
@ -203,7 +203,7 @@ inline void __dpmi_free_dos_memory(int buffer) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// A more portable version of MK_FP() // A more portable version of MK_FP()
#if defined(__WATCOMC__) and defined(__386__) #if defined(__WATCOMC__) && defined(__386__)
#define gmkfp(s,o) ((s << 4) + o) #define gmkfp(s,o) ((s << 4) + o)

View File

@ -34,7 +34,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if not defined(__GNUC__) or defined(__DJGPP__) or defined(__EMX__) or defined(__MINGW32__) #if !defined(__GNUC__) || defined(__DJGPP__) || defined(__EMX__) || defined(__MINGW32__)
#include <share.h> #include <share.h>
#if defined(__MINGW32__) // SH_COMPAT doesn't work in Mingw32 #if defined(__MINGW32__) // SH_COMPAT doesn't work in Mingw32
#undef SH_COMPAT #undef SH_COMPAT

View File

@ -51,7 +51,7 @@ gsnd::gsnd() {
#if defined(__MSDOS__) #if defined(__MSDOS__)
mpx = -1; mpx = -1;
#if (defined(__WATCOMC__) and defined(__386__)) or defined(__DJGPP__) #if (defined(__WATCOMC__) && defined(__386__)) || defined(__DJGPP__)
buffer = -1; buffer = -1;
#else #else
buffer = NULL; buffer = NULL;
@ -98,7 +98,7 @@ int gsnd::call_api(uint al, uint bx) {
void gsnd::free_buffer() { void gsnd::free_buffer() {
#if defined(__MSDOS__) #if defined(__MSDOS__)
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__)) #if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__))
if(buffer != -1) { if(buffer != -1) {
__dpmi_free_dos_memory(buffer); __dpmi_free_dos_memory(buffer);
buffer = -1; buffer = -1;
@ -226,7 +226,7 @@ int gsnd::open(const char* file) {
goto try_again; goto try_again;
case 0x02: case 0x02:
free_buffer(); free_buffer();
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__)) #if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__))
int seg = __dpmi_allocate_dos_memory((data->buffer_length >> 4) + 1, &buffer); int seg = __dpmi_allocate_dos_memory((data->buffer_length >> 4) + 1, &buffer);
if(seg == -1) if(seg == -1)
return -1; return -1;

View File

@ -55,7 +55,7 @@ protected:
#if defined(__MSDOS__) #if defined(__MSDOS__)
int mpx; int mpx;
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__)) #if defined(__DJGPP__) || (defined(__WATCOMC__) && defined(__386__))
int buffer; int buffer;
#else #else
char* buffer; char* buffer;

View File

@ -121,7 +121,7 @@ inline char* strskip_wht(char* p) { while(*p and isspace(*p)) p++; return p; }
inline const char* strskip_digits(const char* p) { return p+strspn(p, "0123456789"); } inline const char* strskip_digits(const char* p) { return p+strspn(p, "0123456789"); }
inline char* strskip_digits(char* p) { return p+strspn(p, "0123456789"); } inline char* strskip_digits(char* p) { return p+strspn(p, "0123456789"); }
#if defined(_MSC_VER) or (defined(__GNUC__) and not defined(__DJGPP__)) or defined(__WATCOMC__) #if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__DJGPP__)) || defined(__WATCOMC__)
inline char * stpcpy(char* dest, const char* src) { inline char * stpcpy(char* dest, const char* src) {
while ((*dest++ = *src++) != NUL) {} while ((*dest++ = *src++) != NUL) {}
return --dest; return --dest;

View File

@ -594,7 +594,7 @@ GTok::GTok(char* sep) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__GNUC__) and not defined(__EMX__) #if defined(__GNUC__) && !defined(__EMX__)
char* strupr(char* s) { char* strupr(char* s) {

View File

@ -38,7 +38,7 @@
#if defined(__OS2__) #if defined(__OS2__)
#define CLIP_NAME "OS/2 Clipboard" #define CLIP_NAME "OS/2 Clipboard"
#elif defined(__WIN32__) or defined(__MSDOS__) #elif defined(__WIN32__) || defined(__MSDOS__)
#define CLIP_NAME "Windows Clipboard" #define CLIP_NAME "Windows Clipboard"
#else #else
#define CLIP_NAME "Fake Clipboard" #define CLIP_NAME "Fake Clipboard"

View File

@ -82,7 +82,7 @@ int GMTsk::os2() {
#if defined(__OS2__) #if defined(__OS2__)
detected = GMTSK_OS2; detected = GMTSK_OS2;
name = "OS/2"; name = "OS/2";
#elif not defined(__GNUC__) #elif !defined(__GNUC__)
if(_osmajor >= 10) { if(_osmajor >= 10) {
detected = GMTSK_OS2; detected = GMTSK_OS2;
name = "OS/2"; name = "OS/2";
@ -115,7 +115,7 @@ int GMTsk::win32() {
int GMTsk::windows() { int GMTsk::windows() {
#if defined(__MSDOS__) and not defined(__DJGPP__) #if defined(__MSDOS__) && !defined(__DJGPP__)
i86 cpu; i86 cpu;
cpu.ax(0x352F); cpu.ax(0x352F);
cpu.genint(0x21); cpu.genint(0x21);
@ -136,7 +136,7 @@ int GMTsk::windows() {
int GMTsk::desqview() { int GMTsk::desqview() {
#if defined(__MSDOS__) and not defined(__DJGPP__) #if defined(__MSDOS__) && !defined(__DJGPP__)
i86 cpu; i86 cpu;
cpu.cx(0x4445); cpu.cx(0x4445);
cpu.dx(0x5351); cpu.dx(0x5351);
@ -157,7 +157,7 @@ int GMTsk::desqview() {
int GMTsk::dosint28() { int GMTsk::dosint28() {
#if defined(__MSDOS__) and not defined(__DJGPP__) #if defined(__MSDOS__) && !defined(__DJGPP__)
detected = GMTSK_DOS; detected = GMTSK_DOS;
name = "DOS"; name = "DOS";
#endif #endif
@ -191,7 +191,7 @@ void GMTsk::timeslice() {
Sleep(5); Sleep(5);
break; break;
#endif #endif
#if defined(__MSDOS__) or defined(__OS2__) #if defined(__MSDOS__) || defined(__OS2__)
case GMTSK_OS2: case GMTSK_OS2:
#if defined(__OS2__) #if defined(__OS2__)
DosSleep(5); DosSleep(5);

View File

@ -35,7 +35,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__WIN32__) or defined(__OS2__) or defined(__DJGPP__) #if defined(__WIN32__) || defined(__OS2__) || defined(__DJGPP__)
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -131,7 +131,7 @@ ulong* GTag::Add(ulong __tagn) {
uint _reln = ToReln(__tagn, TAGN_CLOSEST); uint _reln = ToReln(__tagn, TAGN_CLOSEST);
// Do we have it already? // Do we have it already?
if((_reln == RELN_INVALID) OR (tag[_reln-1] != __tagn)) { if((_reln == RELN_INVALID) or (tag[_reln-1] != __tagn)) {
// Resize tag array to make room for the new number // Resize tag array to make room for the new number
Resize(tags+1); Resize(tags+1);
@ -143,7 +143,7 @@ ulong* GTag::Add(ulong __tagn) {
// - no tags in array (if _reln == RELN_INVALID) // - no tags in array (if _reln == RELN_INVALID)
// - tag[_reln-1] is larger than __tagn // - tag[_reln-1] is larger than __tagn
if(_reln AND (tag[_reln-1] > __tagn)) if(_reln and (tag[_reln-1] > __tagn))
_reln--; _reln--;
// Move data to make room for the new tag number // Move data to make room for the new tag number

View File

@ -96,7 +96,7 @@ public:
uint SetCount(uint n) { tags = count = n; return count; } uint SetCount(uint n) { tags = count = n; return count; }
void Set(uint n, ulong t) { tag[n] = t; } void Set(uint n, ulong t) { tag[n] = t; }
ulong Get(uint n) { return (tags AND (n<tags)) ? tag[n] : TAGN_INVALID; } ulong Get(uint n) { return (tags and (n<tags)) ? tag[n] : TAGN_INVALID; }
ulong& operator[](uint n) { return tag[n]; } ulong& operator[](uint n) { return tag[n]; }
ulong& at(uint n) { return tag[n]; } ulong& at(uint n) { return tag[n]; }

View File

@ -44,7 +44,7 @@ char* ggetosstring(void) {
if(*osstring == NUL) { if(*osstring == NUL) {
#if defined(__UNIX__) or defined(__DJGPP__) or defined(__EMX__) #if defined(__UNIX__) || defined(__DJGPP__) || defined(__EMX__)
struct utsname info; struct utsname info;

View File

@ -58,7 +58,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Check if Borland C++ for OS/2 1.0 header has been fixed // Check if Borland C++ for OS/2 1.0 header has been fixed
#if defined(__OS2__) and defined(__BORLANDC__) #if defined(__OS2__) && defined(__BORLANDC__)
#if __BORLANDC__ <= 0x400 #if __BORLANDC__ <= 0x400
#ifndef BCOS2_BSESUB_FIXED #ifndef BCOS2_BSESUB_FIXED
#error There is a bug in the BSESUB.H header. Please fix it. #error There is a bug in the BSESUB.H header. Please fix it.
@ -80,7 +80,7 @@
static bool __vcurhidden = false; static bool __vcurhidden = false;
#if not defined(__USE_NCURSES__) #if !defined(__USE_NCURSES__)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -103,7 +103,7 @@ inline WCHAR gvid_tcpr(vchar chr) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__MSDOS__) or defined(__UNIX__) #if defined(__MSDOS__) || defined(__UNIX__)
#if defined(__MSDOS__) #if defined(__MSDOS__)
extern int __gdvdetected; extern int __gdvdetected;
@ -356,7 +356,7 @@ void vputansi(int row, int col, word* buf, int len) {
#endif #endif
#endif // not defined(__USE_NCURSES__) #endif // !defined(__USE_NCURSES__)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -393,7 +393,7 @@ int revsattr(int attr) {
return (int)(((attr>>4)&0x07)|((attr<<4)&0x70)|(attr&0x80)|(attr&0x08)); return (int)(((attr>>4)&0x07)|((attr<<4)&0x70)|(attr&0x80)|(attr&0x08));
} }
#if not defined(__USE_NCURSES__) #if !defined(__USE_NCURSES__)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -569,7 +569,7 @@ chtype gvid_tcpr(vchar chr) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Print character and attribute at specfied location // Print character and attribute at specfied location
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
inline void _vputw(int row, int col, word chat) { inline void _vputw(int row, int col, word chat) {
_farpokew(_dos_ds, gdmaptr(col, row), chat); _farpokew(_dos_ds, gdmaptr(col, row), chat);
@ -738,7 +738,7 @@ void vputc(int row, int col, int atr, vchar chr) {
cpu.genint(0x10); cpu.genint(0x10);
} }
#elif defined(__OS2__) or defined(__WIN32__) #elif defined(__OS2__) || defined(__WIN32__)
vputw(row, col, vcatch(chr, atr)); vputw(row, col, vcatch(chr, atr));
@ -854,7 +854,7 @@ void vputs(int row, int col, int atr, const char* str) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Print string with attribute at specfied location // Print string with attribute at specfied location
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
static void _vputns(int row, int col, int atr, const char* str, uint width) { static void _vputns(int row, int col, int atr, const char* str, uint width) {
char fillchar = ' '; char fillchar = ' ';
@ -967,7 +967,7 @@ void vputns(int row, int col, int atr, const char* str, uint width) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Print horizontal line of character and attribute // Print horizontal line of character and attribute
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
void _vputx(int row, int col, int atr, char chr, uint len) { void _vputx(int row, int col, int atr, char chr, uint len) {
gdma p = gdmaptr(col, row); gdma p = gdmaptr(col, row);
@ -1040,7 +1040,7 @@ void vputx(int row, int col, int atr, vchar chr, uint len) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Print vertical line of character and attribute // Print vertical line of character and attribute
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
inline void _vputy(int row, int col, int atr, char chr, uint len) { inline void _vputy(int row, int col, int atr, char chr, uint len) {
gdma p = gdmaptr(col, row); gdma p = gdmaptr(col, row);
@ -1130,7 +1130,7 @@ void vputy(int row, int col, int atr, vchar chr, uint len) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Get character and attribute at cursor position // Get character and attribute at cursor position
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
inline word _vgetw(int row, int col) { inline word _vgetw(int row, int col) {
return _farpeekw(_dos_ds, gdmaptr(col, row)); return _farpeekw(_dos_ds, gdmaptr(col, row));
@ -1203,7 +1203,7 @@ vatch vgetw(int row, int col) {
void vgetc(int row, int col, int* atr, vchar* chr) { void vgetc(int row, int col, int* atr, vchar* chr) {
if((row < 0) || (row > gvid->numrows-1) || (col < 0) || (col > gvid->numcols-1)) { if((row < 0) or (row > gvid->numrows-1) or (col < 0) or (col > gvid->numcols-1)) {
*chr = ' '; *chr = ' ';
*atr = 0; *atr = 0;
} }
@ -1219,7 +1219,7 @@ void vgetc(int row, int col, int* atr, vchar* chr) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Scroll screen area // Scroll screen area
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
static void _vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) { static void _vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
word empty = (atr << 8) | ' '; word empty = (atr << 8) | ' ';
@ -1461,7 +1461,7 @@ void vclrscr() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Clears the screen using given attribute and homes the cursor // Clears the screen using given attribute and homes the cursor
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
static void _vclrscr(int atr) { static void _vclrscr(int atr) {
int len = gvid->numrows * gvid->numcols; int len = gvid->numrows * gvid->numcols;
@ -1529,7 +1529,7 @@ void vclrscr(int atr) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Saves the current screen and returns pointer to buffer // Saves the current screen and returns pointer to buffer
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
static void _vsave(word* buf, int len1, int srow, int scol, int erow) { static void _vsave(word* buf, int len1, int srow, int scol, int erow) {
const int len2 = len1*sizeof(word); const int len2 = len1*sizeof(word);
@ -1645,7 +1645,7 @@ vsavebuf* vsave(int srow, int scol, int erow, int ecol) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Redraws a previously saved screen // Redraws a previously saved screen
#if (defined(__MSDOS__) or defined(__UNIX__)) and not defined(__USE_NCURSES__) #if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
static void _vredraw(word* buf, int len1, int srow, int scol, int erow) { static void _vredraw(word* buf, int len1, int srow, int scol, int erow) {
const int len2 = len1*sizeof(word); const int len2 = len1*sizeof(word);
@ -1972,7 +1972,7 @@ void vcursmall() {
// 14 - solid block // 14 - solid block
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if not defined(__USE_NCURSES__) #if !defined(__USE_NCURSES__)
char* __box_table[] = { char* __box_table[] = {
@ -2069,7 +2069,7 @@ chtype _box_table(int type, int c) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
#if defined(__UNIX__) and not defined(__USE_NCURSES__) #if defined(__UNIX__) && !defined(__USE_NCURSES__)
void gvid_boxcvt(char* s) { void gvid_boxcvt(char* s) {
while(*s) { while(*s) {

View File

@ -32,7 +32,7 @@
#include <gmemall.h> #include <gmemall.h>
#include <gmemdbg.h> #include <gmemdbg.h>
#include <gstrall.h> #include <gstrall.h>
#if defined(__WATCOMC__) or defined(__DJGPP__) #if defined(__WATCOMC__) || defined(__DJGPP__)
#include <conio.h> #include <conio.h>
#endif #endif
#include <gvidall.h> #include <gvidall.h>
@ -46,7 +46,7 @@
#include <windows.h> #include <windows.h>
#endif #endif
#if not defined(__USE_NCURSES__) and defined(__UNIX__) #if !defined(__USE_NCURSES__) && defined(__UNIX__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
@ -62,7 +62,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Check if Borland C++ for OS/2 1.0 header has been fixed // Check if Borland C++ for OS/2 1.0 header has been fixed
#if defined(__OS2__) and defined(__BORLANDC__) #if defined(__OS2__) && defined(__BORLANDC__)
#if __BORLANDC__ <= 0x400 #if __BORLANDC__ <= 0x400
#ifndef BCOS2_BSESUB_FIXED #ifndef BCOS2_BSESUB_FIXED
#error There is a bug in the BSESUB.H header. Please fix it. #error There is a bug in the BSESUB.H header. Please fix it.
@ -189,11 +189,11 @@ void GVid::init() {
#if defined(__USE_NCURSES__) #if defined(__USE_NCURSES__)
dmaptr = dmadir = NULL; dmaptr = dmadir = NULL;
#elif defined(__WATCOMC__) and defined(__386__) #elif defined(__WATCOMC__) && defined(__386__)
dmaptr = dmadir = (gdma)(videoseg << 4); dmaptr = dmadir = (gdma)(videoseg << 4);
#elif defined(__DJGPP__) #elif defined(__DJGPP__)
dmaptr = dmadir = ScreenPrimary; dmaptr = dmadir = ScreenPrimary;
#elif defined(__OS2__) or defined(__WIN32__) #elif defined(__OS2__) || defined(__WIN32__)
dmaptr = dmadir = NULL; dmaptr = dmadir = NULL;
#elif defined(__UNIX__) #elif defined(__UNIX__)
dmaptr = (gdma)throw_xcalloc((orig.screen.rows+1)*orig.screen.columns, sizeof(word)); dmaptr = (gdma)throw_xcalloc((orig.screen.rows+1)*orig.screen.columns, sizeof(word));
@ -319,7 +319,7 @@ int GVid::detectadapter() {
#ifndef __DJGPP__ #ifndef __DJGPP__
// Set video segment // Set video segment
#if defined(__BORLANDC__) and defined(__DPMI32__) #if defined(__BORLANDC__) && defined(__DPMI32__)
videoseg = (word)((adapter & V_MONO) ? __SegB000 : __SegB800); videoseg = (word)((adapter & V_MONO) ? __SegB000 : __SegB800);
#else #else
videoseg = (word)((adapter & V_MONO) ? 0xB000 : 0xB800); videoseg = (word)((adapter & V_MONO) ? 0xB000 : 0xB800);
@ -340,7 +340,7 @@ int GVid::detectadapter() {
__gdvdetected = true; __gdvdetected = true;
#if defined(__WATCOMC__) and defined(__386__) #if defined(__WATCOMC__) && defined(__386__)
memset(&RMI, 0, sizeof(RMI)); memset(&RMI, 0, sizeof(RMI));
RMI.EAX = 0x0000FE00; RMI.EAX = 0x0000FE00;
RMI.ES = videoseg; RMI.ES = videoseg;
@ -396,7 +396,6 @@ int GVid::detectadapter() {
FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL,
OPEN_EXISTING, OPEN_EXISTING,
FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH, NULL); FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH, NULL);
// gvid_hout = GetStdHandle(STD_OUTPUT_HANDLE);
adapter = V_VGA; adapter = V_VGA;
@ -762,7 +761,7 @@ void GVid::setrows(int _rows) {
} }
if(adapter >= V_EGA) { if(adapter >= V_EGA) {
if(_rows == 28 and adapter >= V_VGA) { // vga-only if((_rows == 28) and (adapter >= V_VGA)) { // vga-only
cpu.ax(0x1202); cpu.ax(0x1202);
cpu.bl(0x30); cpu.bl(0x30);
cpu.genint(0x10); cpu.genint(0x10);
@ -811,7 +810,7 @@ void GVid::setrows(int _rows) {
viomodeinfo.row = (USHORT)_rows; viomodeinfo.row = (USHORT)_rows;
VioSetMode(&viomodeinfo, 0); VioSetMode(&viomodeinfo, 0);
#elif defined(__WIN32__) or defined(__UNIX__) #elif defined(__WIN32__) || defined(__UNIX__)
NW(_rows); NW(_rows);
@ -852,7 +851,7 @@ void GVid::setoverscan(int _overscan) {
viooverscan.color = (BYTE)_overscan; viooverscan.color = (BYTE)_overscan;
VioSetState(&viooverscan, 0); VioSetState(&viooverscan, 0);
#elif defined(__WIN32__) or defined(__UNIX__) #elif defined(__WIN32__) || defined(__UNIX__)
NW(_overscan); NW(_overscan);
@ -910,7 +909,7 @@ void GVid::setintensity(int _intensity) {
viointensity.type = 0x0002; viointensity.type = 0x0002;
VioSetState(&viointensity, 0); VioSetState(&viointensity, 0);
#elif defined(__WIN32__) or defined(__UNIX__) #elif defined(__WIN32__) || defined(__UNIX__)
NW(_intensity); NW(_intensity);
@ -959,7 +958,7 @@ void GVid::getpalette(int* _palette) {
for(byte n=0; n<16; n++) for(byte n=0; n<16; n++)
_palette[n] = pviopalstate->acolor[n]; _palette[n] = pviopalstate->acolor[n];
#elif defined(__WIN32__) or defined(__UNIX__) #elif defined(__WIN32__) || defined(__UNIX__)
NW(_palette); NW(_palette);
@ -1004,7 +1003,7 @@ void GVid::setpalette(int* _palette) {
pviopalstate->acolor[n] = (USHORT)_palette[n]; pviopalstate->acolor[n] = (USHORT)_palette[n];
VioSetState(pviopalstate, 0); VioSetState(pviopalstate, 0);
#elif defined(__WIN32__) or defined(__UNIX__) #elif defined(__WIN32__) || defined(__UNIX__)
NW(_palette); NW(_palette);
@ -1033,7 +1032,7 @@ void GVid::resize_screen(int columns, int rows) {
bufwrd = (vatch*)throw_xrealloc(bufwrd, (numcols+1)*sizeof(vatch)); bufwrd = (vatch*)throw_xrealloc(bufwrd, (numcols+1)*sizeof(vatch));
bufansi = (vchar*)throw_xrealloc(bufansi, 1+(11*numcols)); bufansi = (vchar*)throw_xrealloc(bufansi, 1+(11*numcols));
#if defined(__UNIX__) and not defined(__USE_NCURSES__) #if defined(__UNIX__) && !defined(__USE_NCURSES__)
dmaptr = (gdma)throw_xrealloc(dmaptr, (rows+1)*columns*sizeof(word)); dmaptr = (gdma)throw_xrealloc(dmaptr, (rows+1)*columns*sizeof(word));
#endif #endif
} }

View File

@ -439,7 +439,7 @@ bool gareafile::ReadAreafile(word crc, char* parameters) {
#ifndef GCFG_NORA #ifndef GCFG_NORA
case CRC_REMOTEACCESS: ReadRemoteAccess(parameters); break; case CRC_REMOTEACCESS: ReadRemoteAccess(parameters); break;
#endif #endif
#if not defined(GCFG_NOSQSH) or not defined(GCFG_NOPARTOSS) #if !defined(GCFG_NOSQSH) || !defined(GCFG_NOPARTOSS)
case CRC_PARTOSS: case CRC_PARTOSS:
case CRC_SQUISH: ReadSquish(parameters); break; case CRC_SQUISH: ReadSquish(parameters); break;
#endif #endif

View File

@ -283,7 +283,7 @@ protected:
#ifndef GCFG_NOQECHO #ifndef GCFG_NOQECHO
void ReadQEchoFile(char* file, char* options, char* origin); void ReadQEchoFile(char* file, char* options, char* origin);
#endif #endif
#if not defined(GCFG_NOSQSH) or not defined(GCFG_NOPARTOSS) #if !defined(GCFG_NOSQSH) || !defined(GCFG_NOPARTOSS)
void ReadSquishFile(char* path, char* file, char* options, char* origin, int group); void ReadSquishFile(char* path, char* file, char* options, char* origin, int group);
#endif #endif
#ifndef GCFG_NOTIMED #ifndef GCFG_NOTIMED
@ -412,7 +412,7 @@ public:
#ifndef GCFG_NORA #ifndef GCFG_NORA
void ReadRemoteAccess(char* tag); void ReadRemoteAccess(char* tag);
#endif #endif
#if not defined(GCFG_NOSQSH) or not defined(GCFG_NOPARTOSS) #if !defined(GCFG_NOSQSH) || !defined(GCFG_NOPARTOSS)
void ReadSquish(char* tag); void ReadSquish(char* tag);
#endif #endif
#ifndef GCFG_NOSBBS #ifndef GCFG_NOSBBS

View File

@ -71,7 +71,7 @@ bool gareafile::jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Read areas from HPT (echomail processor) // Read areas from Crashmail (echomail processor)
void gareafile::ReadCrashmail(char* tag) { void gareafile::ReadCrashmail(char* tag) {

View File

@ -164,7 +164,7 @@ int EzycomArea::raw_open() {
int _sopen_access = data->omode | O_BINARY; int _sopen_access = data->omode | O_BINARY;
int _sopen_permit = 0; 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_access |= O_CREAT;
_sopen_permit = S_STDRW; _sopen_permit = S_STDRW;
} }
@ -193,7 +193,7 @@ int EzycomArea::raw_open() {
break; break;
} }
Path _path; 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); mkdir(ret_mess_area(_path), S_IWUSR);
_tryagain++; _tryagain++;
} }
@ -218,10 +218,10 @@ void EzycomArea::test_raw_open(int __fileline) {
_isopen = raw_open(); _isopen = raw_open();
if(NOT _isopen) { if(not _isopen) {
// Tell the world // 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 // User requested to exit
WideLog->erropen(__FILE__, __fileline); WideLog->erropen(__FILE__, __fileline);
@ -231,7 +231,7 @@ void EzycomArea::test_raw_open(int __fileline) {
OpenErrorExit(); OpenErrorExit();
} }
} }
} while(NOT _isopen); } while(not _isopen);
// Remove the popup window // Remove the popup window
if(_tries) if(_tries)
@ -266,7 +266,7 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) {
Path _path; Path _path;
*_path = NUL; *_path = NUL;
char* _ptr = getenv("EZY"); char* _ptr = getenv("EZY");
if(_ptr AND *_ptr) { if(_ptr and *_ptr) {
_ptr = strcpy(_path, _ptr); _ptr = strcpy(_path, _ptr);
char* _ptr2 = strchr(_ptr, ' '); char* _ptr2 = strchr(_ptr, ' ');
if(_ptr2) if(_ptr2)
@ -275,12 +275,12 @@ void EzycomInit(const char* msgbasepath, const char* userbasepath, int userno) {
} }
const char* _file = ""; const char* _file = "";
_ptr = getenv("TASK"); _ptr = getenv("TASK");
if(_ptr AND *_ptr) { if(_ptr and *_ptr) {
char _tmp[20]; char _tmp[20];
sprintf(_tmp, "CONFIG.%u", atoi(_ptr)); sprintf(_tmp, "CONFIG.%u", atoi(_ptr));
_file = AddPath(_path, _tmp); _file = AddPath(_path, _tmp);
} }
if(NOT fexist(_file)) if(not fexist(_file))
_file = AddPath(_path, "CONFIG.EZY"); _file = AddPath(_path, "CONFIG.EZY");
ezycomwide->ver = 102; 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); ezycomwide->user->extfh = ::sopen(AddPath(ezycomwide->userbasepath, "USERSEXT.BBS"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(ezycomwide->user->extfh != -1) { if(ezycomwide->user->extfh != -1) {
ezycomwide->user->find(_username); 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); WideLog->printf("* User \"%s\" not found in %sUSERS.BBS.", _username, ezycomwide->userbasepath);
ezycomwide->user->add(_username); ezycomwide->user->add(_username);
WideLog->printf("* Now added with user number %u.", ezycomwide->user->index); WideLog->printf("* Now added with user number %u.", ezycomwide->user->index);
@ -424,7 +424,7 @@ void EzycomArea::suspend() {
void EzycomArea::resume() { void EzycomArea::resume() {
GFTRK("EzycomResume"); GFTRK("EzycomResume");
if(NOT raw_open()) { if(not raw_open()) {
Path _path; Path _path;
WideLog->ErrOpen(); WideLog->ErrOpen();
WideLog->printf("! A Ezycom msgbase file could not be opened."); 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"); GFTRK("EzycomRawScan");
int _wasopen = isopen; int _wasopen = isopen;
if(NOT _wasopen) { if(not _wasopen) {
isopen++; isopen++;
data_open(); data_open();
test_raw_open(__LINE__); test_raw_open(__LINE__);
@ -73,7 +73,7 @@ void EzycomArea::raw_scan(int __keep_index) {
while(1) { while(1) {
// Set lastread pointer // Set lastread pointer
if((*_msgnoptr >= _lastread) AND (_lastread_reln == 0)) { if((*_msgnoptr >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = *_msgnoptr; _lastreadfound = *_msgnoptr;
_lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0); _lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0);
break; break;
@ -85,7 +85,7 @@ void EzycomArea::raw_scan(int __keep_index) {
} }
// If the exact lastread was not found // If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) { if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) if(_lastread > _lastmsgno)
@ -101,10 +101,10 @@ void EzycomArea::raw_scan(int __keep_index) {
::close(_fh); ::close(_fh);
} }
if(NOT __keep_index) if(not __keep_index)
Msgn->Reset(); Msgn->Reset();
if(NOT _wasopen) { if(not _wasopen) {
raw_close(); raw_close();
data_close(); data_close();
isopen--; 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.rrq(__hdr.netattr & EZYC_NETATTR_RREQ);
__msg->attr.arq(__hdr.netattr & EZYC_NETATTR_AREQ); __msg->attr.arq(__hdr.netattr & EZYC_NETATTR_AREQ);
__msg->attr.rrc(__hdr.netattr & EZYC_NETATTR_RREC); __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->ezycom.extattr = __hdr.extattr;
__msg->timesread = (__hdr.extattr & EZYC_EXTATTR_SEEN) ? 1 : 0; __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) { void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
int _was_locked = data->islocked; int _was_locked = data->islocked;
if(NOT _was_locked) if(not _was_locked)
lock(); lock();
if(__mode & GMSG_NEW) if(__mode & GMSG_NEW)
@ -140,7 +140,7 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
// Write the message text // Write the message text
uint _size = strlen(__msg->txt) + 1; 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); __hdr.startposition = filelength(data->fhtxt);
lseekset(data->fhtxt, __hdr.startposition); lseekset(data->fhtxt, __hdr.startposition);
write(data->fhtxt, __msg->txt, _size); write(data->fhtxt, __msg->txt, _size);
@ -238,7 +238,7 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
Msgn->Append(__msg->msgno); Msgn->Append(__msg->msgno);
} }
if(NOT _was_locked) if(not _was_locked)
unlock(); unlock();
GFTRK(NULL); 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); _fh = ::sopen(__file, __openmode, __sharemode, S_STDRW);
if(_fh == -1) { 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 // Return instead of halting if requested
if(errno != EACCES AND NOT __fail) { if((errno != EACCES) and not __fail) {
GFTRK(NULL); GFTRK(NULL);
return _fh; 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); fidowide->user->fh = ::sopen(userfile, O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(fidowide->user->fh != -1) { if(fidowide->user->fh != -1) {
fidowide->user->find(_username); fidowide->user->find(_username);
if(NOT fidowide->user->found) { if(not fidowide->user->found) {
WideLog->printf("* User \"%s\" not found in %s.", _username, userfile); WideLog->printf("* User \"%s\" not found in %s.", _username, userfile);
fidowide->user->add(_username); fidowide->user->add(_username);
WideLog->printf("* Now added with user number %u.", fidowide->user->index); 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) { while(1) {
// Set lastread pointer // Set lastread pointer
if((*_msgnoptr >= _lastread) AND (_lastread_reln == 0)) { if((*_msgnoptr >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = *_msgnoptr; _lastreadfound = *_msgnoptr;
_lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0); _lastread_reln = _count - (*_msgnoptr != _lastread ? 1 : 0);
break; break;
@ -101,7 +101,7 @@ void FidoArea::raw_scan(bool __scanpm) {
} }
// If the exact lastread was not found // If the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) { if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) if(_lastread > _lastmsgno)
@ -112,7 +112,7 @@ void FidoArea::raw_scan(bool __scanpm) {
// Read highwater mark // Read highwater mark
data->highwatermark = 0; 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); _fh = test_open(AddPath(path(), "1.msg"), O_RDONLY|O_BINARY, WideSharemode);
if(_fh != -1) { if(_fh != -1) {
read(_fh, &_hdr, sizeof(FidoHdr)); 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)); __msg->attr.lok(not (st.st_mode & S_IWUSR));
// Set the unsent attribute // Set the unsent attribute
if(isnet() OR (isecho() AND NOT wide->fidohwmarks)) if(isnet() or (isecho() and not wide->fidohwmarks))
__msg->attr.uns((__hdr.attr & FIDO_LOCAL) AND NOT (__hdr.attr & FIDO_SENT)); __msg->attr.uns((__hdr.attr & FIDO_LOCAL) and not (__hdr.attr & FIDO_SENT));
else if(isecho() AND wide->fidohwmarks) { else if(isecho() and wide->fidohwmarks) {
__msg->attr.uns(data->highwatermark < __msg->msgno); __msg->attr.uns(data->highwatermark < __msg->msgno);
__msg->attr.snt(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. // Never create a new 1.MSG in echo or local areas.
if(__msg->msgno == 1) { if(__msg->msgno == 1) {
if(NOT isnet()) { if(not isnet()) {
__msg->msgno = 2; __msg->msgno = 2;
build_msgname(_msgfile, __msg->msgno); 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); int _fh = test_open(_msgfile, _omode, WideSharemode, YES);
// Get date/time of message file // Get date/time of message file
if(NOT(__mode & GMSG_NEW)) { if(not (__mode & GMSG_NEW) and not __msg->attr.upd()) {
if(NOT __msg->attr.upd()) fstat(_fh, &st);
fstat(_fh, &st);
} }
memset(&__hdr, 0, sizeof(FidoHdr)); memset(&__hdr, 0, sizeof(FidoHdr));
@ -189,13 +188,11 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
::close(_fh); ::close(_fh);
// Reset date/time of message file // Reset date/time of message file
if(NOT(__mode & GMSG_NEW)) { if(not (__mode & GMSG_NEW) and not __msg->attr.upd()) {
if(NOT __msg->attr.upd()) { struct utimbuf t;
struct utimbuf t; t.actime = st.st_atime;
t.actime = st.st_atime; t.modtime = st.st_mtime;
t.modtime = st.st_mtime; utime(_msgfile, &t);
utime(_msgfile, &t);
}
} }
// If the message has locked status, make it read-only // 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 // In echo or local, start with 2.MSG so we don't conflict
// with highwater marks, unless there is already a 1.MSG // with highwater marks, unless there is already a 1.MSG
ulong _msgno1st = 1; ulong _msgno1st = 1;
if((NOT isnet()) AND (Msgn->at(0) != 1)) if(not isnet() and (Msgn->at(0) != 1))
_msgno1st++; _msgno1st++;
// Renumber *.MSG files // Renumber *.MSG files
@ -105,7 +105,7 @@ int FidoArea::renumber() {
read(_fh, &_hdr, sizeof(FidoHdr)); read(_fh, &_hdr, sizeof(FidoHdr));
// Update the replylinks // Update the replylinks
if(_hdr.replyto OR _hdr.reply1st) { if(_hdr.replyto or _hdr.reply1st) {
_hdr.replyto = (word)Msgn->ToReln(_hdr.replyto); _hdr.replyto = (word)Msgn->ToReln(_hdr.replyto);
_hdr.reply1st = (word)Msgn->ToReln(_hdr.reply1st); _hdr.reply1st = (word)Msgn->ToReln(_hdr.reply1st);
lseekset(_fh, 0); 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; scn = NULL;
// Open complete msgbase, create if none exists // 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); WideLog->printf("* Creating new msgbase at %s", path);
raw_open(O_CREAT); raw_open(O_CREAT);
if(filelength(fhinf) == 0) { 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 _hdrsize = filelength(fhhdr)/(long)sizeof(HudsHdr);
long _idxsize = filelength(fhidx)/(long)sizeof(HudsIdx); long _idxsize = filelength(fhidx)/(long)sizeof(HudsIdx);
long _toisize = filelength(fhtoi)/(long)sizeof(HudsToIdx); long _toisize = filelength(fhtoi)/(long)sizeof(HudsToIdx);
if((_hdrsize != _idxsize) OR (_hdrsize != _toisize)) { if((_hdrsize != _idxsize) or (_hdrsize != _toisize)) {
raw_close(); raw_close();
HGWarnRebuild(); HGWarnRebuild();
WideLog->ErrIndex(); WideLog->ErrIndex();
@ -137,7 +137,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
ra2usersbbs = 2; ra2usersbbs = 2;
// If it matches both of them // If it matches both of them
if(hudsmatch AND ra2match) { if(hudsmatch and ra2match) {
// Check version in CONFIG.RA to make sure // Check version in CONFIG.RA to make sure
Path rapath, file; 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 it does not match either of them
if(NOT hudsmatch AND NOT ra2match) { if(not hudsmatch and not ra2match) {
WideLog->ErrIndex(); WideLog->ErrIndex();
WideLog->printf("! The users.bbs file has an incorrect size."); WideLog->printf("! The users.bbs file has an incorrect size.");
WideLog->printf(": %susers.bbs, %lu bytes.", path, len); 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) { if(userno == -1) {
user->fh = fhusr; user->fh = fhusr;
user->find(_username); 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); WideLog->printf("* User \"%s\" not found in %susers%s.", _username, path, __HUDSON ? HUDS_EXT : GOLD_EXT);
user->add(_username); user->add(_username);
WideLog->printf("* Now added with user number %u.", user->index); 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"); GFTRK("HudsLock");
if(NOT islocked AND WideCanLock) { if(not islocked and WideCanLock) {
long _tries = 0; long _tries = 0;
@ -251,7 +251,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::unlock() {
GFTRK("HudsUnlock"); GFTRK("HudsUnlock");
if(islocked AND WideCanLock) { if(islocked and WideCanLock) {
::unlock(fhinf, sizeof(HudsInfo)+1, 1); ::unlock(fhinf, sizeof(HudsInfo)+1, 1);
islocked = false; 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)) { if(_msgidx_ptr->msgno != (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO)) {
register int _idxboard = _msgidx_ptr->board; 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); _scan = scn + (_idxboard - 1);
@ -326,11 +326,11 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan() {
_scan->count++; _scan->count++;
// Set first message number // Set first message number
if(NOT _scan->firstmsgno) if(not _scan->firstmsgno)
_scan->firstmsgno = _scan->lastmsgno; _scan->firstmsgno = _scan->lastmsgno;
// Set lastread pointer // 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->lastreadfound = _scan->lastmsgno;
_scan->lastreadreln = _scan->count - (_scan->lastmsgno != _scan->lastread ? 1 : 0); _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)) { while(_board < (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)) {
// Check/fix lastreads // Check/fix lastreads
if(_scan->count AND (_scan->lastreadfound != _scan->lastread)) { if(_scan->count and (_scan->lastreadfound != _scan->lastread)) {
if(_scan->lastread > _scan->lastmsgno) if(_scan->lastread > _scan->lastmsgno)
_scan->lastreadreln = _scan->count; _scan->lastreadreln = _scan->count;
else if(_scan->lastread < _scan->firstmsgno) 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) if(!wide)
wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide); wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide);
if(wide->iswideopen AND NOT wide->iswidescanned) if(wide->iswideopen and not wide->iswidescanned)
wide->scan(); wide->scan();
// Get wide scan data if any // 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 // Open the msgbase if it wasn't already
int _was_open = wide->isopen; int _was_open = wide->isopen;
if(NOT _was_open) if(not _was_open)
wide->open(); wide->open();
// Get the number of active msgs in the area // 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) { while(_msgidx_count < _msgidx_total) {
// Is it our board and is the msg not deleted? // 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 // Get message number
_lastmsgno = _msgidx_ptr->msgno; _lastmsgno = _msgidx_ptr->msgno;
_msg_count++; _msg_count++;
// Set first message number // Set first message number
if(NOT _firstmsgno) if(not _firstmsgno)
_firstmsgno = _lastmsgno; _firstmsgno = _lastmsgno;
// Transfer data to the index // 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; *_msgno_ptr++ = _lastmsgno;
// Set lastread pointer // Set lastread pointer
if((_lastmsgno >= _lastread) AND (_lastread_reln == 0)) { if((_lastmsgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _lastmsgno; _lastreadfound = _lastmsgno;
_lastread_reln = _msg_count - (_lastmsgno != _lastread ? 1 : 0); _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 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? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) 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 // Close the msgbase again if we opened it in here
if(NOT _was_open) if(not _was_open)
wide->close(); wide->close();
} }
@ -572,7 +572,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan_pm() {
GFTRK("HudsWideScanPM"); GFTRK("HudsWideScanPM");
if(NOT iswidescanned) if(not iswidescanned)
scan(); scan();
ispmscanned = true; 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 // Skip msgs in invalid boards
idxboard = idxptr->board; idxboard = idxptr->board;
if(NOT(idxboard AND (idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)))) { if(not (idxboard and (idxboard <= (__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD)))) {
invalidboards++; invalidboards++;
continue; continue;
} }
@ -669,7 +669,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan_area_pm()
if(!wide) if(!wide)
wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide); wide = (HudsWide*) (__HUDSON ? (void *)hudsonwide : (void *)goldbasewide);
if(wide->iswideopen AND NOT wide->ispmscanned) if(wide->iswideopen and not wide->ispmscanned)
wide->scan_pm(); wide->scan_pm();
// Get wide scan data if any // 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 // Lock msgbase before doing anything
int _was_locked = wide->islocked; int _was_locked = wide->islocked;
if(NOT _was_locked) if(not _was_locked)
lock(); lock();
// Find header index // 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 // If the msg is new or the text is too large to fit
uint _txtlen = strlen(__msg->txt)+1; 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); __hdr.startrec = (msgn_t)(filelength(wide->fhtxt)/256L);
// Calculate the number of text records to write // 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)); write(wide->fhinf, &wide->msginfo, sizeof(HudsInfo));
// Update scanning files // 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); 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); wide->update_netecho(__HUDSON ? "echomail" HUDS_EXT : "echomail" GOLD_EXT, _hdridx, __hdr.msgattr & HUDS_DELETED);
if(__mode & GMSG_NEW) { 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 // Unlock msgbase after use
if(NOT _was_locked) if(not _was_locked)
unlock(); unlock();
GFTRK(NULL); GFTRK(NULL);

View File

@ -69,7 +69,7 @@ int JamArea::test_open(const char* file) {
if(fh == -1) { if(fh == -1) {
// Tell the world // Tell the world
if((errno != EACCES) OR (PopupLocked(++tries, false, file) == false)) { if((errno != EACCES) or (PopupLocked(++tries, false, file) == false)) {
WideLog->ErrOpen(); WideLog->ErrOpen();
raw_close(); raw_close();
WideLog->printf("! A JAM msgbase file could not be opened."); 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.jhr", path()); data->fhjhr = test_open(file);
sprintf(file, "%s.jdx", path()); data->fhjdx = test_open(file); sprintf(file, "%s.jdx", path()); data->fhjdx = test_open(file);
sprintf(file, "%s.jlr", path()); data->fhjlr = 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); sprintf(file, "%s.jdt", path()); data->fhjdt = test_open(file);
if(not jamwide->smapihw) { if(not jamwide->smapihw) {
sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW); 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 user was not found, init the lastread with our values
if(NOT founduser) { if(not founduser) {
data->lastrec.usercrc = wide->usercrc; data->lastrec.usercrc = wide->usercrc;
data->lastrec.userid = wide->userid; data->lastrec.userid = wide->userid;
data->lastrec.lastread = 0; 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 // Open the msgbase if it wasn't already
int _was_open = isopen; int _was_open = isopen;
if(NOT _was_open) { if(not _was_open) {
if(NOT __keep_index OR __scanpm) if(not __keep_index or __scanpm)
just_scanning = true; just_scanning = true;
isopen++; isopen++;
data_open(); data_open();
@ -241,14 +241,14 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
register JamIndex* _jdxptr = _jdxbuf; register JamIndex* _jdxptr = _jdxbuf;
// Fill message index // Fill message index
while(_msgno<_total) { while(_msgno < _total) {
if(_jdxptr->hdroffset != 0xFFFFFFFFL) { if(_jdxptr->hdroffset != 0xFFFFFFFFL) {
_active++; _active++;
if(NOT _firstmsgno) if(not _firstmsgno)
_firstmsgno = _msgno; _firstmsgno = _msgno;
if(__keep_index) if(__keep_index)
*_msgndxptr++ = _msgno; *_msgndxptr++ = _msgno;
if((_msgno >= _lastread) AND (_lastread_reln == 0)) { if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno; _lastreadfound = _msgno;
_lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0)); _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 the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) { if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) if(_lastread > _lastmsgno)
@ -298,8 +298,8 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
JamHdr hdr; JamHdr hdr;
lseekset(data->fhjhr, idx->hdroffset); lseekset(data->fhjhr, idx->hdroffset);
read(data->fhjhr, &hdr, sizeof(JamHdr)); read(data->fhjhr, &hdr, sizeof(JamHdr));
if(NOT (hdr.attribute & JAMATTR_READ)) { if(not (hdr.attribute & JAMATTR_READ)) {
if(NOT (hdr.attribute & JAMATTR_DELETED)) { if(not (hdr.attribute & JAMATTR_DELETED)) {
PMrk->Append(hdr.messagenumber); PMrk->Append(hdr.messagenumber);
} }
} }
@ -328,7 +328,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
throw_free(_jdxbuf); throw_free(_jdxbuf);
// Close the msgbase again if we opened it in here // Close the msgbase again if we opened it in here
if(NOT _was_open) { if(not _was_open) {
raw_close(); raw_close();
data_close(); data_close();
isopen--; 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.lok(__hdr.attribute & JAMATTR_LOCKED);
__msg->attr.del(__hdr.attribute & JAMATTR_DELETED); __msg->attr.del(__hdr.attribute & JAMATTR_DELETED);
if(isnet() OR isecho()) if(isnet() or isecho())
__msg->attr.uns(__msg->attr.loc() AND NOT __msg->attr.snt()); __msg->attr.uns(__msg->attr.loc() and not __msg->attr.snt());
else else
__msg->attr.uns0(); __msg->attr.uns0();
@ -140,7 +140,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
switch(_subfieldptr->loid) { switch(_subfieldptr->loid) {
case JAMSUB_OADDRESS: case JAMSUB_OADDRESS:
if(NOT _got_oaddr) { if(not _got_oaddr) {
_got_oaddr = true; _got_oaddr = true;
__msg->oorig.set(_buf, __msg->odom); __msg->oorig.set(_buf, __msg->odom);
__msg->orig = __msg->oorig; __msg->orig = __msg->oorig;
@ -161,7 +161,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
break; break;
case JAMSUB_DADDRESS: case JAMSUB_DADDRESS:
if(NOT _got_daddr) { if(not _got_daddr) {
_got_daddr = true; _got_daddr = true;
__msg->odest.set(_buf, __msg->ddom); __msg->odest.set(_buf, __msg->ddom);
__msg->dest = __msg->odest; __msg->dest = __msg->odest;
@ -184,7 +184,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
__msg->msgid.reset_fast(); __msg->msgid.reset_fast();
if(atoi(__msg->msgids)) { if(atoi(__msg->msgids)) {
__msg->msgid.set(__msg->msgids, __msg->odom); __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; __msg->orig = __msg->msgid;
} }
break; break;
@ -304,10 +304,10 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
throw_free(_subfield); throw_free(_subfield);
// Get reply numbers in chain // Get reply numbers in chain
if(wide->lookreplies AND __msg->link.first()) { if(wide->lookreplies and __msg->link.first()) {
int r = 0; int r = 0;
ulong m = __msg->link.first(); ulong m = __msg->link.first();
while(m AND (r<__msg->link.list_max())) { while(m and (r < __msg->link.list_max())) {
JamHdr _rhdr; JamHdr _rhdr;
memset(&_rhdr, 0, sizeof(JamHdr)); memset(&_rhdr, 0, sizeof(JamHdr));
lseekset(data->fhjdx, m-data->hdrinfo.basemsgnum, sizeof(JamIndex)); lseekset(data->fhjdx, m-data->hdrinfo.basemsgnum, sizeof(JamIndex));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -122,7 +122,7 @@ void XbbsWideClose();
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// When not in OS/2, use DUMMY AdeptXBBS functions // When not in OS/2, use DUMMY AdeptXBBS functions
#if not defined(__OS2__) #if !defined(__OS2__)
#ifndef GMB_NOXBBS #ifndef GMB_NOXBBS
inline void XbbsInit(const char*, int) { } 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); squishwide->user->fh = ::sopen(userfile, O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(squishwide->user->fh != -1) { if(squishwide->user->fh != -1) {
squishwide->user->find(_username); squishwide->user->find(_username);
if(NOT squishwide->user->found) { if(not squishwide->user->found) {
WideLog->printf("* User \"%s\" not found in %s.", _username, userfile); WideLog->printf("* User \"%s\" not found in %s.", _username, userfile);
squishwide->user->add(_username); squishwide->user->add(_username);
WideLog->printf("* Now added with user number %u.", squishwide->user->index); 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 // Open Squish files for scanning unless they are already open
if(NOT isopen) { if(not isopen) {
data->idx = NULL; data->idx = NULL;
data->base.totalmsgs = 0; 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 // If there appear to be only one record, experience shows that
// there may in fact be zero! So check the *.SQD base record for // there may in fact be zero! So check the *.SQD base record for
// the exact number of msgs in this case or if requested. // 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 // Open, read and close data file
data->fhsqd = ::sopen(AddPath(path(), ".sqd"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD); 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; *_msgndxptr++ = _msgno;
// Check for premature end of index (free frames) // Check for premature end of index (free frames)
if((_msgno <= _lastmsgno) OR (_msgno == 0xFFFFFFFFL)) { if((_msgno <= _lastmsgno) or (_msgno == 0xFFFFFFFFL)) {
_active--; _active--;
if((_msgno == _lastmsgno) AND _active == 1) { if((_msgno == _lastmsgno) and (_active == 1)) {
_lastread_reln = 0; _lastread_reln = 0;
_active = 0; _active = 0;
} }
@ -167,7 +167,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
} }
// Get the lastread // Get the lastread
if((_msgno >= _lastread) AND (_lastread_reln == 0)) { if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno; _lastreadfound = _msgno;
_lastread_reln = _active - (_msgno != _lastread ? 1 : 0); _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 the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) { if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) 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); read(_fhsqd, _src, (uint)_frm.ctlsize);
// Convert Squish control info to true kludges // 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 // 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; *_dest++ = *_src;
_src++; _src++;
// Copy the rest of the kludge and add a CR termination // 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++ = *_src++;
*_dest++ = CR; *_dest++ = CR;
} }
@ -156,7 +156,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
__msg->attr.lok(__hdr.attr & MSGLOK); __msg->attr.lok(__hdr.attr & MSGLOK);
if(isnet()) { 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()) { if(wide->direct and __msg->attr.hld() and __msg->attr.cra()) {
// Translate hld+cra to dir attribute // Translate hld+cra to dir attribute
__msg->attr.dir1(); __msg->attr.dir1();
@ -165,7 +165,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
} }
} }
else if(isecho()) 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 else
__msg->attr.uns0(); __msg->attr.uns0();

View File

@ -42,7 +42,7 @@ void SquishArea::lock() {
GFTRK("SquishLock"); GFTRK("SquishLock");
if(NOT data->islocked) { if(not data->islocked) {
if(WideCanLock) { if(WideCanLock) {
long _tries = 0; long _tries = 0;
while(::lock(data->fhsqd, 0, 1) == -1) { while(::lock(data->fhsqd, 0, 1) == -1) {
@ -72,7 +72,7 @@ void SquishArea::unlock() {
GFTRK("SquishUnlock"); GFTRK("SquishUnlock");
if(WideCanLock AND data->islocked) if(WideCanLock and data->islocked)
::unlock(data->fhsqd, 0, 1); ::unlock(data->fhsqd, 0, 1);
lseekset(data->fhsqd, 0); lseekset(data->fhsqd, 0);
write(data->fhsqd, &data->base, sizeof(SqshBase)); write(data->fhsqd, &data->base, sizeof(SqshBase));
@ -164,7 +164,7 @@ void SquishArea::delete_msg(uint __reln) {
GFTRK("SquishDeleteMsg"); GFTRK("SquishDeleteMsg");
int _was_locked = data->islocked; int _was_locked = data->islocked;
if(NOT _was_locked) if(not _was_locked)
lock(); lock();
// Setup some local variables for speed // Setup some local variables for speed
@ -203,7 +203,7 @@ void SquishArea::delete_msg(uint __reln) {
if(lastread) if(lastread)
lastread--; lastread--;
if(NOT _was_locked) if(not _was_locked)
unlock(); unlock();
GFTRK(NULL); GFTRK(NULL);
@ -342,10 +342,10 @@ uint SquishArea::find_msgn(ulong __tagn) {
register SqshIdx* tag = data->idx; register SqshIdx* tag = data->idx;
register uint tags = (uint)data->base.totalmsgs; 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; return 0;
if(tags AND __tagn) { if(tags and __tagn) {
register long _mid; register long _mid;
register long _left = 0; register long _left = 0;
@ -462,7 +462,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
SqshFrm _oldfrm, _newfrm; SqshFrm _oldfrm, _newfrm;
dword _newframe = SQFRAME_NULL; dword _newframe = SQFRAME_NULL;
dword _oldframe = _idx ? _idx[_reln].offset : _base.endframe; 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 // Get the original frame and see if there is still room for the msg
read_frm(_oldframe, &_oldfrm); 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 // If there is a max msgs limit and are we writing a new
// msg, delete msgs to (hopefully) make room for this msg // 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) while(_base.maxmsgs <= _base.totalmsgs)
delete_msg((uint)_base.protmsgs); 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 // Open WildCat! files for scanning unless they are already open
if(NOT isopen) { if(not isopen) {
data->idx = NULL; data->idx = NULL;
data->base.recsize = 0; data->base.recsize = 0;
@ -131,13 +131,13 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
_active++; _active++;
_msgno = (_ixptr++)->msgno; _msgno = (_ixptr++)->msgno;
if(NOT _firstmsgno) if(not _firstmsgno)
_firstmsgno = _msgno; _firstmsgno = _msgno;
if(__keep_index) if(__keep_index)
*_msgndxptr++ = _msgno; *_msgndxptr++ = _msgno;
// Get the lastread // Get the lastread
if((_msgno >= _lastread) AND (_lastread_reln == 0)) { if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno; _lastreadfound = _msgno;
_lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0)); _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 the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) { if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) if(_lastread > _lastmsgno)
@ -168,7 +168,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
} }
// Free index buffer if just counting // Free index buffer if just counting
if(NOT __keep_index OR __scanpm) if(not __keep_index or __scanpm)
throw_release(data->idx); throw_release(data->idx);
if(_was_data == NULL) { 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; __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); JDN2YMD(__hdr.msgdate+1, &_year, &_month, &_day);
_time = __hdr.msgtime-1; _time = __hdr.msgtime-1;
_hour = (unsigned)(_time / 3600L); _hour = (unsigned)(_time / 3600L);
_minute = (unsigned)((_time % 3600L) / 60L); _minute = (unsigned)((_time % 3600L) / 60L);
_second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*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_mon = _month - 1;
_tm.tm_mday = _day; _tm.tm_mday = _day;
_tm.tm_hour = _hour; _tm.tm_hour = _hour;
@ -110,13 +110,13 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
__msg->written = a + a - b; __msg->written = a + a - b;
} }
if(__hdr.readdate AND __hdr.readtime) { if(__hdr.readdate and __hdr.readtime) {
JDN2YMD(__hdr.readdate+1, &_year, &_month, &_day); JDN2YMD(__hdr.readdate+1, &_year, &_month, &_day);
_time = __hdr.readtime-1; _time = __hdr.readtime-1;
_hour = (unsigned)(_time / 3600L); _hour = (unsigned)(_time / 3600L);
_minute = (unsigned)((_time % 3600L) / 60L); _minute = (unsigned)((_time % 3600L) / 60L);
_second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*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_mon = _month - 1;
_tm.tm_mday = _day; _tm.tm_mday = _day;
_tm.tm_hour = _hour; _tm.tm_hour = _hour;

View File

@ -41,7 +41,7 @@ void WCatArea::lock() {
GFTRK("WCatLock"); GFTRK("WCatLock");
if(NOT data->islocked) { if(not data->islocked) {
if(WideCanLock) { if(WideCanLock) {
long _tries = 0; long _tries = 0;
while(::lock(data->fhix, 0, 1) == -1) { while(::lock(data->fhix, 0, 1) == -1) {
@ -70,7 +70,7 @@ void WCatArea::lock() {
void WCatArea::unlock() { void WCatArea::unlock() {
GFTRK("WCatUnlock"); GFTRK("WCatUnlock");
if(WideCanLock AND data->islocked) if(WideCanLock and data->islocked)
::unlock(data->fhix, 0, 1); ::unlock(data->fhix, 0, 1);
data->islocked = false; data->islocked = false;
@ -83,7 +83,7 @@ void WCatArea::unlock() {
void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
int _was_locked = data->islocked; int _was_locked = data->islocked;
if(NOT _was_locked) if(not _was_locked)
lock(); lock();
memset(&__hdr, 0, sizeof(WCatHdr)); 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))); 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"); strcpy(__msg->wildcat.network, "FTSC");
strc2p(strcpy(__hdr.network, __msg->wildcat.network)); strc2p(strcpy(__hdr.network, __msg->wildcat.network));
if(__msg->written) { if(__msg->written) {
struct tm* _tm = gmtime(&__msg->written); struct tm* _tm = gmtime(&__msg->written);
int _year = _tm->tm_year % 100; __hdr.msgdate = (word)(YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday)-1);
__hdr.msgdate = (word)(YMD2JDN(1900+_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; __hdr.msgtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1;
} }
if(__msg->received) { if(__msg->received) {
struct tm* _tm = gmtime(&__msg->received); struct tm* _tm = gmtime(&__msg->received);
int _year = _tm->tm_year % 100; __hdr.readdate = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readdate = (word)YMD2JDN(1900+_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1; __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++; n++;
} }
if((__mode & GMSG_NEW) OR (_size > __hdr.msgbytes)) { if((__mode & GMSG_NEW) or (_size > __hdr.msgbytes)) {
if(_size > __hdr.msgbytes) { if(_size > __hdr.msgbytes) {
ulong _magic = MagicHeaderInactive; ulong _magic = MagicHeaderInactive;
lseekset(data->fhdat, data->idx[_reln].offset); lseekset(data->fhdat, data->idx[_reln].offset);
@ -220,7 +218,7 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
throw_free(_txt); throw_free(_txt);
} }
if(NOT _was_locked) if(not _was_locked)
unlock(); unlock();
GFTRK(NULL); 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::open() { }
inline void XbbsArea::save_lastread() { } inline void XbbsArea::save_lastread() { }
inline void XbbsArea::close() { } 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); xbbswide->user->fh = ::sopen(AddPath(xbbswide->path, "Users"), O_RDONLY|O_BINARY, WideSharemode);
if(xbbswide->user->fh != -1) { if(xbbswide->user->fh != -1) {
xbbswide->user->find(_username); xbbswide->user->find(_username);
if(NOT xbbswide->user->found) { if(not xbbswide->user->found) {
xbbswide->userno = 0; xbbswide->userno = 0;
//WideLog->printf("* User \"%s\" not found in %sUsers.", _username, xbbswide->path); //WideLog->printf("* User \"%s\" not found in %sUsers.", _username, xbbswide->path);
//xbbswide->user->add(_username); //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 // Open AdeptXBBS files for scanning unless they are already open
if(NOT isopen) { if(not isopen) {
data->idx = NULL; data->idx = NULL;
data->idx_size = 0; data->idx_size = 0;
@ -138,13 +138,13 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
_active++; _active++;
_msgno = _active; _msgno = _active;
if(NOT _firstmsgno) if(not _firstmsgno)
_firstmsgno = _msgno; _firstmsgno = _msgno;
if(__keep_index) if(__keep_index)
*_msgndxptr++ = _msgno; *_msgndxptr++ = _msgno;
// Get the lastread // Get the lastread
if((_msgno >= _lastread) AND (_lastread_reln == 0)) { if((_msgno >= _lastread) and (_lastread_reln == 0)) {
_lastreadfound = _msgno; _lastreadfound = _msgno;
_lastread_reln = (uint)(_active - (_msgno != _lastread ? 1 : 0)); _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 the exact lastread was not found
if(_active AND (_lastreadfound != _lastread)) { if(_active and (_lastreadfound != _lastread)) {
// Higher than highest or lower than lowest? // Higher than highest or lower than lowest?
if(_lastread > _lastmsgno) if(_lastread > _lastmsgno)
@ -175,7 +175,7 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
} }
// Free index buffer if just counting // Free index buffer if just counting
if(NOT __keep_index OR __scanpm) if(not __keep_index or __scanpm)
throw_release(data->idx); throw_release(data->idx);
if(_was_data == NULL) { if(_was_data == NULL) {

View File

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

View File

@ -62,7 +62,7 @@
#define __GPID__ "GoldNode+/386" #define __GPID__ "GoldNode+/386"
#elif defined(__linux__) #elif defined(__linux__)
#define __GPID__ "GoldNODE+/LNX" #define __GPID__ "GoldNODE+/LNX"
#elif defined(__FreeBSD__) or defined(__OpenBSD__) #elif defined(__FreeBSD__) || defined(__OpenBSD__)
#define __GPID__ "GoldNODE+/BSD" #define __GPID__ "GoldNODE+/BSD"
#else #else
#define __GPID__ "GoldNODE+" #define __GPID__ "GoldNODE+"
@ -1081,14 +1081,14 @@ static void fatal_error(const char* what) {
static int do_if(char* val) { static int do_if(char* val) {
if(strieql(val, "OS/2") OR strieql(val, "OS2")) { if(strieql(val, "OS/2") or strieql(val, "OS2")) {
#ifdef __OS2__ #ifdef __OS2__
return true; return true;
#else #else
return false; return false;
#endif #endif
} }
else if(strieql(val, "NT") OR strieql(val, "W32") OR strieql(val, "WIN32")) { else if(strieql(val, "NT") or strieql(val, "W32") or strieql(val, "WIN32")) {
#ifdef __WIN32__ #ifdef __WIN32__
return true; return true;
#else #else
@ -1128,7 +1128,7 @@ static int do_if(char* val) {
else if(strieql(val, "FIREBIRD")) { else if(strieql(val, "FIREBIRD")) {
return true; return true;
} }
else if(strieql(val, "YES") OR strieql(val, "TRUE") OR strieql(val, "ON")) else if(strieql(val, "YES") or strieql(val, "TRUE") or strieql(val, "ON"))
return true; return true;
return atoi(val) != 0; return atoi(val) != 0;
} }