64 bit platforms support

This commit is contained in:
Stas Degteff
2005-10-07 12:41:11 +00:00
parent 7345cbfdf2
commit 0885946b30
69 changed files with 683 additions and 737 deletions

View File

@@ -183,10 +183,10 @@ private:
enum { list_limit = 29 };
ulong reply_to;
ulong reply_first;
ulong reply_list[list_limit];
ulong reply_next;
uint32_t reply_to;
uint32_t reply_first;
uint32_t reply_list[list_limit];
uint32_t reply_next;
public:
@@ -198,15 +198,15 @@ public:
int list_max() const { return list_limit; }
void to_set(ulong m) { reply_to = m; }
void first_set(ulong m) { reply_first = m; }
void list_set(int n, ulong m) { reply_list[n] = m; }
void next_set(ulong m) { reply_next = m; }
void to_set(uint32_t m) { reply_to = m; }
void first_set(uint32_t m) { reply_first = m; }
void list_set(int n, uint32_t m) { reply_list[n] = m; }
void next_set(uint32_t m) { reply_next = m; }
ulong to() const { return reply_to; }
ulong first() const { return reply_first; }
ulong list(int n) const { return reply_list[n]; }
ulong next() const { return reply_next; }
uint32_t to() const { return reply_to; }
uint32_t first() const { return reply_first; }
uint32_t list(int n) const { return reply_list[n]; }
uint32_t next() const { return reply_next; }
};
@@ -215,7 +215,7 @@ public:
struct gmsg_jam_fields {
long subfieldlen; // Size of subfields
int32_t subfieldlen; // Size of subfields
};
@@ -226,7 +226,7 @@ struct gmsg_pcboard_fields {
char status; // Msg header status byte
byte exthdrflags; // Msg extended header flags
char password[13]; // Password needed to read the message
time_t reply_written; // Timestamp of the original
time32_t reply_written; // Timestamp of the original
};
@@ -235,14 +235,14 @@ struct gmsg_pcboard_fields {
struct gmsg_wildcat_fields {
char from_title[11];
long from_userid;
int32_t from_userid;
char to_title[11];
long to_userid;
int32_t to_userid;
char network[9];
char internal_attach[13];
char external_attach[13];
ulong next_unread;
ulong prev_unread;
uint32_t next_unread;
uint32_t prev_unread;
char reserved[20];
};
@@ -251,8 +251,8 @@ struct gmsg_wildcat_fields {
struct gmsg_adeptxbbs_fields {
ulong iflags; // Internet related flags
ulong oflags; // Other network related flags
uint32_t iflags; // Internet related flags
uint32_t oflags; // Other network related flags
};
@@ -273,7 +273,7 @@ public:
uint board; // Board number (if applicable)
ulong msgno; // Message number
uint32_t msgno; // Message number
gmsg_links link; // Message reply links
ftn_addr oorig; // Original origination address
@@ -288,9 +288,9 @@ public:
INam to; // Who to
ISub re; // Subject
time_t written; // Timestamp
time_t arrived; // Timestamp
time_t received; // Timestamp
time32_t written; // Timestamp
time32_t arrived; // Timestamp
time32_t received; // Timestamp
Attr attr; // Message attributes
uint cost; // Cost of msg if Netmail
@@ -302,8 +302,8 @@ public:
char pid[80]; // PID kludge string
long txtstart; // Text starting position or record
long txtlength; // Text length or number of records
int32_t txtstart; // Text starting position or record
int32_t txtlength; // Text length or number of records
uint txtblocks; // Number of msg text blocks
char* txt; // Message text

View File

@@ -70,7 +70,7 @@ public:
GTag* PMrk; // Personal mail marks
uint lastread; // Number of last message read
ulong lastreadentry; // Lastread message number at entry to area
uint32_t lastreadentry; // Lastread message number at entry to area
int isopen; // NONZERO if open

View File

@@ -93,8 +93,8 @@ struct EzycHdr {
word replyto;
word reply1st;
ulong startposition;
ulong messagelength;
uint32_t startposition;
uint32_t messagelength;
Addr destnet;
Addr orignet;

View File

@@ -364,7 +364,7 @@ void EzycomArea::save_lastread() {
int _fh = test_open(AddPath(wide->userbasepath, "LASTCOMB.BBS"), O_RDWR|O_CREAT|O_BINARY, SH_DENYNO);
if(_fh != -1) {
word _lastread = (word)(Msgn->CvtReln(lastread)+1);
lseekset(_fh, (long)wide->userno * ((long)wide->maxmess / 16) * (long)sizeof(EzycLast) +
lseekset(_fh, wide->userno * (wide->maxmess / 16) * sizeof(EzycLast) +
(((board() - 1) / 16) * sizeof(EzycLast) + sizeof(word)) +
(board()-1) % 16 * sizeof(word)
);

View File

@@ -55,7 +55,7 @@ void EzycomArea::raw_scan(int __keep_index) {
int _fh = ::sopen(AddPath(wide->userbasepath, "LASTCOMB.BBS"), O_RDONLY|O_BINARY, SH_DENYNO, S_STDRD);
if(_fh != -1) {
word _lastread;
lseekset(_fh, (long)wide->userno * ((long)wide->maxmess / 16) * (long)sizeof(EzycLast) +
lseekset(_fh, wide->userno * (wide->maxmess / 16) * sizeof(EzycLast) +
(((board() - 1) / 16) * sizeof(EzycLast) + sizeof(word)) +
(board()-1) % 16 * sizeof(word)
);
@@ -63,13 +63,13 @@ void EzycomArea::raw_scan(int __keep_index) {
if(_lastread)
_lastread--;
register uint _active = Msgn->Count();
register uint _count = 1;
register ulong* _msgnoptr = Msgn->tag;
register uint _lastread_reln = 0;
register ulong _firstmsgno = 0;
register ulong _lastmsgno = 0;
register ulong _lastreadfound = 0;
uint _active = Msgn->Count();
uint _count = 1;
uint32_t* _msgnoptr = Msgn->tag;
uint _lastread_reln = 0;
uint _firstmsgno = 0;
uint _lastmsgno = 0;
uint _lastreadfound = 0;
if(_active) {

View File

@@ -69,8 +69,8 @@ int EzycomArea::load_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
__msg->dest.point = __msg->odest.point = __hdr.destnet.point;
// Convert date and time
SwapWord32((long*)&__hdr.posttimedate);
SwapWord32((long*)&__hdr.recvtimedate);
SwapWord32((uint32_t*)&__hdr.posttimedate);
SwapWord32((uint32_t*)&__hdr.recvtimedate);
__msg->written = FTimeToTime(&__hdr.posttimedate);
__msg->arrived = FTimeToTime(&__hdr.recvtimedate);

View File

@@ -111,8 +111,8 @@ void EzycomArea::save_message(int __mode, gmsg* __msg, EzycHdr& __hdr) {
__hdr.posttimedate = TimeToFTime(__msg->written);
__hdr.recvtimedate = TimeToFTime(__msg->arrived);
SwapWord32((long*)&__hdr.posttimedate);
SwapWord32((long*)&__hdr.recvtimedate);
SwapWord32((uint32_t*)&__hdr.posttimedate);
SwapWord32((uint32_t*)&__hdr.recvtimedate);
strc2p(strxcpy(__hdr.whoto, __msg->to, sizeof(__hdr.whoto)));
strc2p(strxcpy(__hdr.whofrom, __msg->by, sizeof(__hdr.whofrom)));

View File

@@ -81,10 +81,10 @@ Line* EzycomArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "MsgAttr : %02Xh (%sb)", _hdr.msgattr, ltob(buf, _hdr.msgattr, 8));
AddLineF(line, "NetAttr : %02Xh (%sb)", _hdr.netattr, ltob(buf, _hdr.netattr, 8));
AddLineF(line, "ExtAttr : %02Xh (%sb)", _hdr.extattr, ltob(buf, _hdr.extattr, 8));
AddLineF(line, "PostDate : %s (%08lXh)", FTimeToStr(buf, _hdr.posttimedate), *(dword*)&_hdr.posttimedate);
AddLineF(line, "RecvDate : %s (%08lXh)", FTimeToStr(buf, _hdr.recvtimedate), *(dword*)&_hdr.recvtimedate);
AddLineF(line, "StartPos : %lu", _hdr.startposition);
AddLineF(line, "MsgLength: %lu", _hdr.messagelength);
AddLineF(line, "PostDate : %s (%08Xh)", FTimeToStr(buf, _hdr.posttimedate), *(dword*)&_hdr.posttimedate);
AddLineF(line, "RecvDate : %s (%08Xh)", FTimeToStr(buf, _hdr.recvtimedate), *(dword*)&_hdr.recvtimedate);
AddLineF(line, "StartPos : %u", _hdr.startposition);
AddLineF(line, "MsgLength: %u", _hdr.messagelength);
AddLineF(line, "UserRecno: %u (%s)", wide->userno, WideUsername[0]);
line = AddLine(line, "");
AddLineF(line, lng_head);

View File

@@ -114,7 +114,7 @@ struct FidoHdr {
// ------------------------------------------------------------------
struct FidoData {
ulong highwatermark;
uint32_t highwatermark;
};
@@ -144,7 +144,7 @@ protected:
void data_open();
void data_close();
char* build_msgname(char* __buf, ulong __msgno);
char* build_msgname(char* __buf, uint32_t __msgno);
int test_open(const char* __file, int __openmode, int __sharemode, int __fail=NO);
void raw_scan(bool __scanpm);
int load_message(int __mode, gmsg* __msg, FidoHdr& __hdr);

View File

@@ -59,9 +59,9 @@ void FidoArea::data_close() {
// ------------------------------------------------------------------
char* FidoArea::build_msgname(char* __buf, ulong __msgno) {
char* FidoArea::build_msgname(char* __buf, uint32_t __msgno) {
sprintf(__buf, "%s%lu.msg", real_path(), __msgno);
sprintf(__buf, "%s%u.msg", real_path(), __msgno);
return __buf;
}

View File

@@ -55,9 +55,9 @@ void FidoArea::raw_scan(bool __scanpm) {
}
}
register uint _active = 0;
register ulong* _msgnoptr = NULL;
register ulong* _msgndx = Msgn->tag;
uint _active = 0;
uint32_t* _msgnoptr = NULL;
uint32_t* _msgndx = Msgn->tag;
gposixdir d(real_path());
if(d.ok) {
@@ -67,7 +67,7 @@ void FidoArea::raw_scan(bool __scanpm) {
while((de = d.nextentry("*.msg", true)) != NULL) {
if(WideDebug)
WideLog->printf("- %s", de->name.c_str());
register ulong _msgno = (ulong)atol(de->name.c_str());
uint _msgno = (uint)atol(de->name.c_str());
if(_msgno) {
if((_active % FIDO_SCANBUFSIZE) == 0) {
_msgndx = Msgn->Resize(_active+FIDO_SCANBUFSIZE);
@@ -98,11 +98,11 @@ void FidoArea::raw_scan(bool __scanpm) {
_msgnoptr = _msgndx;
register uint _count = 1;
register uint _lastread_reln = 0;
register ulong _firstmsgno = 0;
register ulong _lastmsgno = 0;
register ulong _lastreadfound = 0;
uint _count = 1;
uint _lastread_reln = 0;
uint _firstmsgno = 0;
uint _lastmsgno = 0;
uint _lastreadfound = 0;
FidoHdr _hdr;
if(_active) {
@@ -160,7 +160,7 @@ void FidoArea::raw_scan(bool __scanpm) {
for(uint i = lastread+1; i<=Msgn->Count(); i++) {
// Build message filename
Path _msgfile;
ulong msgno = Msgn->CvtReln(i);
uint msgno = Msgn->CvtReln(i);
build_msgname(_msgfile, msgno);
// Open the message file
@@ -187,7 +187,7 @@ void FidoArea::raw_scan(bool __scanpm) {
}
if(WideDebug) {
WideLog->printf("- %s: t:%u, l:%u, fm:%lu, hm:%lu, lr:%u, u:%u, pm: %i",
WideLog->printf("- %s: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u, pm: %i",
echoid(),
Msgn->Count(),
lastread,

View File

@@ -62,21 +62,21 @@ int FidoArea::renumber() {
// In echo or local, start with 2.MSG so we don't conflict
// with highwater marks, unless there is already a 1.MSG
ulong _msgno1st = 1;
uint _msgno1st = 1;
if(not isnet() and (Msgn->at(0) != 1))
_msgno1st++;
// Renumber *.MSG files
register uint _count = 0;
register ulong _msgno = _msgno1st;
register uint _msgno = _msgno1st;
while(_count < Msgn->Count()) {
// Only renumber a msg if different
if(_msgno != Msgn->at(_count)) {
Path _oldname, _newname;
sprintf(_oldname, "%s%lu.msg", real_path(), Msgn->at(_count));
sprintf(_newname, "%s%lu.msg", real_path(), _msgno);
sprintf(_oldname, "%s%u.msg", real_path(), Msgn->at(_count));
sprintf(_newname, "%s%u.msg", real_path(), _msgno);
// Get the file attribute of the message
struct stat st;
@@ -88,7 +88,7 @@ int FidoArea::renumber() {
// Show progress
char buf[100];
sprintf(buf,
"%s: %lu.msg -> %lu.msg%s",
"%s: %u.msg -> %u.msg%s",
"Renumbering",
Msgn->at(_count),
_msgno,
@@ -152,7 +152,7 @@ Line* FidoArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLine (NULL, "Hexdump of Fido/Opus-style message header and text");
AddLineF(line, "------------------------------------------------------------------------------");
line = AddLine(line, "");
AddLineF(line, "File : %s%lu.msg", real_path(), msg->msgno);
AddLineF(line, "File : %s%u.msg", real_path(), msg->msgno);
AddLineF(line, "From : %-35.35s", _hdr.by);
AddLineF(line, "To : %-35.35s", _hdr.to);
AddLineF(line, "Subject : %-72.72s", _hdr.re);
@@ -167,10 +167,10 @@ Line* FidoArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "DestAddr : %u:%u/%u.%u", _hdr.ftsc.destzone, _hdr.destnet, _hdr.destnode, _hdr.ftsc.destpoint);
AddLineF(line, "Reply : %u See : %u", _hdr.replyto, _hdr.reply1st);
AddLineF(line, "TimesRead: %u Cost: %u", _hdr.timesread, _hdr.cost);
AddLineF(line, "Attr : %u (%04X)", *(word*)&_hdr.attr, *(word*)&_hdr.attr);
AddLineF(line, "Attr : %u (%04X)", _hdr.attr, _hdr.attr);
if(isopus()) {
AddLineF(line, "Written : %s (%08lXh)", FTimeToStr(buf, _hdr.opus.written), *(dword*)&_hdr.opus.written);
AddLineF(line, "Arrived : %s (%08lXh)", FTimeToStr(buf, _hdr.opus.arrived), *(dword*)&_hdr.opus.arrived);
AddLineF(line, "Written : %s (%08Xh)", FTimeToStr(buf, _hdr.opus.written), *(uint*)&_hdr.opus.written);
AddLineF(line, "Arrived : %s (%08Xh)", FTimeToStr(buf, _hdr.opus.arrived), *(uint*)&_hdr.opus.arrived);
}
AddLineF(line, "UserRecno: %u (%s)", wide->userno, WideUsername[0]);
line = AddLine(line, "");

View File

@@ -90,7 +90,7 @@ void GoldExit() {
// ------------------------------------------------------------------
void HudsInit(const char* path, const char* syspath, int userno, long sizewarn, int ra2usersbbs) {
void HudsInit(const char* path, const char* syspath, int userno, int32_t sizewarn, int ra2usersbbs) {
// Initialize msgbase-wide data
hudsonwide = (HudsWide*)throw_calloc(1, sizeof(HudsWide));
@@ -105,7 +105,7 @@ void HudsInit(const char* path, const char* syspath, int userno, long sizewarn,
// ------------------------------------------------------------------
void GoldInit(const char* path, const char* syspath, int userno, long sizewarn, int ra2usersbbs) {
void GoldInit(const char* path, const char* syspath, int userno, int32_t sizewarn, int ra2usersbbs) {
// Initialize msgbase-wide data
goldbasewide = (GoldWide*)throw_calloc(1, sizeof(GoldWide));

View File

@@ -173,11 +173,11 @@ typedef word GoldLast[GOLD_MAXBOARD] __attribute__((packed));
struct HudsScan {
uint count;
uint active;
ulong lastread;
uint32_t lastread;
uint lastreadreln;
ulong lastreadfound;
ulong firstmsgno;
ulong lastmsgno;
uint32_t lastreadfound;
uint32_t firstmsgno;
uint32_t lastmsgno;
uint pmcount;
};
@@ -211,7 +211,7 @@ struct _HudsWide {
int isopen;
int islocked;
int timesposted;
long msgidxsize;
int32_t msgidxsize;
HudsIdx* msgidxptr;
HudsInfo msginfo;
last_t lastrec;
@@ -225,7 +225,7 @@ struct _HudsWide {
int iswidescanned;
const char* path;
const char* syspath;
long sizewarn;
int32_t sizewarn;
int ra2usersbbs;
void init();
@@ -333,9 +333,9 @@ public:
// <class msgn_t, class rec_t, class attr_t, class board_t, class last_t, bool __HUDSON>
typedef _HudsWide<word, word, byte, byte, HudsLast, true> HudsWide;
typedef _HudsWide<dword, long, word, word, GoldLast, false> GoldWide;
typedef _HudsWide<dword, int32_t, word, word, GoldLast, false> GoldWide;
typedef _HudsArea<word, word, byte, byte, HudsLast, true> HudsArea;
typedef _HudsArea<dword, long, word, word, GoldLast, false> GoldArea;
typedef _HudsArea<dword, int32_t, word, word, GoldLast, false> GoldArea;
// ------------------------------------------------------------------

View File

@@ -105,17 +105,17 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
HudsSizewarn();
// Check for mismatch between the header and the index files
long _hdrsize = filelength(fhhdr)/(long)sizeof(HudsHdr);
long _idxsize = filelength(fhidx)/(long)sizeof(HudsIdx);
long _toisize = filelength(fhtoi)/(long)sizeof(HudsToIdx);
uint _hdrsize = filelength(fhhdr)/sizeof(HudsHdr);
uint _idxsize = filelength(fhidx)/sizeof(HudsIdx);
uint _toisize = filelength(fhtoi)/sizeof(HudsToIdx);
if((_hdrsize != _idxsize) or (_hdrsize != _toisize)) {
raw_close();
HGWarnRebuild();
WideLog->ErrIndex();
WideLog->printf("! The %s msgbase files do not have the same number of records.", __HUDSON ? HUDS_NAME : GOLD_NAME);
WideLog->printf(": %smsghdr%s (%lu records).", path, __HUDSON ? HUDS_EXT : GOLD_EXT, _hdrsize);
WideLog->printf(": %smsgidx%s (%lu records).", path, __HUDSON ? HUDS_EXT : GOLD_EXT, _idxsize);
WideLog->printf(": %smsgtoidx%s (%lu records).", path, __HUDSON ? HUDS_EXT : GOLD_EXT, _toisize);
WideLog->printf(": %smsghdr%s (%u records).", path, __HUDSON ? HUDS_EXT : GOLD_EXT, _hdrsize);
WideLog->printf(": %smsgidx%s (%u records).", path, __HUDSON ? HUDS_EXT : GOLD_EXT, _idxsize);
WideLog->printf(": %smsgtoidx%s (%u records).", path, __HUDSON ? HUDS_EXT : GOLD_EXT, _toisize);
WideLog->printf("+ Advice: You need to run a msgbase index rebuild utility.");
IndexErrorExit();
}
@@ -124,7 +124,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
if(__HUDSON and (ra2usersbbs == 0)) {
// Get size of USERS.BBS
long len = filelength(fhusr);
int len = filelength(fhusr);
// Does size match Hudson format?
int hudsmatch = (len % sizeof(HudsUsers)) == 0;
@@ -161,9 +161,9 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::init() {
if(not hudsmatch and not ra2match) {
WideLog->ErrIndex();
WideLog->printf("! The users.bbs file has an incorrect size.");
WideLog->printf(": %susers.bbs, %lu bytes.", path, len);
WideLog->printf(": Should be %lu bytes if it's in RA2 format.", (len/(long)sizeof(RA2Users))*(long)sizeof(RA2Users));
WideLog->printf(": Should be %lu bytes if it's in Hudson format.", (len/(long)sizeof(HudsUsers))*(long)sizeof(HudsUsers));
WideLog->printf(": %susers.bbs, %u bytes.", path, len);
WideLog->printf(": Should be %u bytes if it's in RA2 format.", (uint)((len/sizeof(RA2Users))*sizeof(RA2Users)));
WideLog->printf(": Should be %u bytes if it's in Hudson format.", (uint)((len/sizeof(HudsUsers))*sizeof(HudsUsers)));
if(ra2usersbbs)
WideLog->printf(": It appears to be in %s format.", (ra2usersbbs == 2) ? "RA2" : "Hudson");
WideLog->printf("+ Advice: Run a userbase packing utility.");
@@ -237,7 +237,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_lastread(
// Update lastread record
msgn_t _lastread = lastrec[board-1] = msgno;
lseekset(fhlrd, (long)userno*(long)sizeof(HudsLast));
lseekset(fhlrd, userno*sizeof(HudsLast));
write(fhlrd, lastrec, sizeof(HudsLast));
// Update user record

View File

@@ -155,7 +155,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::refresh() {
read(fhinf, &msginfo, sizeof(HudsInfo));
// Load LASTREAD.BBS/DAT
lseek(fhlrd, (long)userno*(long)sizeof(HudsLast), SEEK_SET);
lseek(fhlrd, userno*sizeof(HudsLast), SEEK_SET);
read(fhlrd, lastrec, sizeof(HudsLast));
GFTRK(NULL);
@@ -366,7 +366,7 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan() {
}
if(WideDebug) {
WideLog->printf("- b:%u: t:%u, l:%u, fm:%lu, hm:%lu, lr:%lu, u:%u",
WideLog->printf("- b:%u: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u",
_board,
_scan->count,
_scan->lastreadreln,
@@ -439,12 +439,12 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
Msgn->Resize(_active);
// Index pointers
register ulong* _msgno_ptr = Msgn->tag;
uint32_t* _msgno_ptr = Msgn->tag;
// Fill index
register ulong _firstmsgno = 0;
register ulong _lastmsgno = 0;
register ulong _lastreadfound = 0;
uint _firstmsgno = 0;
uint _lastmsgno = 0;
uint _lastreadfound = 0;
while(_msgidx_count < _msgidx_total) {
// Is it our board and is the msg not deleted?
@@ -502,13 +502,13 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::raw_scan(int _
lastreadentry = _lastreadfound;
if(WideDebug) {
WideLog->printf("- b:%u: t:%u, l:%u, fm:%lu, hm:%lu, lr:%lu, u:%u",
WideLog->printf("- b:%u: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u",
board(),
Msgn->Count(),
lastread,
_firstmsgno,
_lastmsgno,
(ulong)_lastread,
_lastread,
wide->userno
);
}
@@ -701,7 +701,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::scan_area_pm()
lastreadentry = _scan->lastreadfound;
if(WideDebug) {
WideLog->printf("- b:%u: t:%u, l:%u, fm:%lu, hm:%lu, lr:%lu, u:%u, pm:%i",
WideLog->printf("- b:%u: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u, pm:%i",
_board,
_scan->count,
_scan->lastreadreln,

View File

@@ -37,7 +37,7 @@ msgn_t _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::get_hdr_idx(
msgn_t _total = (msgn_t)(wide->msgidxsize/sizeof(HudsIdx));
HudsIdx* _msgidx_ptr = wide->msgidxptr;
register ulong _msgno = __msg->msgno;
uint32_t _msgno = __msg->msgno;
if(_msgidx_ptr) {
while(_count <= _total) {
if(_msgno == _msgidx_ptr->msgno) {
@@ -50,27 +50,27 @@ msgn_t _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::get_hdr_idx(
}
// Report error
ulong _lmsgno = lastread ? Msgn->at(lastread-1) : Msgn->at(0);
ulong _lread = wide->lastrec[board()-1];
ulong _active = wide->msginfo.active[board()-1];
uint32_t _lmsgno = lastread ? Msgn->at(lastread-1) : Msgn->at(0);
uint32_t _lread = wide->lastrec[board()-1];
uint32_t _active = wide->msginfo.active[board()-1];
WideLog->errindex(__file__, __line__);
WideLog->printf("! Failed to locate a msgno in an internal %s index.", __HUDSON ? HUDS_NAME : GOLD_NAME);
WideLog->printf(": Msgno %lu (%lXh) in board %u (%s,%u,%u).", _msgno, _msgno, board(), echoid(), Msgn->Count(), lastread);
WideLog->printf(": First Msgno : %lu (%lXh).", Msgn->at(0), Msgn->at(0));
WideLog->printf(": Msgno at lastread : %lu (%lXh).", _lmsgno, _lmsgno);
WideLog->printf(": Real lastread msg : %lu (%lXh).", _lread, _lread);
WideLog->printf(": Real active msgs : %lu (%lXh).", _active, _active);
WideLog->printf(": Msgno %u (%Xh) in board %u (%s,%u,%u).", _msgno, _msgno, board(), echoid(), Msgn->Count(), lastread);
WideLog->printf(": First Msgno : %u (%Xh).", Msgn->at(0), Msgn->at(0));
WideLog->printf(": Msgno at lastread : %u (%Xh).", _lmsgno, _lmsgno);
WideLog->printf(": Real lastread msg : %u (%Xh).", _lread, _lread);
WideLog->printf(": Real active msgs : %u (%Xh).", _active, _active);
if(Msgn->Count() > 2) {
_lmsgno = Msgn->at(Msgn->Count()-3);
WideLog->printf(": Highest-2 msgno : %lu (%lXh).", _lmsgno, _lmsgno);
WideLog->printf(": Highest-2 msgno : %u (%Xh).", _lmsgno, _lmsgno);
}
if(Msgn->Count() > 1) {
_lmsgno = Msgn->at(Msgn->Count()-2);
WideLog->printf(": Highest-1 msgno : %lu (%lXh).", _lmsgno, _lmsgno);
WideLog->printf(": Highest-1 msgno : %u (%Xh).", _lmsgno, _lmsgno);
}
if(Msgn->Count()) {
_lmsgno = Msgn->at(Msgn->Count()-1);
WideLog->printf(": Highest msgno : %lu (%lXh).", _lmsgno, _lmsgno);
WideLog->printf(": Highest msgno : %u (%Xh).", _lmsgno, _lmsgno);
}
if(_msgno == 0xEEEEEEEEL) {
WideLog->printf("+ Info: This indicates a serious bug.");
@@ -97,7 +97,7 @@ int _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::load_message(in
// Read header
msgn_t _hdridx = get_hdr_idx(__msg, __FILE__, __LINE__);
lseek(wide->fhhdr, (long)_hdridx*(long)sizeof(HudsHdr), SEEK_SET);
lseek(wide->fhhdr, (int32_t)_hdridx*(int32_t)sizeof(HudsHdr), SEEK_SET);
read(wide->fhhdr, &__hdr, sizeof(HudsHdr));
__msg->msgno = __hdr.msgno;
@@ -174,7 +174,7 @@ int _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::load_message(in
if(_numrecs) {
// Seek to, and read the raw text
lseek(wide->fhtxt, (long)__hdr.startrec*256L, SEEK_SET);
lseek(wide->fhtxt, (int32_t)__hdr.startrec*256L, SEEK_SET);
read(wide->fhtxt, __msg->txt, _numrecs*256);
// Set up loop variables

View File

@@ -116,7 +116,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
msgn_t _hdridx;
if(__mode & GMSG_NEW) {
__msg->msgno = wide->msginfo.high + 1;
_hdridx = (msgn_t)(filelength(wide->fhhdr)/(long)sizeof(HudsHdr));
_hdridx = (msgn_t)(filelength(wide->fhhdr)/sizeof(HudsHdr));
}
else {
_hdridx = get_hdr_idx(__msg, __FILE__, __LINE__);
@@ -181,7 +181,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
// If the msg is new or the text is too large to fit
uint _txtlen = strlen(__msg->txt)+1;
if((__mode & GMSG_NEW) or (_txtlen > ((long)__msg->txtlength*255L)))
if((__mode & GMSG_NEW) or (_txtlen > __msg->txtlength*255L))
__hdr.startrec = (msgn_t)(filelength(wide->fhtxt)/256L);
// Calculate the number of text records to write
@@ -190,7 +190,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
__hdr.numrecs = (word)(_fullrecs + (_extrarec ? 1 : 0));
// Seek to the text write position
lseek(wide->fhtxt, (long)__hdr.startrec*256L, SEEK_SET);
lseek(wide->fhtxt, __hdr.startrec*256L, SEEK_SET);
// Write the message text
register uint _count = 0;
@@ -213,22 +213,22 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
}
// Write to MSGHDR.BBS/DAT
lseek(wide->fhhdr, (long)_hdridx*(long)sizeof(HudsHdr), SEEK_SET);
lseek(wide->fhhdr, _hdridx*sizeof(HudsHdr), SEEK_SET);
write(wide->fhhdr, &__hdr, sizeof(HudsHdr));
// Write to MSGIDX.BBS/DAT
if(__mode & GMSG_NEW) {
wide->msgidxsize += sizeof(HudsIdx);
wide->msgidxptr = (HudsIdx*)throw_realloc(wide->msgidxptr, (uint)(wide->msgidxsize+sizeof(HudsIdx)));
wide->msgidxptr = (HudsIdx*)throw_realloc(wide->msgidxptr, wide->msgidxsize+sizeof(HudsIdx));
}
HudsIdx* _idxp = wide->msgidxptr + (uint)_hdridx;
_idxp->board = __hdr.board;
_idxp->msgno = (msgn_t)((__mode & GMSG_DELETE) ? (__HUDSON ? HUDS_DELETEDMSGNO : GOLD_DELETEDMSGNO) : __hdr.msgno);
lseek(wide->fhidx, (long)_hdridx*(long)sizeof(HudsIdx), SEEK_SET);
lseek(wide->fhidx, _hdridx*sizeof(HudsIdx), SEEK_SET);
write(wide->fhidx, _idxp, sizeof(HudsIdx));
// Write to MSGTOIDX.BBS/DAT
lseek(wide->fhtoi, (long)_hdridx*(long)sizeof(HudsToIdx), SEEK_SET);
lseek(wide->fhtoi, _hdridx*sizeof(HudsToIdx), SEEK_SET);
if(__mode & GMSG_DELETE)
write(wide->fhtoi, "\xB* Deleted *\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", sizeof(HudsToIdx));
else if(__hdr.msgattr & HUDS_RECEIVED)
@@ -357,14 +357,14 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::update_timesre
lock();
msgn_t hdridx = get_hdr_idx(msg, __FILE__, __LINE__);
::lseekset(wide->fhhdr, (long)hdridx*(long)sizeof(HudsHdr));
::lseekset(wide->fhhdr, hdridx*sizeof(HudsHdr));
HudsHdr hdr;
::read(wide->fhhdr, &hdr, sizeof(HudsHdr));
hdr.timesread = (word)msg->timesread;
::lseekset(wide->fhhdr, (long)hdridx*(long)sizeof(HudsHdr));
::lseekset(wide->fhhdr, hdridx*sizeof(HudsHdr));
::write(wide->fhhdr, &hdr, sizeof(HudsHdr));
unlock();

View File

@@ -76,24 +76,24 @@ Line* _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::make_dump_msg
AddLineF(line, "DateTime : %8.8s %5.5s", _hdr.date, _hdr.time);
AddLineF(line, "OrigAddr : %u:%u/%u", _hdr.origzone, _hdr.orignet, _hdr.orignode);
AddLineF(line, "DestAddr : %u:%u/%u", _hdr.destzone, _hdr.destnet, _hdr.destnode);
AddLineF(line, "Reply : %lu", (ulong)_hdr.replyto);
AddLineF(line, "See : %lu", (ulong)_hdr.reply1st);
AddLineF(line, "Reply : %u", (uint32_t)_hdr.replyto);
AddLineF(line, "See : %u", (uint32_t)_hdr.reply1st);
AddLineF(line, "TimesRead : %u", _hdr.timesread);
AddLineF(line, "Cost : %u", _hdr.cost);
AddLineF(line, "MsgAttr : %02Xh (%sb)", _hdr.msgattr, ltob(buf, _hdr.msgattr, 8));
AddLineF(line, "NetAttr : %02Xh (%sb)", _hdr.netattr, ltob(buf, _hdr.netattr, 8));
AddLineF(line, "Msgno : %lu", (long)_hdr.msgno);
AddLineF(line, "Msgno : %u", (int32_t)_hdr.msgno);
AddLineF(line, "Board : %u", _hdr.board);
AddLineF(line, "StartRec : %lu", (long)_hdr.startrec);
AddLineF(line, "NumRecs : %lu", (long)_hdr.numrecs);
AddLineF(line, "StartRec : %u", (int32_t)_hdr.startrec);
AddLineF(line, "NumRecs : %u", (int32_t)_hdr.numrecs);
AddLineF(line, "UserRecno : %u (%s)", wide->userno, WideUsername[0]);
line = AddLine(line, "");
AddLineF(line, "Dump of msginfo%s:", __HUDSON ? HUDS_EXT : GOLD_EXT);
line = AddLine(line, "");
AddLineF(line, "Total Active : %lu (%lXh)", (ulong)wide->msginfo.total, (ulong)wide->msginfo.total);
AddLineF(line, "Low/High Msgno: %lu (%lXh) %lu (%lXh)",
(ulong)wide->msginfo.low, (ulong)wide->msginfo.low,
(ulong)wide->msginfo.high, (ulong)wide->msginfo.high
AddLineF(line, "Total Active : %u (%Xh)", (uint32_t)wide->msginfo.total, (uint32_t)wide->msginfo.total);
AddLineF(line, "Low/High Msgno: %u (%Xh) %u (%Xh)",
(uint32_t)wide->msginfo.low, (uint32_t)wide->msginfo.low,
(uint32_t)wide->msginfo.high, (uint32_t)wide->msginfo.high
);
for(int brd=0; brd<(__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD); brd+=10) {
AddLineF(line, "Board %03u-%03u : %5u %5u %5u %5u %5u %5u %5u %5u %5u %5u",
@@ -107,10 +107,10 @@ Line* _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::make_dump_msg
AddLineF(line, "Dump of lastread%s:", __HUDSON ? HUDS_EXT : GOLD_EXT);
line = AddLine(line, "");
for(int lrd=0; lrd<(__HUDSON ? HUDS_MAXBOARD : GOLD_MAXBOARD); lrd+=5) {
AddLineF(line, "Board %03u-%03u : %10lu %10lu %10lu %10lu %10lu",
lrd+1, lrd+5, (ulong)wide->lastrec[lrd+0],
(ulong)wide->lastrec[lrd+1], (ulong)wide->lastrec[lrd+2],
(ulong)wide->lastrec[lrd+3], (ulong)wide->lastrec[lrd+4]
AddLineF(line, "Board %03u-%03u : %10u %10u %10u %10u %10u",
lrd+1, lrd+5, (uint32_t)wide->lastrec[lrd+0],
(uint32_t)wide->lastrec[lrd+1], (uint32_t)wide->lastrec[lrd+2],
(uint32_t)wide->lastrec[lrd+3], (uint32_t)wide->lastrec[lrd+4]
);
}
line = AddLine(line, "");

View File

@@ -127,18 +127,18 @@
#define JAMSUB_REPLYID_LEN 100
#define JAMSUB_SUBJECT_LEN 100
#define JAMSUB_PID_LEN 40
#define JAMSUB_TRACE_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFILE_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFILEWALIAS_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFREQ_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFILEWCARD_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDINDIRECFILE_LEN ((ulong)(-1))
#define JAMSUB_EMBINDAT_LEN ((ulong)(-1))
#define JAMSUB_TRACE_LEN ((uint32_t)(-1))
#define JAMSUB_ENCLOSEDFILE_LEN ((uint32_t)(-1))
#define JAMSUB_ENCLOSEDFILEWALIAS_LEN ((uint32_t)(-1))
#define JAMSUB_ENCLOSEDFREQ_LEN ((uint32_t)(-1))
#define JAMSUB_ENCLOSEDFILEWCARD_LEN ((uint32_t)(-1))
#define JAMSUB_ENCLOSEDINDIRECFILE_LEN ((uint32_t)(-1))
#define JAMSUB_EMBINDAT_LEN ((uint32_t)(-1))
#define JAMSUB_FTSKLUDGE_LEN 255
#define JAMSUB_SEENBY2D_LEN ((ulong)(-1))
#define JAMSUB_PATH2D_LEN ((ulong)(-1))
#define JAMSUB_FLAGS_LEN ((ulong)(-1))
#define JAMSUB_TZUTCINFO_LEN ((ulong)(-1))
#define JAMSUB_SEENBY2D_LEN ((uint32_t)(-1))
#define JAMSUB_PATH2D_LEN ((uint32_t)(-1))
#define JAMSUB_FLAGS_LEN ((uint32_t)(-1))
#define JAMSUB_TZUTCINFO_LEN ((uint32_t)(-1))
// ------------------------------------------------------------------
@@ -147,12 +147,12 @@
struct JamHdrInfo {
char signature[4]; // <J><A><M> followed by <NUL>
time_t datecreated; // Creation date
ulong modcounter; // Update counter
ulong activemsgs; // Number of active (not deleted) msgs
ulong passwordcrc; // CRC-32 of password to access
ulong basemsgnum; // Lowest message number in index file
ulong highwatermark; // Number of the last msg scanned
time32_t datecreated; // Creation date
uint32_t modcounter; // Update counter
uint32_t activemsgs; // Number of active (not deleted) msgs
uint32_t passwordcrc; // CRC-32 of password to access
uint32_t basemsgnum; // Lowest message number in index file
uint32_t highwatermark; // Number of the last msg scanned
byte reserved[996]; // Reserved space
};
@@ -165,23 +165,23 @@ struct JamHdr {
char signature[4]; // <J><A><M> followed by <NUL>
word revision; // Revision level of header
word reservedword; // Reserved for future use
ulong subfieldlen; // Length of subfields
ulong timesread; // Number of times message read
ulong msgidcrc; // CRC-32 of MSGID line
ulong replycrc; // CRC-32 of REPLY line
ulong replyto; // This msg is a reply to..
ulong reply1st; // First reply to this msg
ulong replynext; // Next msg in reply chain
time_t datewritten; // When msg was written
time_t datereceived; // When msg was read by recipient
time_t dateprocessed; // When msg was processed by tosser/scanner
ulong messagenumber; // Message number (1-based)
ulong attribute; // Msg attribute, see "Msg Attributes"
ulong attribute2; // Reserved for future use
ulong offset; // Offset of text in ????????.JDT file
ulong txtlen; // Length of message text
ulong passwordcrc; // CRC-32 of password to access message
ulong cost; // Cost of message
uint32_t subfieldlen; // Length of subfields
uint32_t timesread; // Number of times message read
uint32_t msgidcrc; // CRC-32 of MSGID line
uint32_t replycrc; // CRC-32 of REPLY line
uint32_t replyto; // This msg is a reply to..
uint32_t reply1st; // First reply to this msg
uint32_t replynext; // Next msg in reply chain
time32_t datewritten; // When msg was written
time32_t datereceived; // When msg was read by recipient
time32_t dateprocessed; // When msg was processed by tosser/scanner
uint32_t messagenumber; // Message number (1-based)
uint32_t attribute; // Msg attribute, see "Msg Attributes"
uint32_t attribute2; // Reserved for future use
uint32_t offset; // Offset of text in ????????.JDT file
uint32_t txtlen; // Length of message text
uint32_t passwordcrc; // CRC-32 of password to access message
uint32_t cost; // Cost of message
};
@@ -192,7 +192,7 @@ struct JamSubFieldHdr {
word loid; // Field ID, 0-65535
word hiid; // Reserved for future use
ulong datlen; // Length of buffer that follows
uint32_t datlen; // Length of buffer that follows
};
@@ -203,7 +203,7 @@ struct JamSubField {
word loid; // Field ID, 0-65535
word hiid; // Reserved for future use
ulong datlen; // Length of buffer that follows
uint32_t datlen; // Length of buffer that follows
char buffer[101]; // DATLEN bytes of data
};
@@ -214,7 +214,7 @@ struct JamSubField {
struct JamIndex {
dword usercrc; // CRC-32 of destination username
ulong hdroffset; // Offset of header in .JHR file
uint32_t hdroffset; // Offset of header in .JHR file
};
@@ -247,8 +247,8 @@ struct JamData {
int fhjhw; // highwater if available
int islocked; // Area is locked?
int timesposted;
long lastpos; // Lastread position
long highwater;
int32_t lastpos; // Lastread position
int32_t highwater;
JamLast lastrec; // .JLR Lastread record
JamHdrInfo hdrinfo; // .JHR Header info record
};
@@ -293,7 +293,7 @@ protected:
int load_message(int __mode, gmsg* __msg, JamHdr& __hdr);
void add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data, ulong maxlen);
void add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data, uint32_t maxlen);
void save_message(int __mode, gmsg* __msg, JamHdr& __hdr);

View File

@@ -142,7 +142,7 @@ void JamArea::open_area() {
if(not jamwide->smapihw and (data->fhjhw != -1)) {
lseek(data->fhjhw, 0, SEEK_SET);
read(data->fhjhw, &data->highwater, sizeof(long));
read(data->fhjhw, &data->highwater, sizeof(int32_t));
}
else
data->highwater = -1;
@@ -221,7 +221,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
}
// Get some sizes
long _jdxlen = filelength(data->fhjdx);
int32_t _jdxlen = filelength(data->fhjdx);
uint _jdxsize = (uint)_jdxlen;
uint _jdxtotal = _jdxsize / sizeof(JamIndex);
@@ -237,16 +237,16 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
read(data->fhjdx, _jdxbuf, _jdxsize);
// Variables for the loop
register uint _active = 0;
register ulong _firstmsgno = 0;
register ulong _lastmsgno = 0;
register ulong _lastreadfound = 0;
register ulong _msgno = data->hdrinfo.basemsgnum;
register ulong _total = data->hdrinfo.basemsgnum + _jdxtotal;
register ulong _lastread = data->lastrec.lastread;
register uint _lastread_reln = 0;
register ulong* _msgndxptr = Msgn->tag;
register JamIndex* _jdxptr = _jdxbuf;
uint _active = 0;
uint _firstmsgno = 0;
uint _lastmsgno = 0;
uint _lastreadfound = 0;
uint _msgno = data->hdrinfo.basemsgnum;
uint _total = data->hdrinfo.basemsgnum + _jdxtotal;
uint _lastread = data->lastrec.lastread;
uint _lastread_reln = 0;
uint32_t* _msgndxptr = Msgn->tag;
JamIndex* _jdxptr = _jdxbuf;
// Fill message index
while(_msgno < _total) {
@@ -291,9 +291,9 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
ucrc[uc] = strCrc32(uname, NO, CRC32_MASK_CCITT);
}
PMrk->ResetAll();
register uint n = lastread + 1;
register uint cnt = Msgn->Count();
register int gotpm = false;
uint n = lastread + 1;
uint cnt = Msgn->Count();
int gotpm = false;
while(n <= cnt) {
JamIndex* idx = _jdxbuf + (uint)(Msgn->at(n-1) - data->hdrinfo.basemsgnum);
for(int u=0; u<umax; u++) {
@@ -319,7 +319,7 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
}
if(WideDebug) {
WideLog->printf("- %s: t:%u, l:%u, fm:%lu, hm:%lu, lr:%lu, u:%lu, pm:%i",
WideLog->printf("- %s: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u, pm:%i",
echoid(),
Msgn->Count(),
lastread,

View File

@@ -57,7 +57,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
read(data->fhjhr, &__hdr, sizeof(JamHdr));
if(strncmp(__hdr.signature, "JAM", 4) != 0) {
WideLog->printf("! Invalid signature found in %s (msgno %ld).", path(), __msg->msgno);
WideLog->printf("! Invalid signature found in %s (msgno %d).", path(), __msg->msgno);
WideLog->printf(": Info: Your msgbase is corrupted.");
WideLog->printf("+ Advice: Run a msgbase index rebuild/recover utility.");
@@ -315,7 +315,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
// Get reply numbers in chain
if(wide->lookreplies and __msg->link.first()) {
int r = 0;
ulong m = __msg->link.first();
uint32_t m = __msg->link.first();
while(m and (r < __msg->link.list_max())) {
JamHdr _rhdr;
memset(&_rhdr, 0, sizeof(JamHdr));
@@ -336,7 +336,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
uint _kludgelen1 = strlen(_kludges);
uint _kludgelen2 = strlen(_kludges2);
uint _kludgelen = _kludgelen1 + _kludgelen2;
ulong _msgsize = __hdr.txtlen;
uint32_t _msgsize = __hdr.txtlen;
// Allocate memory for the message text
__msg->txt = (char*)throw_realloc(_kludges, (uint)(_msgsize+_kludgelen+256));

View File

@@ -76,7 +76,7 @@ void JamArea::lock() {
}
if(data->fhjhw != -1) {
lseek(data->fhjhw, 0, SEEK_SET);
read(data->fhjhw, &data->highwater, sizeof(long));
read(data->fhjhw, &data->highwater, sizeof(int32_t));
}
else
data->highwater = -1;
@@ -105,9 +105,9 @@ void JamArea::unlock() {
// ------------------------------------------------------------------
void JamArea::add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data, ulong __maxlen) {
void JamArea::add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data, uint32_t __maxlen) {
ulong _datlen = strlen(__data);
uint32_t _datlen = strlen(__data);
__subfield = (byte*)throw_realloc(__subfield, (uint)__hdr.subfieldlen+sizeof(JamSubFieldHdr)+_datlen);
JamSubField* _subfieldptr = (JamSubField*)(__subfield + (uint)__hdr.subfieldlen);
_subfieldptr->loid = __loid;
@@ -223,7 +223,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
if(_pdptr->control > CTRL_KLUDGE) {
uint _offset = 0;
word _loid = 0;
ulong _maxlen = 0;
uint32_t _maxlen = 0;
switch(_pdptr->control) {
case CTRL_INTL:
case CTRL_FMPT:
@@ -442,7 +442,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
if(data->highwater >= __msg->msgno) {
data->highwater = __msg->msgno - 1;
lseek(data->fhjhw, 0, SEEK_SET);
write(data->fhjhw, &data->highwater, sizeof(long));
write(data->fhjhw, &data->highwater, sizeof(int32_t));
}
}
}

View File

@@ -97,48 +97,48 @@ Line* JamArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
AddLineF(line, "Signature : %s", _hdr->signature);
AddLineF(line, "Revision : %u", _hdr->revision);
AddLineF(line, "ReservedWord : %u", _hdr->reservedword);
AddLineF(line, "SubfieldLen : %lu", _hdr->subfieldlen);
AddLineF(line, "TimesRead : %lu", _hdr->timesread);
AddLineF(line, "MSGIDcrc : %08lXh", _hdr->msgidcrc);
AddLineF(line, "REPLYcrc : %08lXh", _hdr->replycrc);
AddLineF(line, "ReplyTo : %lu", _hdr->replyto);
AddLineF(line, "Reply1st : %lu", _hdr->reply1st);
AddLineF(line, "ReplyNext : %lu", _hdr->replynext);
AddLineF(line, "DateWritten : %s (%08lXh)", TimeToStr(buf, _hdr->datewritten), (long)_hdr->datewritten);
AddLineF(line, "DateReceived : %s (%08lXh)", TimeToStr(buf, _hdr->datereceived), (long)_hdr->datereceived);
AddLineF(line, "DateProcessed : %s (%08lXh)", TimeToStr(buf, _hdr->dateprocessed), (long)_hdr->dateprocessed);
AddLineF(line, "MessageNumber : %lu", _hdr->messagenumber);
AddLineF(line, "Attribute : %08lXh (%sb)", _hdr->attribute, ltob(buf, _hdr->attribute, 0));
AddLineF(line, "Attribute2 : %08lXh (%sb)", _hdr->attribute2, ltob(buf, _hdr->attribute2, 0));
AddLineF(line, "Offset : %lu", _hdr->offset);
AddLineF(line, "TxtLen : %lu", _hdr->txtlen);
AddLineF(line, "PasswordCRC : %08lXh", _hdr->passwordcrc);
AddLineF(line, "Cost : %lu", _hdr->cost);
AddLineF(line, "SubfieldLen : %u", _hdr->subfieldlen);
AddLineF(line, "TimesRead : %u", _hdr->timesread);
AddLineF(line, "MSGIDcrc : %08Xh", _hdr->msgidcrc);
AddLineF(line, "REPLYcrc : %08Xh", _hdr->replycrc);
AddLineF(line, "ReplyTo : %u", _hdr->replyto);
AddLineF(line, "Reply1st : %u", _hdr->reply1st);
AddLineF(line, "ReplyNext : %u", _hdr->replynext);
AddLineF(line, "DateWritten : %s (%08Xh)", TimeToStr(buf, _hdr->datewritten), (int32_t)_hdr->datewritten);
AddLineF(line, "DateReceived : %s (%08Xh)", TimeToStr(buf, _hdr->datereceived), (int32_t)_hdr->datereceived);
AddLineF(line, "DateProcessed : %s (%08Xh)", TimeToStr(buf, _hdr->dateprocessed), (int32_t)_hdr->dateprocessed);
AddLineF(line, "MessageNumber : %u", _hdr->messagenumber);
AddLineF(line, "Attribute : %08Xh (%sb)", _hdr->attribute, ltob(buf, _hdr->attribute, 0));
AddLineF(line, "Attribute2 : %08Xh (%sb)", _hdr->attribute2, ltob(buf, _hdr->attribute2, 0));
AddLineF(line, "Offset : %u", _hdr->offset);
AddLineF(line, "TxtLen : %u", _hdr->txtlen);
AddLineF(line, "PasswordCRC : %08Xh", _hdr->passwordcrc);
AddLineF(line, "Cost : %u", _hdr->cost);
line = AddLine(line, "");
AddLineF(line, "Index Record:");
line = AddLine(line, "");
AddLineF(line, "UserCrc : %08lXh", _idx.usercrc);
AddLineF(line, "HeaderOffset : %08lXh (%lu)", _idx.hdroffset, _idx.hdroffset);
AddLineF(line, "UserCrc : %08Xh", _idx.usercrc);
AddLineF(line, "HeaderOffset : %08Xh (%u)", _idx.hdroffset, _idx.hdroffset);
line = AddLine(line, "");
AddLineF(line, "Lastread Record:");
line = AddLine(line, "");
AddLineF(line, "Index : %lu", data->lastpos);
AddLineF(line, "UserCrc : %08lXh", data->lastrec.usercrc);
AddLineF(line, "UserId : %08lXh", data->lastrec.userid);
AddLineF(line, "Lastread : %lu", data->lastrec.lastread);
AddLineF(line, "Highread : %lu", data->lastrec.highread);
AddLineF(line, "Index : %u", data->lastpos);
AddLineF(line, "UserCrc : %08Xh", data->lastrec.usercrc);
AddLineF(line, "UserId : %08Xh", data->lastrec.userid);
AddLineF(line, "Lastread : %u", data->lastrec.lastread);
AddLineF(line, "Highread : %u", data->lastrec.highread);
line = AddLine(line, "");
AddLineF(line, "Base Header:");
line = AddLine(line, "");
AddLineF(line, "DateCreated : %s (%08lXh)", TimeToStr(buf, _base->datecreated), (long)_base->datecreated);
AddLineF(line, "ModCounter : %lu", _base->modcounter);
AddLineF(line, "ActiveMsgs : %lu", _base->activemsgs);
AddLineF(line, "PasswordCRC : %08lXh", _base->passwordcrc);
AddLineF(line, "BaseMsgNum : %lu", _base->basemsgnum);
AddLineF(line, "DateCreated : %s (%08Xh)", TimeToStr(buf, _base->datecreated), (int32_t)_base->datecreated);
AddLineF(line, "ModCounter : %u", _base->modcounter);
AddLineF(line, "ActiveMsgs : %u", _base->activemsgs);
AddLineF(line, "PasswordCRC : %08Xh", _base->passwordcrc);
AddLineF(line, "BaseMsgNum : %u", _base->basemsgnum);
if(jamwide->smapihw)
AddLineF(line, "HighWaterMark : %lu", _base->highwatermark);
AddLineF(line, "HighWaterMark : %u", _base->highwatermark);
else if(data->highwater != -1)
AddLineF(line, "HighWaterMark : %lu", data->highwater);
AddLineF(line, "HighWaterMark : %u", data->highwater);
else
AddLineF(line, "HighWaterMark : unknown");
line = AddLine(line, "");
@@ -155,12 +155,12 @@ Line* JamArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
_subfieldpos += sizeof(JamSubFieldHdr);
uint _datlen = (uint)_subfieldptr->datlen;
if(_subfieldpos > _hdr->subfieldlen) {
AddLineF(line, "Error: SubfieldHdr at pos %lu exceeds SubfieldLen (%lu)!", (unsigned long)(_subfieldpos-sizeof(JamSubFieldHdr)), _hdr->subfieldlen);
AddLineF(line, "Error: SubfieldHdr at pos %u exceeds SubfieldLen (%u)!", (uint)(_subfieldpos-sizeof(JamSubFieldHdr)), _hdr->subfieldlen);
break;
}
if((_subfieldpos + _datlen) > _hdr->subfieldlen) {
_datlen = (uint)(_hdr->subfieldlen - _subfieldpos);
AddLineF(line, "Error: SubfieldData at pos %u is too long (%u)! Cut to %u.", _subfieldpos, (uint)_subfieldptr->datlen, _datlen);
AddLineF(line, "Error: SubfieldData at pos %u is too int32_t (%u)! Cut to %u.", _subfieldpos, (uint)_subfieldptr->datlen, _datlen);
}
AddLineF(line, "%05u [%3u]: \"%-*.*s\"",
_subfieldptr->loid, _datlen,

View File

@@ -57,10 +57,10 @@ typedef char PcbName[25+1];
struct PcbBase {
long highmsgno; // High Message Number (0 to 16,700,000)
long lowmsgno; // Low Message Number (0 to 16,700,000)
long active; // Number of Active Messages (0 to 32,767)
long callers; // Number of System Callers (Main Message Base Only)
int32_t highmsgno; // High Message Number (0 to 16,700,000)
int32_t lowmsgno; // Low Message Number (0 to 16,700,000)
int32_t active; // Number of Active Messages (0 to 32,767)
int32_t callers; // Number of System Callers (Main Message Base Only)
char locked[6]; // The "LOCKED" field for pre-14.2 systems (see note 1)
byte reserved[106]; // Reserved for future use
};
@@ -72,13 +72,13 @@ struct PcbBase {
struct PcbHdr {
char status; // Message Status Flag (see note 2)
long msgno; // Message Number (0 to 16,700,000)
long refno; // Reference Number (0 to 16,700,000)
int32_t msgno; // Message Number (0 to 16,700,000)
int32_t refno; // Reference Number (0 to 16,700,000)
byte blocks; // Number of 128 Byte Blocks in Message (see note 3)
char date[8]; // Date of Message Entry (in "mm-dd-yy" format)
char time[5]; // Time of Message Entry (in "hh:mm" format)
char destname[25]; // Name of the User to whom the Message is Addressed
long replydate; // Date of the Reply Message (in yymmdd format)
int32_t replydate; // Date of the Reply Message (in yymmdd format)
char replytime[5]; // Time of the Reply Message (in "hh:mm" format)
char hasreply; // The Letter "R" if the Message has a Reply
char origname[25]; // Name of the User who wrote the Message
@@ -111,8 +111,8 @@ struct PcbExtHdr {
struct PcbIdx {
long offset; // Offset (0 if none, >0 if active, <0 if killed)
long num; // Message Number
int32_t offset; // Offset (0 if none, >0 if active, <0 if killed)
int32_t num; // Message Number
char to[25]; // TO Name
char from[25]; // FROM Name
char status; // Status Character (from Message Header)
@@ -152,10 +152,10 @@ struct PcbWide {
int numareas;
PcbUsers usersrec;
PcbUsersInfHdr usershdr;
long usershdrsize;
long* lastread;
long confbytelen;
long extconflen;
int32_t usershdrsize;
int32_t* lastread;
int32_t confbytelen;
int32_t extconflen;
int foreign;
const char* path;
};

View File

@@ -115,12 +115,12 @@ void PcbInit(const char* path, int userno) {
if(_recsize) {
PcbConf* _cnames = (PcbConf*)throw_calloc(1, _recsize);
int _rec = 0;
pcbwide->numareas = (int)((fp.filelength()-2)/(long)_recsize);
pcbwide->numareas = (int)((fp.filelength()-2)/_recsize);
pcbwide->confbytelen = (pcbwide->numareas/8) + ((pcbwide->numareas%8) != 0 ? 1 : 0);
if(pcbwide->confbytelen < 5)
pcbwide->confbytelen = 5;
pcbwide->extconflen = pcbwide->confbytelen - 5;
pcbwide->lastread = (long*)throw_calloc(pcbwide->numareas, sizeof(long));
pcbwide->lastread = (int32_t*)throw_calloc(pcbwide->numareas, sizeof(int32_t));
while(fp.fread(_cnames, _recsize) == 1) {
PcbAdjustArea((uint)_rec, _cnames->msgfile);
_rec++;
@@ -208,16 +208,16 @@ void PcbArea::save_lastread() {
dword tmplr = Msgn->CvtReln(lastread);
if(board() < 40) {
// Write lastreads to USERS file
lseekset(wide->fhusr, (long)wide->userno*(long)sizeof(PcbUsers));
lseekset(wide->fhusr, wide->userno*sizeof(PcbUsers));
read(wide->fhusr, &wide->usersrec, sizeof(PcbUsers));
wide->usersrec.lastmsgread[board()] = L2B(tmplr);
lseekset(wide->fhusr, (long)wide->userno*(long)sizeof(PcbUsers));
lseekset(wide->fhusr, wide->userno*sizeof(PcbUsers));
write(wide->fhusr, &wide->usersrec, sizeof(PcbUsers));
}
else {
// Write lastreads to USERS.INF file
if(wide->extconflen) {
long _offset = (wide->usersrec.usersinfrec-1)*wide->usershdr.totalrecsize;
int32_t _offset = (wide->usersrec.usersinfrec-1)*wide->usershdr.totalrecsize;
_offset += wide->usershdrsize;
_offset += wide->usershdr.sizeofrec;
_offset += 2 * wide->confbytelen;

View File

@@ -105,7 +105,7 @@ void PcbWideOpen() {
pcbwide->user->fhinf = pcbwide->fhinf;
// Read lastreads from USERS file
lseekset(pcbwide->fhusr, (long)pcbwide->userno*(long)sizeof(PcbUsers));
lseekset(pcbwide->fhusr, pcbwide->userno*sizeof(PcbUsers));
read(pcbwide->fhusr, &pcbwide->usersrec, sizeof(PcbUsers));
int _maxlr = MinV(pcbwide->numareas, 40);
for(int n=0; n<_maxlr; n++)
@@ -113,13 +113,13 @@ void PcbWideOpen() {
// Read lastreads from USERS.INF file
if(pcbwide->extconflen) {
long _offset = (pcbwide->usersrec.usersinfrec-1)*pcbwide->usershdr.totalrecsize;
int32_t _offset = (pcbwide->usersrec.usersinfrec-1)*pcbwide->usershdr.totalrecsize;
_offset += pcbwide->usershdrsize;
_offset += pcbwide->usershdr.sizeofrec;
_offset += 2 * pcbwide->confbytelen;
_offset += 3 * pcbwide->extconflen;
lseekset(pcbwide->fhinf, _offset);
read(pcbwide->fhinf, pcbwide->lastread+40, (pcbwide->numareas-40)*sizeof(long));
read(pcbwide->fhinf, pcbwide->lastread+40, (pcbwide->numareas-40)*sizeof(int32_t));
}
pcbwide->isopen = true;
@@ -246,7 +246,7 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
}
// Get some sizes
long _idxlen = filelength(data->fhidx);
uint _idxlen = filelength(data->fhidx);
uint _idxsize = (uint)_idxlen;
uint _idxtotal = _idxsize / sizeof(PcbIdx);
@@ -262,15 +262,15 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
read(data->fhidx, _idxbuf, _idxsize);
// Variables for the loop
register uint _active = 0;
register ulong _firstmsgno = 0;
register ulong _lastmsgno = 0;
register ulong _lastreadfound = 0;
register ulong _totalmsgs = _idxtotal;
register ulong _lastread = wide->lastread[board()];
register uint _lastread_reln = 0;
register ulong* _msgndxptr = Msgn->tag;
register PcbIdx* _idxptr = _idxbuf;
uint _active = 0;
uint _firstmsgno = 0;
uint _lastmsgno = 0;
uint _lastreadfound = 0;
uint _totalmsgs = _idxtotal;
uint _lastread = wide->lastread[board()];
uint _lastread_reln = 0;
uint32_t* _msgndxptr = Msgn->tag;
PcbIdx* _idxptr = _idxbuf;
// Fill message index
register uint n = 0;

View File

@@ -41,7 +41,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Read index record for msg
PcbIdx _idx;
lseekset(data->fhidx, (__msg->msgno-data->base.lowmsgno)*(long)sizeof(PcbIdx));
lseekset(data->fhidx, (__msg->msgno-data->base.lowmsgno)*sizeof(PcbIdx));
read(data->fhidx, &_idx, sizeof(PcbIdx));
__msg->txtstart = _idx.offset;

View File

@@ -109,9 +109,9 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Find msgno and index offset
PcbIdx _idx;
ulong oldmsgno = __msg->msgno;
long oldtxtstart = __msg->txtstart;
long oldtxtlength = __msg->txtlength;
uint32_t oldmsgno = __msg->msgno;
int32_t oldtxtstart = __msg->txtstart;
int32_t oldtxtlength = __msg->txtlength;
if(__mode & GMSG_TXT) {
if(data->base.lowmsgno == 0)
data->base.lowmsgno = 1;
@@ -120,7 +120,7 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
__msg->msgno = data->base.highmsgno;
Msgn->Append(__msg->msgno);
}
long _idxoffset = (__msg->msgno-data->base.lowmsgno)*(long)sizeof(PcbIdx);
int32_t _idxoffset = (__msg->msgno-data->base.lowmsgno)*sizeof(PcbIdx);
__hdr.blocks = (byte)__msg->txtblocks;
_idx.num = __msg->msgno;
_idx.reserved[0] = _idx.reserved[1] = _idx.reserved[2] = 0;

View File

@@ -61,16 +61,16 @@ Line* PcbArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
// Read lastread records
byte _mailwaiting = 0;
dword* dumplr = (dword*)throw_calloc(wide->numareas, sizeof(dword));
lseekset(wide->fhusr, (long)wide->userno*(long)sizeof(PcbUsers));
lseekset(wide->fhusr, wide->userno*sizeof(PcbUsers));
read(wide->fhusr, &wide->usersrec, sizeof(PcbUsers));
int _maxlr = MinV(wide->numareas, 40);
int n;
for(n=0; n<_maxlr; n++)
dumplr[n] = wide->usersrec.lastmsgread[n];
long _offset = (wide->usersrec.usersinfrec-1)*wide->usershdr.totalrecsize;
int32_t _offset = (wide->usersrec.usersinfrec-1)*wide->usershdr.totalrecsize;
_offset += wide->usershdrsize;
_offset += wide->usershdr.sizeofrec;
long _offset2 = _offset;
int32_t _offset2 = _offset;
_offset2 += board() / 8;
lseekset(wide->fhinf, _offset2);
read(wide->fhinf, &_mailwaiting, 1);
@@ -80,12 +80,12 @@ Line* PcbArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
_offset += 3 * wide->extconflen;
if(wide->extconflen) {
lseekset(wide->fhinf, _offset);
read(wide->fhinf, dumplr+40, (wide->numareas-40)*sizeof(long));
read(wide->fhinf, dumplr+40, (wide->numareas-40)*sizeof(int32_t));
}
// Read index record for msg
PcbIdx _idx;
lseekset(data->fhidx, (__msg->msgno-data->base.lowmsgno)*(long)sizeof(PcbIdx));
lseekset(data->fhidx, (__msg->msgno-data->base.lowmsgno)*sizeof(PcbIdx));
read(data->fhidx, &_idx, sizeof(PcbIdx));
// Read message header
@@ -109,15 +109,15 @@ Line* PcbArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
line = AddLine(line, "");
AddLineF(line, "Msgbase : %s", real_path());
AddLineF(line, "BoardNo : %u", board());
AddLineF(line, "MsgOffset : %li", _idx.offset);
AddLineF(line, "MsgOffset : %i", _idx.offset);
AddLineF(line, "Status : \'%c\'", _hdr.status);
AddLineF(line, "Msgno : %li (%08lXh)", B2L(_hdr.msgno), _hdr.msgno);
AddLineF(line, "Refno : %li (%08lXh)", B2L(_hdr.refno), _hdr.refno);
AddLineF(line, "Msgno : %i (%08Xh)", B2L(_hdr.msgno), _hdr.msgno);
AddLineF(line, "Refno : %i (%08Xh)", B2L(_hdr.refno), _hdr.refno);
AddLineF(line, "Blocks : %i", _hdr.blocks);
AddLineF(line, "Date/Time : %8.8s %5.5s", _hdr.date, _hdr.time);
AddLineF(line, "IdxDate : %02u-%02u-%02u (%u)", _month, _day, _year-1900, _idx.date);
AddLineF(line, "DestName : %-25.25s", _hdr.destname);
AddLineF(line, "ReplyDate : %li", B2L(_hdr.replydate));
AddLineF(line, "ReplyDate : %i", B2L(_hdr.replydate));
AddLineF(line, "ReplyTime : %5.5s", _hdr.replytime);
AddLineF(line, "HasReply : \'%c\'", _hdr.hasreply);
AddLineF(line, "OrigName : %-25.25s", _hdr.origname);
@@ -131,9 +131,9 @@ Line* PcbArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
line = AddLine(line, "");
AddLineF(line, "Message Base Header:");
line = AddLine(line, "");
AddLineF(line, "HighMsgno : %li", data->base.highmsgno);
AddLineF(line, "LowMsgno : %li", data->base.lowmsgno);
AddLineF(line, "Active : %li", data->base.active);
AddLineF(line, "HighMsgno : %i", data->base.highmsgno);
AddLineF(line, "LowMsgno : %i", data->base.lowmsgno);
AddLineF(line, "Active : %i", data->base.active);
AddLineF(line, "Locked : %6.6s", data->base.locked);
line = AddLine(line, "");
@@ -143,14 +143,14 @@ Line* PcbArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
line = AddLine(line, "");
for(n=0; n<_maxlr; n++) {
dword tmplr = B2L(dumplr[n]);
AddLineF(line, "Board %4u : %10lu / %08lXh / %08lXh", n, tmplr, tmplr, dumplr[n]);
AddLineF(line, "Board %4u : %10u / %08Xh / %08Xh", n, tmplr, tmplr, dumplr[n]);
}
line = AddLine(line, "");
AddLineF(line, "Lastreads from the USERS.INF file:");
line = AddLine(line, "");
for(; n<wide->numareas; n++)
AddLineF(line, "Board %4u : %10lu / %08lXh", n, dumplr[n], dumplr[n]);
AddLineF(line, "Board %4u : %10u / %08Xh", n, dumplr[n], dumplr[n]);
line = AddLine(line, "");
AddLineF(line, lng_head);

View File

@@ -45,7 +45,7 @@ void FidoRenumberProgress(const char* s);
// ------------------------------------------------------------------
void GoldInit(const char* path, const char* syspath, int userno, long sizewarn=0, int ra2usersbbs=0);
void GoldInit(const char* path, const char* syspath, int userno, int32_t sizewarn=0, int ra2usersbbs=0);
void GoldExit();
void GoldWideOpen();
@@ -54,7 +54,7 @@ void GoldWideClose();
// ------------------------------------------------------------------
void HudsInit(const char* path, const char* syspath, int userno, long sizewarn, int ra2usersbbs);
void HudsInit(const char* path, const char* syspath, int userno, int32_t sizewarn, int ra2usersbbs);
void HudsExit();
void HudsSizewarn();

View File

@@ -252,7 +252,7 @@ int SMBArea::load_hdr(gmsg* __msg, smbmsg_t *smsg)
smbmsg_t local_smsg, *smsgp;
smsgp = smsg ? smsg : &local_smsg;
ulong reln = Msgn->ToReln(__msg->msgno);
uint32_t reln = Msgn->ToReln(__msg->msgno);
if(reln == 0) {
GFTRK(NULL);
return false;
@@ -348,13 +348,13 @@ int SMBArea::load_msg(gmsg* msg)
smbmsg_t smsg;
ushort xlat;
uchar *inbuf;
long outlen;
int32_t outlen;
char buf[512];
int i;
bool lzh;
bool tail = true;
ulong l;
ulong txt_len = 1;
uint32_t l;
uint32_t txt_len = 1;
GFTRK("SMBLoadMsg");
@@ -448,7 +448,7 @@ common:
if(lzh) {
inbuf = (uchar *)throw_xmalloc(smsg.dfield[i].length);
fread(inbuf, smsg.dfield[i].length - l, 1, data->sdt_fp);
outlen = *(long *)inbuf;
outlen = *(int32_t *)inbuf;
msg->txt = (char *)throw_realloc(msg->txt, txt_len+outlen);
lzh_decode(inbuf, smsg.dfield[i].length - l, (uchar *)(msg->txt+txt_len-1));
throw_xfree(inbuf);
@@ -502,7 +502,7 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
int rv;
char ch;
bool done, cr;
ulong l, m, bodylen, taillen, crc;
uint32_t l, m, bodylen, taillen, crc;
char *fbuf, *sbody, *stail;
char buf[256];
smbmsg_t smsg;
@@ -513,7 +513,7 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
smb_getstatus(data);
memset(&smsg, 0, sizeof(smbmsg_t));
if(not (mode & GMSG_NEW)) {
ulong reln = Msgn->ToReln(msg->msgno);
uint32_t reln = Msgn->ToReln(msg->msgno);
if(reln == 0) {
GFTRK(NULL);
return;
@@ -745,13 +745,13 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
smb_close_da(data);
}
else
smsg.hdr.offset = (ulong)-1L;
smsg.hdr.offset = (uint32_t)-1L;
}
else {
smsg.hdr.offset = smb_hallocdat(data);
}
if(smsg.hdr.offset != (ulong)-1L) {
if(smsg.hdr.offset != (uint32_t)-1L) {
fseek(data->sdt_fp, smsg.hdr.offset, SEEK_SET);
*(ushort *)(sbody-2) = XLAT_NONE;
l = ftell(data->sdt_fp);
@@ -775,7 +775,7 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
else {
// Changing message... It is always bad idea since it is usually
// undescribed and not supported by the API
long l;
int32_t l;
if(data->locked or (smb_locksmbhdr(data) == 0)) {
if(smb_getstatus(data) == 0) {
@@ -829,7 +829,7 @@ void SMBArea::del_msg(gmsg* msg)
GFTRK("SMBDelMsg");
smbmsg_t smsg;
ulong reln = Msgn->ToReln(msg->msgno);
uint32_t reln = Msgn->ToReln(msg->msgno);
if(reln == 0) {
GFTRK(NULL);
return;
@@ -966,18 +966,18 @@ Line* SMBArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
line = AddLineF(line, "Version : %04Xh", smsg.hdr.version);
line = AddLineF(line, "Length : %u", smsg.hdr.length);
line = AddLineF(line, "Attr : %04Xh", smsg.hdr.attr);
line = AddLineF(line, "AUXAttr : %04lXh", smsg.hdr.auxattr);
line = AddLineF(line, "NetAttr : %04lXh", smsg.hdr.netattr);
line = AddLineF(line, "AUXAttr : %04Xh", smsg.hdr.auxattr);
line = AddLineF(line, "NetAttr : %04Xh", smsg.hdr.netattr);
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_written.time))[-1] = NUL;
line = AddLineF(line, "Written : %s", buf);
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_imported.time))[-1] = NUL;
line = AddLineF(line, "Imported : %s", buf);
line = AddLineF(line, "Number : %ld (%ld)", smsg.hdr.number, (long)(ftell(data->sid_fp)/sizeof(idxrec_t)));
line = AddLineF(line, "Thread orig : %ld", smsg.hdr.thread_orig);
line = AddLineF(line, "Thread next : %ld", smsg.hdr.thread_next);
line = AddLineF(line, "Thread first : %ld", smsg.hdr.thread_first);
line = AddLineF(line, "Number : %d (%d)", smsg.hdr.number, (int32_t)(ftell(data->sid_fp)/sizeof(idxrec_t)));
line = AddLineF(line, "Thread orig : %d", smsg.hdr.thread_orig);
line = AddLineF(line, "Thread next : %d", smsg.hdr.thread_next);
line = AddLineF(line, "Thread first : %d", smsg.hdr.thread_first);
line = AddLineF(line, "Reserved : %s", HexDump16(buf, (const char*)smsg.hdr.reserved, 16, "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X"));
line = AddLineF(line, "Offset : %06lXh", smsg.hdr.offset);
line = AddLineF(line, "Offset : %06Xh", smsg.hdr.offset);
line = AddLineF(line, "Total dfields : %u", smsg.hdr.total_dfields);
if(smsg.from_net.type) {
@@ -1005,8 +1005,8 @@ Line* SMBArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
for (i = 0; i < smsg.hdr.total_dfields; i++) {
line = AddLineF(line, "dfield[%02u].type : %02X", i, smsg.dfield[i].type);
line = AddLineF(line, "dfield[%02u].offset : %lu", i, smsg.dfield[i].offset);
line = AddLineF(line, "dfield[%02u].length : %lu", i, smsg.dfield[i].length);
line = AddLineF(line, "dfield[%02u].offset : %u", i, smsg.dfield[i].offset);
line = AddLineF(line, "dfield[%02u].length : %u", i, smsg.dfield[i].length);
}
line = AddLine(line, "");
@@ -1038,11 +1038,11 @@ Line* SMBArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
ushort xlat;
uchar *inbuf;
long outlen;
int32_t outlen;
bool lzh;
bool tail = true;
ulong l;
ulong txt_len = 1;
uint32_t l;
uint32_t txt_len = 1;
msg->txt = throw_strdup("");
@@ -1073,7 +1073,7 @@ common:
if(lzh) {
inbuf = (uchar *)throw_xmalloc(smsg.dfield[i].length);
fread(inbuf, smsg.dfield[i].length - l, 1, data->sdt_fp);
outlen = *(long *)inbuf;
outlen = *(int32_t *)inbuf;
msg->txt = (char *)throw_realloc(msg->txt, txt_len+outlen);
lzh_decode(inbuf, smsg.dfield[i].length - l, (uchar *)(msg->txt+txt_len-1));
throw_xfree(inbuf);

View File

@@ -45,22 +45,22 @@ void SMBArea::raw_scan(bool keep_index, bool scanpm)
}
data_open();
}
ulong firstmsgno = 0;
ulong lastmsgno = 0;
uint32_t firstmsgno = 0;
uint32_t lastmsgno = 0;
Msgn->Reset();
PMrk->Reset();
if(isopen or smb_open(data) == 0) {
if(smb_locksmbhdr(data) == 0) {
int res = smb_getstatus(data);
smb_unlocksmbhdr(data);
ulong total_msgs = 0;
uint32_t total_msgs = 0;
if(res == 0) {
total_msgs = data->status.total_msgs;
lastmsgno = data->status.last_msg;
if(keep_index or scanpm) {
smbmsg_t msg;
int umax = (WidePersonalmail & PM_ALLNAMES) ? WideUsernames : 1;
ulong l = 1;
uint32_t l = 1;
rewind(data->sid_fp);
while(l <= total_msgs) {
if(not fread(&msg.idx, 1, sizeof(idxrec_t), data->sid_fp))
@@ -101,7 +101,7 @@ void SMBArea::raw_scan(bool keep_index, bool scanpm)
}
}
if(WideDebug) {
WideLog->printf("- %s: t:%u, l:%u, fm:%lu, hm:%lu, lr:%u, u:%u, pm: %i",
WideLog->printf("- %s: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u, pm: %i",
echoid(),
Msgn->Count(),
0,

View File

@@ -178,8 +178,8 @@ const word SQFRAME_FREE = 1;
struct SqshFrm {
dword id; // Must always equal SQFRAMEID
long next; // Offset of next frame
long prev; // Offset of previous frame
int32_t next; // Offset of next frame
int32_t prev; // Offset of previous frame
dword length; // Length of this frame
dword totsize; // Length of data in frame (hdr+ctl+txt)
dword ctlsize; // Length of control info
@@ -192,7 +192,7 @@ struct SqshFrm {
// Structure of index file .SQI
struct SqshIdx {
long offset; // Offset of frame in .SQD
int32_t offset; // Offset of frame in .SQD
dword msgno; // Message number
dword hash; // Hash value of TO: name
};
@@ -281,7 +281,7 @@ protected:
void delete_msg(uint __reln);
void init_frm(SqshFrm* __frm);
void excess_frm(dword __lastframe, dword __newframe, SqshFrm* __newfrm, dword __totsize);
uint find_msgn(ulong __tagn);
uint find_msgn(uint32_t __tagn);
void save_message(int __mode, gmsg* __msg);
public:

View File

@@ -146,14 +146,14 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
isopen--;
}
register ulong _msgno;
register SqshIdx* _sqiptr = data->idx;
register dword _totalmsgs = data->base.totalmsgs;
register ulong _firstmsgno = _totalmsgs ? _sqiptr->msgno : 0;
register ulong _lastmsgno = 0;
register uint _active = 0;
register uint _lastread_reln = 0;
register ulong _lastreadfound = 0;
uint _msgno;
SqshIdx* _sqiptr = data->idx;
dword _totalmsgs = data->base.totalmsgs;
uint _firstmsgno = _totalmsgs ? _sqiptr->msgno : 0;
uint _lastmsgno = 0;
uint _active = 0;
uint _lastread_reln = 0;
uint _lastreadfound = 0;
if(data->base.totalmsgs) {
@@ -161,7 +161,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
if(__keep_index)
Msgn->Resize((uint)data->base.totalmsgs);
register ulong* _msgndxptr = Msgn->tag;
uint32_t* _msgndxptr = Msgn->tag;
// Fill message index
while(_active < _totalmsgs) {
@@ -252,7 +252,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
}
if(WideDebug) {
WideLog->printf("- %s: t:%u, l:%u, fm:%lu, hm:%lu, lr:%lu, u:%u, pm:%i",
WideLog->printf("- %s: t:%u, l:%u, fm:%u, hm:%u, lr:%u, u:%u, pm:%i",
echoid(),
Msgn->Count(),
lastread,

View File

@@ -152,7 +152,7 @@ void SquishArea::add_to_free_chain(dword __delframe, SqshFrm* __delfrm) {
// Write the deleted frame
__delfrm->type = SQFRAME_FREE;
//WideLog->printf("- Deleted frame 0x%08lX of length %lu.", __delframe, __delfrm->length);
//WideLog->printf("- Deleted frame 0x%08X of length %u.", __delframe, __delfrm->length);
write_frm(__delframe, __delfrm);
}
@@ -282,7 +282,7 @@ uint CopyToBuf(char* p, char* out, char** end) {
char* CopyToControlBuf(char* txt, char** newtext, uint* length) {
// Figure out how long the control info is
// Figure out how int32_t the control info is
uint ctlsize = CopyToBuf(txt, NULL, NULL);
// Allocate memory for it
@@ -328,14 +328,14 @@ void SquishArea::excess_frm(dword __lastframe, dword __newframe, SqshFrm* __newf
write_frm(_exframe, &_exfrm);
SqshFrm _tmpfrm;
upd_frm_prev(_exfrm.next, &_tmpfrm, _exframe);
//WideLog->printf("- Created excess free frame 0x%08lX of length %lu.", _exframe, _exfrm.length);
//WideLog->printf("- Created excess free frame 0x%08X of length %u.", _exframe, _exfrm.length);
}
}
// ------------------------------------------------------------------
uint SquishArea::find_msgn(ulong __tagn) {
uint SquishArea::find_msgn(uint32_t __tagn) {
if(data->idx) {
@@ -347,9 +347,9 @@ uint SquishArea::find_msgn(ulong __tagn) {
if(tags and __tagn) {
register long _mid;
register long _left = 0;
register long _right = tags;
register int32_t _mid;
register int32_t _left = 0;
register int32_t _right = tags;
do {
_mid = (_left+_right)/2;
@@ -483,26 +483,26 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
// Locate a free frame, if possible
_newframe = _base.firstfreeframe;
//WideLog->printf("- Looking for a frame of at least length %lu.", _totsize);
//WideLog->printf("- Looking for a frame of at least length %u.", _totsize);
while(1) {
// At end of free frames?
if(_newframe == SQFRAME_NULL) {
_newframe = _base.endframe;
init_frm(&_newfrm);
//WideLog->printf("- Allocated new frame 0x%08lX of length %lu.", _newframe, _totsize);
//WideLog->printf("- Allocated new frame 0x%08X of length %u.", _newframe, _totsize);
break;
}
// Is this frame large enough in itself?
read_frm(_newframe, &_newfrm);
//WideLog->printf("- Found free frame 0x%08lX of length %lu.", _newframe, _newfrm.length);
//WideLog->printf("- Found free frame 0x%08X of length %u.", _newframe, _newfrm.length);
if(_newfrm.length >= _totsize) {
// Create excess frame if possible
if(wide->recycle == SQUISHRECYCLE_YES) {
excess_frm(_newframe, _newframe, &_newfrm, _totsize);
//WideLog->printf("- Frame was large enough (%lu bytes wasted).", _newfrm.length - _totsize);
//WideLog->printf("- Frame was large enough (%u bytes wasted).", _newfrm.length - _totsize);
}
break;
}
@@ -514,7 +514,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
SqshFrm _lastfrm;
read_frm(_newfrm.next, &_lastfrm);
_newfrm.length += _lastfrm.length + sizeof(SqshFrm);
//WideLog->printf("- Merged frames 0x%08lX and 0x%08lX. New length: %lu.", _newframe, _newfrm.next, _newfrm.length);
//WideLog->printf("- Merged frames 0x%08X and 0x%08X. New length: %u.", _newframe, _newfrm.next, _newfrm.length);
_lastframe = _newfrm.next;
_newfrm.next = _lastfrm.next;
}
@@ -525,7 +525,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
// Create excess frame if possible
if(wide->recycle == SQUISHRECYCLE_YES) {
excess_frm(_lastframe, _newframe, &_newfrm, _totsize);
//WideLog->printf("- Merged frame was large enough (%lu bytes wasted).", _newfrm.length - _totsize);
//WideLog->printf("- Merged frame was large enough (%u bytes wasted).", _newfrm.length - _totsize);
}
// If one of the frames in our chain was the last free frame,
@@ -544,7 +544,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
}
// If this was the first frame (ie. the first one pointed to by
// firstfreeframe, which means that the first frame found was long
// firstfreeframe, which means that the first frame found was int32_t
// enough to hold the message), then set the free pointer to the
// start of the new free chain.
if(_newframe == _base.firstfreeframe)

View File

@@ -95,47 +95,47 @@ Line* SquishArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "DateTime : %-20.20s", _hdr.ftsc_date);
AddLineF(line, "OrigAddr : %u:%u/%u.%u", _hdr.orig.zone, _hdr.orig.net, _hdr.orig.node, _hdr.orig.point);
AddLineF(line, "DestAddr : %u:%u/%u.%u", _hdr.dest.zone, _hdr.dest.net, _hdr.dest.node, _hdr.dest.point);
AddLineF(line, "Umsgid : %lu", _hdr.umsgid);
AddLineF(line, "Reply : %lu", _hdr.replyto);
AddLineF(line, "See : %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu",
AddLineF(line, "Umsgid : %u", _hdr.umsgid);
AddLineF(line, "Reply : %u", _hdr.replyto);
AddLineF(line, "See : %u, %u, %u, %u, %u, %u, %u, %u, %u",
_hdr.replies[0], _hdr.replies[1], _hdr.replies[2],
_hdr.replies[3], _hdr.replies[4], _hdr.replies[5],
_hdr.replies[6], _hdr.replies[7], _hdr.replies[8]
);
AddLineF(line, "Attr : %08lXh (%sb)", _hdr.attr, ltob(buf,_hdr.attr,0));
AddLineF(line, "DateWritten : %s (%08lXh)", FTimeToStr(buf, _hdr.date_written), *(dword*)&_hdr.date_written);
AddLineF(line, "DateArrived : %s (%08lXh)", FTimeToStr(buf, _hdr.date_arrived), *(dword*)&_hdr.date_arrived);
AddLineF(line, "Attr : %08Xh (%sb)", _hdr.attr, ltob(buf,_hdr.attr,0));
AddLineF(line, "DateWritten : %s (%08Xh)", FTimeToStr(buf, _hdr.date_written), *(dword*)&_hdr.date_written);
AddLineF(line, "DateArrived : %s (%08Xh)", FTimeToStr(buf, _hdr.date_arrived), *(dword*)&_hdr.date_arrived);
AddLineF(line, "UTC-Offset : %u", _hdr.utc_offset);
AddLineF(line, "UserRecno : %u (%s)", wide->userno, WideUsername[0]);
line = AddLine(line, "");
AddLineF(line, "Message Base Record:");
line = AddLine(line, "");
AddLineF(line, "TotalMsgs : %lu", _base.totalmsgs);
AddLineF(line, "HighestMsg : %lu", _base.highestmsg);
AddLineF(line, "NextMsgno : %lu", _base.nextmsgno);
AddLineF(line, "HighWaterMark : %lu", _base.highwatermark);
AddLineF(line, "FirstFrame : %08lXh (%lu)", _base.firstframe, _base.firstframe);
AddLineF(line, "LastFrame : %08lXh (%lu)", _base.lastframe, _base.lastframe);
AddLineF(line, "FirstFreeFrame : %08lXh (%lu)", _base.firstfreeframe, _base.firstfreeframe);
AddLineF(line, "LastFreeFrame : %08lXh (%lu)", _base.lastfreeframe, _base.lastfreeframe);
AddLineF(line, "EndFrame : %08lXh (%lu)", _base.endframe, _base.endframe);
AddLineF(line, "Max/Skip/Days : %lu %lu %u", _base.maxmsgs, _base.protmsgs, _base.daystokeep);
AddLineF(line, "TotalMsgs : %u", _base.totalmsgs);
AddLineF(line, "HighestMsg : %u", _base.highestmsg);
AddLineF(line, "NextMsgno : %u", _base.nextmsgno);
AddLineF(line, "HighWaterMark : %u", _base.highwatermark);
AddLineF(line, "FirstFrame : %08Xh (%u)", _base.firstframe, _base.firstframe);
AddLineF(line, "LastFrame : %08Xh (%u)", _base.lastframe, _base.lastframe);
AddLineF(line, "FirstFreeFrame : %08Xh (%u)", _base.firstfreeframe, _base.firstfreeframe);
AddLineF(line, "LastFreeFrame : %08Xh (%u)", _base.lastfreeframe, _base.lastfreeframe);
AddLineF(line, "EndFrame : %08Xh (%u)", _base.endframe, _base.endframe);
AddLineF(line, "Max/Skip/Days : %u %u %u", _base.maxmsgs, _base.protmsgs, _base.daystokeep);
line = AddLine(line, "");
AddLineF(line, "Message Index Record:");
line = AddLine(line, "");
AddLineF(line, "FrameOffset : %08lXh (%lu)", _idx.offset, _idx.offset);
AddLineF(line, "MessageNumber : %08lXh (%lu)", _idx.msgno, _idx.msgno);
AddLineF(line, "HashValue : %08lXh (%lu)", _idx.hash, _idx.hash);
AddLineF(line, "FrameOffset : %08Xh (%u)", _idx.offset, _idx.offset);
AddLineF(line, "MessageNumber : %08Xh (%u)", _idx.msgno, _idx.msgno);
AddLineF(line, "HashValue : %08Xh (%u)", _idx.hash, _idx.hash);
line = AddLine(line, "");
AddLineF(line, "Message Frame Record:");
line = AddLine(line, "");
AddLineF(line, "Frame-ID : %08lXh%s", _frm.id, (_frm.id != SQFRAMEID) ? " (error, should be AFAE4453h!)" : "");
AddLineF(line, "ThisFrame : %08lXh (%lu)", _frame, _frame);
AddLineF(line, "PrevFrame : %08lXh (%lu)", _frm.prev, _frm.prev);
AddLineF(line, "NextFrame : %08lXh (%lu)", _frm.next, _frm.next);
AddLineF(line, "FrameLength : %lu", _frm.length);
AddLineF(line, "TotalLength : %lu", _frm.totsize);
AddLineF(line, "CtrlLength : %lu", _frm.ctlsize);
AddLineF(line, "Frame-ID : %08Xh%s", _frm.id, (_frm.id != SQFRAMEID) ? " (error, should be AFAE4453h!)" : "");
AddLineF(line, "ThisFrame : %08Xh (%u)", _frame, _frame);
AddLineF(line, "PrevFrame : %08Xh (%u)", _frm.prev, _frm.prev);
AddLineF(line, "NextFrame : %08Xh (%u)", _frm.next, _frm.next);
AddLineF(line, "FrameLength : %u", _frm.length);
AddLineF(line, "TotalLength : %u", _frm.totsize);
AddLineF(line, "CtrlLength : %u", _frm.ctlsize);
line = AddLine(line, "");
AddLineF(line, lng_head);
line = AddLine(line, "");

View File

@@ -49,8 +49,8 @@
// ------------------------------------------------------------------
// WildCat! 4.0 Magic Numbers
const long MagicHeaderActive = 0x001A1A1BL;
const long MagicHeaderInactive = 0x011A1A1BL;
const uint32_t MagicHeaderActive = 0x001A1A1Bu;
const uint32_t MagicHeaderInactive = 0x011A1A1Bu;
// ------------------------------------------------------------------
@@ -94,20 +94,20 @@ const word mfSent = 0x0800;
// WildCat! 4.0 Message Header
struct WCatHdr {
long magicnumber;
uint32_t magicnumber;
word msgno;
char from[71];
char fromtitle[11];
long fromuserid;
int32_t fromuserid;
char to[71];
char totitle[11];
long touserid;
int32_t touserid;
char subject[71];
char network[9];
word msgdate;
long msgtime;
int32_t msgtime;
word readdate;
long readtime;
int32_t readtime;
word mflags;
word reference;
Addr origaddr;
@@ -118,7 +118,7 @@ struct WCatHdr {
word prevunread;
word nextunread;
word fidoflags;
long cost;
int32_t cost;
byte reserved[20];
};
@@ -138,7 +138,7 @@ struct WCatBase {
struct WCatIdx {
word msgno;
long offset;
int32_t offset;
};

View File

@@ -51,7 +51,7 @@ void WCatArea::refresh() {
}
}
long ixnum = (filelength(data->fhix)-(long)sizeof(WCatBase)) / (long)sizeof(WCatIdx);
int32_t ixnum = (filelength(data->fhix)-sizeof(WCatBase)) / sizeof(WCatIdx);
// Are there any msgs?
if(ixnum) {
@@ -123,9 +123,9 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
isopen--;
}
register uint _active = 0;
register uint _lastread_reln = 0;
register ulong _lastreadfound = 0;
uint _active = 0;
uint _lastread_reln = 0;
uint _lastreadfound = 0;
if(data->base.active) {
@@ -134,12 +134,12 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
Msgn->Resize((uint)data->base.active);
// Variables for the loop
register ulong _msgno;
register ulong* _msgndxptr = Msgn->tag;
register WCatIdx* _ixptr = data->idx;
register dword _totalmsgs = data->base.active;
register ulong _firstmsgno = _totalmsgs ? _ixptr->msgno : 0;
register ulong _lastmsgno = 0;
uint _msgno;
uint32_t* _msgndxptr = Msgn->tag;
WCatIdx* _ixptr = data->idx;
uint _totalmsgs = data->base.active;
uint _firstmsgno = _totalmsgs ? _ixptr->msgno : 0;
uint _lastmsgno = 0;
// Fill message index
while(_active < _totalmsgs) {

View File

@@ -85,7 +85,7 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
// Convert date and time
struct tm _tm;
long _time;
int32_t _time;
unsigned _year, _month, _day, _hour, _minute, _second;
__msg->written = __msg->arrived = __msg->received = 0;
@@ -95,7 +95,7 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
_time = __hdr.msgtime-1;
_hour = (unsigned)(_time / 3600L);
_minute = (unsigned)((_time % 3600L) / 60L);
_second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*60L));
_second = (unsigned)(_time - ((_hour*3600L)+_minute*60L));
_tm.tm_year = _year - 1900;
_tm.tm_mon = _month - 1;
_tm.tm_mday = _day;
@@ -115,7 +115,7 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
_time = __hdr.readtime-1;
_hour = (unsigned)(_time / 3600L);
_minute = (unsigned)((_time % 3600L) / 60L);
_second = (unsigned)(_time - (((long)_hour*3600L)+(long)_minute*60L));
_second = (unsigned)(_time - ((_hour*3600L)+_minute*60L));
_tm.tm_year = _year - 1900;
_tm.tm_mon = _month - 1;
_tm.tm_mday = _day;

View File

@@ -121,13 +121,13 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
if(__msg->written) {
struct tm* _tm = gmtime(&__msg->written);
__hdr.msgdate = (word)(YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday)-1);
__hdr.msgtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1;
__hdr.msgtime = ((_tm->tm_hour*3600L)+(_tm->tm_min*60L)+_tm->tm_sec)+1;
}
if(__msg->received) {
struct tm* _tm = gmtime(&__msg->received);
__hdr.readdate = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readtime = (((long)_tm->tm_hour*3600L)+((long)_tm->tm_min*60L)+_tm->tm_sec)+1;
__hdr.readtime = ((_tm->tm_hour*3600L)+(_tm->tm_min*60L)+_tm->tm_sec)+1;
}
__hdr.mflags |= (word)(__msg->attr.pvt() ? mfPrivate : 0);
@@ -180,7 +180,7 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
char* _txt = NULL;
uint _reln = Msgn->ToReln(__msg->msgno)-1;
long _datstart = data->idx[_reln].offset;
int32_t _datstart = data->idx[_reln].offset;
if(__mode & GMSG_TXT) {
@@ -198,14 +198,14 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
if((__mode & GMSG_NEW) or (_size > __hdr.msgbytes)) {
if(_size > __hdr.msgbytes) {
ulong _magic = MagicHeaderInactive;
uint32_t _magic = MagicHeaderInactive;
lseekset(data->fhdat, data->idx[_reln].offset);
write(data->fhdat, &_magic, 4);
}
_datstart = filelength(data->fhdat);
data->idx[_reln].msgno = __hdr.msgno;
data->idx[_reln].offset = _datstart;
lseekset(data->fhix, sizeof(WCatBase)+((long)_reln*sizeof(WCatIdx)));
lseekset(data->fhix, sizeof(WCatBase)+(_reln*sizeof(WCatIdx)));
write(data->fhix, &data->idx[_reln], sizeof(WCatIdx));
}
__hdr.msgbytes = _size;

View File

@@ -67,18 +67,18 @@ Line* WCatArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "------------------------------------------------------------------------------");
line = AddLine(line, "");
AddLineF(line, "Path : %s", real_path());
AddLineF(line, "MagicNumber: %08lXh", _hdr.magicnumber);
AddLineF(line, "MagicNumber: %08Xh", _hdr.magicnumber);
AddLineF(line, "MsgNumber : %u", _hdr.msgno);
AddLineF(line, "Orig : %s", STRNP2C(_hdr.from));
AddLineF(line, "OrigTitle : %s", STRNP2C(_hdr.fromtitle));
AddLineF(line, "OrigUserID : %li", _hdr.fromuserid);
AddLineF(line, "OrigUserID : %i", _hdr.fromuserid);
AddLineF(line, "Dest : %s", STRNP2C(_hdr.to));
AddLineF(line, "DestTitle : %s", STRNP2C(_hdr.totitle));
AddLineF(line, "DestUserID : %li", _hdr.touserid);
AddLineF(line, "DestUserID : %i", _hdr.touserid);
AddLineF(line, "Subject : %s", STRNP2C(_hdr.subject));
AddLineF(line, "Network : %s", STRNP2C(_hdr.network));
AddLineF(line, "MsgTime : %s (%u, %li)", strftimei(buf, 100, "%d %b %y %H:%M:%S", gmtime(&msg->written)), _hdr.msgdate, _hdr.msgtime);
AddLineF(line, "ReadTime : %s (%u, %li)", strftimei(buf, 100, "%d %b %y %H:%M:%S", gmtime(&msg->received)), _hdr.readdate, _hdr.readtime);
AddLineF(line, "MsgTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", gmtime(&msg->written)), _hdr.msgdate, _hdr.msgtime);
AddLineF(line, "ReadTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", gmtime(&msg->received)), _hdr.readdate, _hdr.readtime);
AddLineF(line, "mFlags : %u (%04Xh)", _hdr.mflags, _hdr.mflags);
AddLineF(line, "Reference : %u", _hdr.reference);
AddLineF(line, "FidoFrom : %u:%u/%u.%u", _hdr.origaddr.zone, _hdr.origaddr.net, _hdr.origaddr.node, _hdr.origaddr.point);
@@ -89,7 +89,7 @@ Line* WCatArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "PrevUnread : %u", _hdr.prevunread);
AddLineF(line, "NextUnread : %u", _hdr.nextunread);
AddLineF(line, "FidoFlags : %u (%04Xh)", _hdr.fidoflags, _hdr.fidoflags);
AddLineF(line, "Cost : %li", _hdr.cost);
AddLineF(line, "Cost : %i", _hdr.cost);
AddLineF(line, "Reserved : %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X",
_hdr.reserved[0], _hdr.reserved[1], _hdr.reserved[2],
_hdr.reserved[3], _hdr.reserved[4], _hdr.reserved[5],

View File

@@ -102,21 +102,21 @@ struct XbbsHdr {
char subj[70]; // The subject of the message
char date[35]; // Date the message was written
char indate[4]; // Import date
ulong msgnum; // Current message number
ulong timesread; // Number of times the message has been read
time_t timerecv; // Time user received this message
ulong length; // Length of message stored in .Text Data file
long start; // Pointer to starting byte in .Text Data file
ulong extra1; // Extra space // Was going to be for reply
ulong extra2; // Extra space // linking instead came up with
ulong extra3; // Extra space // a better method
uint32_t msgnum; // Current message number
uint32_t timesread; // Number of times the message has been read
time32_t timerecv; // Time user received this message
uint32_t length; // Length of message stored in .Text Data file
int32_t start; // Pointer to starting byte in .Text Data file
uint32_t extra1; // Extra space // Was going to be for reply
uint32_t extra2; // Extra space // linking instead came up with
uint32_t extra3; // Extra space // a better method
Addr origaddr; // Messages origin
Addr destaddr; // Messages destination
ushort cost; // Cost to send this message
ushort fflags; // Fidonet related flags
ushort xflags; // XBBS related flags
ulong iflags; // Internet related flags
ulong oflags; // Other network related flags
uint32_t iflags; // Internet related flags
uint32_t oflags; // Other network related flags
};
@@ -127,10 +127,10 @@ struct XbbsIdx {
ushort to; // Checksum of the to field
ushort from; // Checksum of the from field
ushort subj; // Checksum of the subject field
ulong msgidcrc; // MSGID 32-bit CRC of address field (starting value 0xFFFFFFFF)
ulong msgidserialno; // MSGID Serial number field
ulong replycrc; // REPLY 32-bit CRC of address field (starting value 0xFFFFFFFF)
ulong replyserialno; // REPLY Serial number field
uint32_t msgidcrc; // MSGID 32-bit CRC of address field (starting value 0xFFFFFFFF)
uint32_t msgidserialno; // MSGID Serial number field
uint32_t replycrc; // REPLY 32-bit CRC of address field (starting value 0xFFFFFFFF)
uint32_t replyserialno; // REPLY Serial number field
};
@@ -138,8 +138,8 @@ struct XbbsIdx {
// AdeptXBBS Personal Mail Index
struct XbbsPmi {
long areanumber;
long msgnumber;
int32_t areanumber;
int32_t msgnumber;
char from[60];
char subject[70];
char date[20];
@@ -195,8 +195,8 @@ protected:
void refresh();
int load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr);
void lock_file(int handle, long position, long length);
void unlock_file(int handle, long position, long length);
void lock_file(int handle, int32_t position, int32_t length);
void unlock_file(int handle, int32_t position, int32_t length);
int test_open(const char* __file, int sharemode=-1);
void save_lastread();

View File

@@ -224,9 +224,9 @@ void XbbsArea::save_lastread() {
int _fh = ::sopen(AddPath(real_path(), ".lmr"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
if(_fh != -1) {
ulong _lastread = Msgn->CvtReln(lastread);
lseekset(_fh, wide->userno+1, sizeof(ulong));
write(_fh, &_lastread, sizeof(ulong));
uint32_t _lastread = Msgn->CvtReln(lastread);
lseekset(_fh, wide->userno+1, sizeof(uint32_t));
write(_fh, &_lastread, sizeof(uint32_t));
::close(_fh);
}

View File

@@ -35,7 +35,7 @@ void XbbsArea::refresh() {
GFTRK("XbbsRefresh");
long indexnum = filelength(data->fhindex) / (long)sizeof(XbbsIdx);
int32_t indexnum = filelength(data->fhindex) / sizeof(XbbsIdx);
// Are there any msgs?
if(indexnum) {
@@ -76,11 +76,11 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
}
// Load the lastread
ulong _lastread = 0;
uint32_t _lastread = 0;
int _fh = ::sopen(AddPath(real_path(), ".lmr"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
if(_fh != -1) {
lseekset(_fh, wide->userno+1, sizeof(ulong));
read(_fh, &_lastread, sizeof(ulong));
lseekset(_fh, wide->userno+1, sizeof(uint32_t));
read(_fh, &_lastread, sizeof(uint32_t));
::close(_fh);
}
@@ -107,9 +107,9 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
isopen--;
}
register uint _active = 0;
register uint _lastread_reln = 0;
register ulong _lastreadfound = 0;
uint _active = 0;
uint _lastread_reln = 0;
uint _lastreadfound = 0;
if(data->idx_size) {
@@ -118,11 +118,11 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
Msgn->Resize(data->idx_size);
// Variables for the loop
register ulong _msgno;
register ulong* _msgndxptr = Msgn->tag;
register dword _totalmsgs = data->idx_size;
register ulong _firstmsgno = _totalmsgs ? 1 : 0;
register ulong _lastmsgno = 0;
uint _msgno;
uint32_t* _msgndxptr = Msgn->tag;
uint _totalmsgs = data->idx_size;
uint _firstmsgno = _totalmsgs ? 1 : 0;
uint _lastmsgno = 0;
// Fill message index
while(_active < _totalmsgs) {

View File

@@ -44,7 +44,7 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
// Load the message header
memset(&__hdr, 0, sizeof(XbbsHdr));
lseekset(_fhdata, (long)(_reln-1)*(long)sizeof(XbbsHdr));
lseekset(_fhdata, (_reln-1)*sizeof(XbbsHdr));
read(_fhdata, &__hdr, sizeof(XbbsHdr));
// Convert header

View File

@@ -55,7 +55,7 @@ void XbbsArea::unlock() {
// ------------------------------------------------------------------
void XbbsArea::lock_file(int handle, long position, long length) {
void XbbsArea::lock_file(int handle, int32_t position, int32_t length) {
GFTRK("XbbsLockFile");
@@ -89,7 +89,7 @@ void XbbsArea::lock_file(int handle, long position, long length) {
// ------------------------------------------------------------------
void XbbsArea::unlock_file(int handle, long position, long length) {
void XbbsArea::unlock_file(int handle, int32_t position, int32_t length) {
GFTRK("XbbsUnlockFile");
@@ -222,7 +222,7 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
}
// Write header record
long position = (__msg->msgno-1L)*(long)sizeof(XbbsHdr);
int32_t position = (__msg->msgno-1L)*sizeof(XbbsHdr);
lseekset(data->fhdata, position);
lock_file(data->fhdata, position, sizeof(XbbsHdr));
write(data->fhdata, &__hdr, sizeof(XbbsHdr));
@@ -256,7 +256,7 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
}
}
memcpy(data->idx+__msg->msgno-1, &idx, sizeof(XbbsIdx));
position = (__msg->msgno-1L)*(long)sizeof(XbbsIdx);
position = (__msg->msgno-1L)*sizeof(XbbsIdx);
lseekset(data->fhindex, position);
lock_file(data->fhindex, position, sizeof(XbbsIdx));
write(data->fhindex, &idx, sizeof(XbbsIdx));
@@ -399,7 +399,7 @@ void XbbsArea::update_timesread(gmsg* msg) {
XbbsHdr hdr;
long position = (Msgn->ToReln(msg->msgno)-1)*(long)sizeof(XbbsHdr);
int32_t position = (Msgn->ToReln(msg->msgno)-1)*sizeof(XbbsHdr);
::lseekset(data->fhdata, position);
::read(data->fhdata, &hdr, sizeof(XbbsHdr));

View File

@@ -82,29 +82,29 @@ Line* XbbsArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "Subj : %s", hdr.subj);
AddLineF(line, "Date : %s", hdr.date);
AddLineF(line, "InDate : %u-%u-%u", hdr.indate[0]+1989, hdr.indate[1], hdr.indate[2]);
AddLineF(line, "MsgNum : %lu", hdr.msgnum);
AddLineF(line, "TimesRead : %lu", hdr.timesread);
AddLineF(line, "TimeRecv : %s (%08lXh)", TimeToStr(buf, hdr.timerecv), (long)hdr.timerecv);
AddLineF(line, "Length : %lu", hdr.length);
AddLineF(line, "Start : %lu", hdr.start);
AddLineF(line, "Extra1,2,3 : %lu, %lu, %lu", hdr.extra1, hdr.extra2, hdr.extra3);
AddLineF(line, "MsgNum : %u", hdr.msgnum);
AddLineF(line, "TimesRead : %u", hdr.timesread);
AddLineF(line, "TimeRecv : %s (%08Xh)", TimeToStr(buf, hdr.timerecv), (int32_t)hdr.timerecv);
AddLineF(line, "Length : %u", hdr.length);
AddLineF(line, "Start : %u", hdr.start);
AddLineF(line, "Extra1,2,3 : %u, %u, %u", hdr.extra1, hdr.extra2, hdr.extra3);
AddLineF(line, "OrigAddr : %u:%u/%u.%u", hdr.origaddr.zone, hdr.origaddr.net, hdr.origaddr.node, hdr.origaddr.point);
AddLineF(line, "DestAddr : %u:%u/%u.%u", hdr.origaddr.zone, hdr.destaddr.net, hdr.destaddr.node, hdr.destaddr.point);
AddLineF(line, "Cost : %u", hdr.cost);
AddLineF(line, "FFlags : %u (%04Xh)", hdr.fflags, hdr.fflags);
AddLineF(line, "XFlags : %u (%04Xh)", hdr.xflags, hdr.xflags);
AddLineF(line, "IFlags : %lu (%08lXh)", hdr.iflags, hdr.iflags);
AddLineF(line, "OFlags : %lu (%08lXh)", hdr.oflags, hdr.oflags);
AddLineF(line, "IFlags : %u (%08Xh)", hdr.iflags, hdr.iflags);
AddLineF(line, "OFlags : %u (%08Xh)", hdr.oflags, hdr.oflags);
line = AddLine(line, "");
AddLineF(line, "Index Record:");
line = AddLine(line, "");
AddLineF(line, "CheckSumTo : %04Xh (%u)", idx->to, idx->to);
AddLineF(line, "CheckSumFrom : %04Xh (%u)", idx->from, idx->from);
AddLineF(line, "CheckSumSubj : %04Xh (%u)", idx->subj, idx->subj);
AddLineF(line, "MsgidCrc : %08lXh (%lu)", idx->msgidcrc, idx->msgidcrc);
AddLineF(line, "MsgidSerialNo : %08lXh (%lu)", idx->msgidserialno, idx->msgidserialno);
AddLineF(line, "ReplyidCrc : %08lXh (%lu)", idx->replycrc, idx->replycrc);
AddLineF(line, "ReplyidSerialNo : %08lXh (%lu)", idx->replyserialno, idx->replyserialno);
AddLineF(line, "MsgidCrc : %08Xh (%u)", idx->msgidcrc, idx->msgidcrc);
AddLineF(line, "MsgidSerialNo : %08Xh (%u)", idx->msgidserialno, idx->msgidserialno);
AddLineF(line, "ReplyidCrc : %08Xh (%u)", idx->replycrc, idx->replycrc);
AddLineF(line, "ReplyidSerialNo : %08Xh (%u)", idx->replyserialno, idx->replyserialno);
line = AddLine(line, "");
AddLineF(line, lng_head);
line = AddLine(line, "");