64 bit platforms support
This commit is contained in:
parent
7345cbfdf2
commit
0885946b30
@ -10,6 +10,7 @@ ______________________________________________________________________
|
||||
Notes for GoldED+ 1.1.5, /snapshot/
|
||||
______________________________________________________________________
|
||||
|
||||
! Golded+ now may be compiled on 64bit platforms.
|
||||
|
||||
+ Fix P4 and IA64 cpu detection.
|
||||
|
||||
|
@ -38,7 +38,7 @@ extern int _use_fwd;
|
||||
|
||||
void Area::DeleteMsg(GMsg* msg, int direction) {
|
||||
|
||||
ulong replyto=0, reply1st=0, lread;
|
||||
uint32_t replyto=0, reply1st=0, lread;
|
||||
|
||||
GMsg* uplink = (GMsg*)throw_calloc(1, sizeof(GMsg));
|
||||
GMsg* downlink = (GMsg*)throw_calloc(1, sizeof(GMsg));
|
||||
@ -173,7 +173,7 @@ void Area::DelMsgs(GMsg* msg) {
|
||||
}
|
||||
update_statuslinef(LNG->DeletingMsg, x+1, Mark.Count());
|
||||
w_progress(MODE_UPDATE, C_INFOW, x+1, Mark.Count(), LNG->Deleting);
|
||||
ulong msgno = Mark[x];
|
||||
uint msgno = Mark[x];
|
||||
if(Msgn.ToReln(msgno)) {
|
||||
if(LoadHdr(msg, msgno, false)) {
|
||||
bool deletethis = false;
|
||||
@ -399,8 +399,8 @@ void CmfMsgs(GMsg* msg) {
|
||||
// Setup some variables for the loop
|
||||
Area* AAorig = AA;
|
||||
const char* echoid = AAdest->echoid();
|
||||
ulong loadmsgno = msg->msgno;
|
||||
ulong* mrkp = AA->Mark.tag;
|
||||
uint loadmsgno = msg->msgno;
|
||||
uint32_t* mrkp = AA->Mark.tag;
|
||||
int mrks = AA->Mark.Count();
|
||||
int mrk = 0;
|
||||
|
||||
@ -422,7 +422,7 @@ void CmfMsgs(GMsg* msg) {
|
||||
}
|
||||
|
||||
int mode = 0;
|
||||
ulong msgno = 0;
|
||||
uint msgno = 0;
|
||||
if(AA->LoadMsg(msg, loadmsgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar), loadmode)) {
|
||||
|
||||
// Handle unsent msgs
|
||||
@ -591,7 +591,7 @@ void CmfMsgs(GMsg* msg) {
|
||||
|
||||
void CopyMoveForward() {
|
||||
|
||||
ulong lastread = reader_msg->msgno;
|
||||
uint lastread = reader_msg->msgno;
|
||||
|
||||
AA->set_lastread(AA->Msgn.ToReln(lastread, AA->lastread()));
|
||||
|
||||
|
@ -79,7 +79,7 @@ char* CvtMessageIDtoMSGID(const char* mptr, char* msgidbuf, const char* echoid,
|
||||
}
|
||||
if(spaces)
|
||||
*bptr++ = '\"';
|
||||
sprintf(bptr, " %08lx", crc32);
|
||||
sprintf(bptr, " %08x", crc32);
|
||||
}
|
||||
|
||||
return msgidbuf;
|
||||
|
@ -748,7 +748,7 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
ptr--;
|
||||
}
|
||||
}
|
||||
x = (int)((dword)ptr-(dword)qbuf);
|
||||
x = (int)((long)ptr-(long)qbuf);
|
||||
sprintf(buf, "%*.*s%*.*s>%s %s",
|
||||
y, y, quotestr, x, x, qbuf, qbuf+x, quote
|
||||
);
|
||||
|
@ -153,7 +153,7 @@ void GMsgHeaderView::Paint() {
|
||||
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
|
||||
ulong replyto, replynext;
|
||||
if(CFG->switches.get(disprealmsgno)) {
|
||||
ptr += sprintf(ptr, " %-5.5s: #%lu [%u]", LNG->Msg, msg->msgno, area->Msgn.Count()+(msg->attr.nwm() ? 1 : 0));
|
||||
ptr += sprintf(ptr, " %-5.5s: #%u [%u]", LNG->Msg, msg->msgno, area->Msgn.Count()+(msg->attr.nwm() ? 1 : 0));
|
||||
replyto = msg->link.to();
|
||||
replies[0] = msg->link.first();
|
||||
replynext = msg->link.next();
|
||||
|
@ -296,18 +296,18 @@ void Area::SaveMsg(int mode, GMsg* msg) {
|
||||
Path p;
|
||||
|
||||
sprintf(file, "%s%smail.jam", CFG->jampath, isecho() ? "echo" : "net");
|
||||
sprintf(line, "%s %lu", ReMapPath(strcpy(p, path())), msg->msgno);
|
||||
sprintf(line, "%s %u", ReMapPath(strcpy(p, path())), msg->msgno);
|
||||
WriteNoDupes(file, line);
|
||||
}
|
||||
if(isqwk()) {
|
||||
strcpy(file, AddPath(CFG->goldpath, "goldqwk.lst"));
|
||||
sprintf(line, "%s %lu", echoid(), msg->msgno);
|
||||
sprintf(line, "%s %u", echoid(), msg->msgno);
|
||||
WriteNoDupes(file, line);
|
||||
|
||||
}
|
||||
else if(isinternet()) {
|
||||
strcpy(file, AddPath(CFG->goldpath, "goldsoup.lst"));
|
||||
sprintf(line, "%s %lu", echoid(), msg->msgno);
|
||||
sprintf(line, "%s %u", echoid(), msg->msgno);
|
||||
WriteNoDupes(file, line);
|
||||
}
|
||||
else {
|
||||
|
@ -98,7 +98,7 @@ void __gftrk_track(const char* text) {
|
||||
if(__gftrk_statusline)
|
||||
update_statusline(text);
|
||||
if(cmdlinedebughg)
|
||||
LOG.printf("- %08lu %*s%s", __gftrk_ptr->tick, __gftrk_ptr->indent*2, "", __gftrk_ptr->text);
|
||||
LOG.printf("- %08u %*s%s", __gftrk_ptr->tick, __gftrk_ptr->indent*2, "", __gftrk_ptr->text);
|
||||
}
|
||||
__gftrk_curr = (++__gftrk_curr) % __gftrk_max;
|
||||
}
|
||||
@ -128,7 +128,7 @@ void __gftrk_log() {
|
||||
LOG.printf("! Function track dump follows:");
|
||||
_first = false;
|
||||
}
|
||||
LOG.printf("- %08lu %*s%s", _ptr->tick, _ptr->indent*2, "", _ptr->text);
|
||||
LOG.printf("- %08u %*s%s", _ptr->tick, _ptr->indent*2, "", _ptr->text);
|
||||
}
|
||||
_count++;
|
||||
_curr--;
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <gcmpall.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Disable some MS Visual C warnings
|
||||
@ -106,13 +107,16 @@ typedef unsigned char uchar;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned char byte;
|
||||
typedef signed char sbyte;
|
||||
typedef unsigned short word;
|
||||
typedef signed short sword;
|
||||
typedef unsigned long dword;
|
||||
typedef signed long sdword;
|
||||
|
||||
typedef unsigned char bit;
|
||||
typedef uint8_t byte;
|
||||
typedef int8_t sbyte;
|
||||
typedef uint16_t word;
|
||||
typedef int16_t sword;
|
||||
typedef uint32_t dword;
|
||||
typedef int32_t sdword;
|
||||
|
||||
typedef uint32_t time32_t; /* 32-bit time_t type */
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Common function-pointer types
|
||||
|
@ -123,7 +123,7 @@ extern const char* gmonths[];
|
||||
// ------------------------------------------------------------------
|
||||
// Prototypes
|
||||
|
||||
#ifdef __WIN32__
|
||||
#if defined(__WIN32__) && MAXINT > 0x0FFFFFFF // 64-bit
|
||||
extern struct tm dummy_struct_tm;
|
||||
inline struct tm* ggmtime(time_t* arg) {
|
||||
struct tm* a = gmtime(arg);
|
||||
@ -172,6 +172,10 @@ char* TimeToStr(char* buf, time_t t);
|
||||
long YMD2JDN(unsigned yr, unsigned mo, unsigned day) __attribute__ ((const));
|
||||
void JDN2YMD(long scalar, unsigned *yr, unsigned *mo, unsigned *day);
|
||||
|
||||
inline struct tm *gmtime(const time32_t *timep) {
|
||||
const time_t temp(*timep);
|
||||
return gmtime(&temp);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
|
@ -108,67 +108,67 @@ struct XbbsUsers {
|
||||
char bus_phone[21]; // Users business/office number
|
||||
char interests[78]; // Interest Line
|
||||
char SysOpComment[78]; // Room for Sysops comment
|
||||
ushort banktime; // Time in the bank
|
||||
ushort computer_type; // Computer type
|
||||
long userid; // User ID
|
||||
short pointid; // Point Mail ID
|
||||
time_t initial_logon; // Time/Date of initial logon
|
||||
time_t expires; // Time/Date user expires
|
||||
time_t last_logon; // Time/Date of last logon
|
||||
time_t logon_today; // Last time the user logged on today
|
||||
short birthyear; // Birth Year
|
||||
uint16_t banktime; // Time in the bank
|
||||
uint16_t computer_type; // Computer type
|
||||
int32_t userid; // User ID
|
||||
int16_t pointid; // Point Mail ID
|
||||
time32_t initial_logon; // Time/Date of initial logon
|
||||
time32_t expires; // Time/Date user expires
|
||||
time32_t last_logon; // Time/Date of last logon
|
||||
time32_t logon_today; // Last time the user logged on today
|
||||
int16_t birthyear; // Birth Year
|
||||
char birthmonth; // Birth Month
|
||||
char birthday; // Birth day
|
||||
char gender; // Gender
|
||||
long credit; // User credit
|
||||
long minlimit; // Minimum limit
|
||||
long group; // Group number the user belongs to
|
||||
long currlastread; // Last read pointer for current area
|
||||
long time_today; // Number of minutes user used today
|
||||
long time_per_day; // Time limit per day
|
||||
long time_per_call; // Time limit per call
|
||||
long numcalls; // Number of total calls user made to BBS
|
||||
long ulnum; // Total number of uploads
|
||||
long dlnum; // Total number of downloads
|
||||
long ulk; // Total uploads in K-bytes
|
||||
long dlk; // Total downloads in K-bytes
|
||||
long uktoday; // Uploads in K-bytes made today
|
||||
long dktoday; // Download in k-bytes made today
|
||||
long ukperday; // Max k-bytes user can upload a day
|
||||
long dkperday; // Max k-byes a user can download a day
|
||||
long numposts; // Number of messages ever written
|
||||
long security1; // Security level #1
|
||||
long security2; // Security level #2
|
||||
long flags1; // Sysop definable 32 flags
|
||||
long flags2; // Sysop definable 32 flags
|
||||
long attribs; // User attributes
|
||||
long attribs2; // User attributes
|
||||
short length; // Screen length
|
||||
short width; // Screen width
|
||||
short lastmsgarea; // Last message area user was in
|
||||
short lastfilearea; // Last file area user was in
|
||||
int32_t credit; // User credit
|
||||
int32_t minlimit; // Minimum limit
|
||||
int32_t group; // Group number the user beint32_ts to
|
||||
int32_t currlastread; // Last read pointer for current area
|
||||
int32_t time32_today; // Number of minutes user used today
|
||||
int32_t time_per_day; // Time limit per day
|
||||
int32_t time_per_call; // Time limit per call
|
||||
int32_t numcalls; // Number of total calls user made to BBS
|
||||
int32_t ulnum; // Total number of uploads
|
||||
int32_t dlnum; // Total number of downloads
|
||||
int32_t ulk; // Total uploads in K-bytes
|
||||
int32_t dlk; // Total downloads in K-bytes
|
||||
int32_t uktoday; // Uploads in K-bytes made today
|
||||
int32_t dktoday; // Download in k-bytes made today
|
||||
int32_t ukperday; // Max k-bytes user can upload a day
|
||||
int32_t dkperday; // Max k-byes a user can download a day
|
||||
int32_t numposts; // Number of messages ever written
|
||||
int32_t security1; // Security level #1
|
||||
int32_t security2; // Security level #2
|
||||
int32_t flags1; // Sysop definable 32 flags
|
||||
int32_t flags2; // Sysop definable 32 flags
|
||||
int32_t attribs; // User attributes
|
||||
int32_t attribs2; // User attributes
|
||||
int16_t length; // Screen length
|
||||
int16_t width; // Screen width
|
||||
int16_t lastmsgarea; // Last message area user was in
|
||||
int16_t lastfilearea; // Last file area user was in
|
||||
char lastprotocol; // Last protocol user chose
|
||||
char lastarchiver; // Last archiver user chose
|
||||
long forsysop; // unused
|
||||
int32_t forsysop; // unused
|
||||
char interface_; // obsolete
|
||||
char exp; // unused
|
||||
short leech_percent; // File leech ratio
|
||||
short maxbanktime; // Maximum time user can have in bank
|
||||
short timecredit; // Current time user has credit for
|
||||
short callstoday; // Number of calls user made to BBS today
|
||||
long totalminsever; // Total minutes users has used ever
|
||||
long netmaildebits; // Total spent on NetMail
|
||||
time_t lastpwchange; // Time/Date of last password change
|
||||
time_t lastlistednewfile; // Time/Date user last listed new files
|
||||
ulong filekcredit; // Amount of file k-byte credit user has
|
||||
int16_t leech_percent; // File leech ratio
|
||||
int16_t maxbanktime; // Maximum time user can have in bank
|
||||
int16_t timecredit; // Current time user has credit for
|
||||
int16_t callstoday; // Number of calls user made to BBS today
|
||||
int32_t totalminsever; // Total minutes users has used ever
|
||||
int32_t netmaildebits; // Total spent on NetMail
|
||||
time32_t lastpwchange; // Time/Date of last password change
|
||||
time32_t lastlistednewfile; // Time/Date user last listed new files
|
||||
uint32_t filekcredit; // Amount of file k-byte credit user has
|
||||
char unixid[8]; // Users Unix Specific ID
|
||||
byte _unused[94]; // reserved for future use
|
||||
byte mailtags[128]; // Message areas tagged for off-line mail
|
||||
byte usermsg[128]; // Message areas user can access
|
||||
byte userfile[128]; // File areas user can access
|
||||
ulong passwordcrc; // User password CRC
|
||||
ulong passwordcrc2; // User password CRC2
|
||||
ushort max_mail_pkt; // Max msgs to pack for off-line mail
|
||||
uint32_t passwordcrc; // User password CRC
|
||||
uint32_t passwordcrc2; // User password CRC2
|
||||
uint16_t max_mail_pkt; // Max msgs to pack for off-line mail
|
||||
char reasked; // Has user answered the ReAsk questionairre
|
||||
char reserved[75]; // reserved for future user
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ inline int atox(const char* s) { return (int)atoulx(s); }
|
||||
char* ltob(char* dst, ulong value, int fill=32);
|
||||
|
||||
int GetYesno(const char* value);
|
||||
int Pct(dword x, dword y);
|
||||
int Pct(ulong x, ulong y);
|
||||
int tabstop(int col, int tabwidth);
|
||||
|
||||
char* ggetosstring();
|
||||
@ -57,7 +57,7 @@ char* ggetosstring();
|
||||
dword B2L(dword b);
|
||||
dword L2B(dword l);
|
||||
|
||||
inline void SwapWord32(long* dw) { *dw = (long)(((dword)(*dw) << 16) | ((dword)(*dw) >> 16)); }
|
||||
inline void SwapWord32(uint32_t* dw) { *dw = ((*dw) << 16) | ((*dw) >> 16); }
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@ -66,7 +66,7 @@ void GTag::Reset() {
|
||||
// Resize tag array.
|
||||
// Returns NULL if realloc failed.
|
||||
|
||||
ulong* GTag::Resize(uint __tags) {
|
||||
uint32_t* GTag::Resize(uint __tags) {
|
||||
|
||||
register uint newsize = 0;
|
||||
|
||||
@ -78,7 +78,7 @@ ulong* GTag::Resize(uint __tags) {
|
||||
}
|
||||
|
||||
if(newsize) {
|
||||
tag = (ulong*)throw_realloc(tag, newsize*sizeof(ulong));
|
||||
tag = (uint32_t*)throw_realloc(tag, newsize*sizeof(uint32_t));
|
||||
allocated = newsize;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ ulong* GTag::Resize(uint __tags) {
|
||||
// Appends a new tag number to the end of the tag array.
|
||||
// NOTE - Does not check for duplicates or correct sequence!
|
||||
|
||||
ulong* GTag::Append(ulong __tagn) {
|
||||
uint32_t* GTag::Append(uint32_t __tagn) {
|
||||
|
||||
Resize(tags+1);
|
||||
tag[tags-1] = __tagn;
|
||||
@ -125,7 +125,7 @@ ulong* GTag::Append(ulong __tagn) {
|
||||
//
|
||||
// Dry test result: Works!
|
||||
|
||||
ulong* GTag::Add(ulong __tagn) {
|
||||
uint32_t* GTag::Add(uint32_t __tagn) {
|
||||
|
||||
// Find closest tag number
|
||||
uint _reln = ToReln(__tagn, TAGN_CLOSEST);
|
||||
@ -147,7 +147,7 @@ ulong* GTag::Add(ulong __tagn) {
|
||||
_reln--;
|
||||
|
||||
// Move data to make room for the new tag number
|
||||
memmove(tag+_reln+1, tag+_reln, (tags-_reln-1)*sizeof(ulong));
|
||||
memmove(tag+_reln+1, tag+_reln, (tags-_reln-1)*sizeof(uint32_t));
|
||||
|
||||
// Copy the new tag number to the insert position
|
||||
tag[_reln] = __tagn;
|
||||
@ -162,7 +162,7 @@ ulong* GTag::Add(ulong __tagn) {
|
||||
// Returns the relative tag number or RELN_INVALID if missing.
|
||||
// NOTE - Does not resize the array.
|
||||
|
||||
uint GTag::Del(ulong __tagn) {
|
||||
uint GTag::Del(uint32_t __tagn) {
|
||||
|
||||
return DelReln(ToReln(__tagn));
|
||||
}
|
||||
@ -173,7 +173,7 @@ uint GTag::Del(ulong __tagn) {
|
||||
uint GTag::DelReln(uint __reln) {
|
||||
|
||||
if(__reln) {
|
||||
memmove(tag+__reln-1, tag+__reln, (tags-__reln)*sizeof(ulong));
|
||||
memmove(tag+__reln-1, tag+__reln, (tags-__reln)*sizeof(uint32_t));
|
||||
count--;
|
||||
tags--;
|
||||
}
|
||||
@ -183,7 +183,7 @@ uint GTag::DelReln(uint __reln) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
uint GTag::DelResize(ulong __tagn) {
|
||||
uint GTag::DelResize(uint32_t __tagn) {
|
||||
|
||||
uint _reln = Del(__tagn);
|
||||
Resize(tags);
|
||||
@ -193,7 +193,7 @@ uint GTag::DelResize(ulong __tagn) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
static int TagnCmp(const ulong* __a, const ulong* __b) {
|
||||
static int TagnCmp(const uint32_t* __a, const uint32_t* __b) {
|
||||
|
||||
return CmpV(*__a, *__b);
|
||||
}
|
||||
@ -203,7 +203,7 @@ static int TagnCmp(const ulong* __a, const ulong* __b) {
|
||||
|
||||
void GTag::Sort() {
|
||||
|
||||
qsort(tag, tags, sizeof(ulong), (StdCmpCP)TagnCmp);
|
||||
qsort(tag, tags, sizeof(uint32_t), (StdCmpCP)TagnCmp);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@ -212,10 +212,10 @@ void GTag::ElimDups() {
|
||||
|
||||
if(tags > 1) {
|
||||
uint _before = tags;
|
||||
ulong _last = tag[0];
|
||||
uint32_t _last = tag[0];
|
||||
for(uint n=1; n<tags; n++) {
|
||||
if(_last == tag[n]) {
|
||||
memmove(&tag[n-1], &tag[n], (tags-n)*sizeof(ulong));
|
||||
memmove(&tag[n-1], &tag[n], (tags-n)*sizeof(uint32_t));
|
||||
tags--;
|
||||
n--;
|
||||
}
|
||||
@ -231,7 +231,7 @@ void GTag::ElimDups() {
|
||||
// Return the tag number corresponding to a relative tag number.
|
||||
// Returns TAGN_INVALID, if the requested number did not exist.
|
||||
|
||||
ulong GTag::CvtReln(uint __reln) {
|
||||
uint32_t GTag::CvtReln(uint __reln) {
|
||||
|
||||
if(tag and __reln and (__reln <= tags))
|
||||
return tag[__reln-1];
|
||||
@ -246,7 +246,7 @@ ulong GTag::CvtReln(uint __reln) {
|
||||
// If __closest is true, the closest smaller tag number is returned.
|
||||
// If no tags exist at all, RELN_INVALID is returned.
|
||||
|
||||
uint GTag::ToReln(ulong __tagn, int __closest) {
|
||||
uint GTag::ToReln(uint32_t __tagn, int __closest) {
|
||||
|
||||
uint _lastreln = RELN_INVALID;
|
||||
|
||||
@ -258,9 +258,9 @@ uint GTag::ToReln(ulong __tagn, int __closest) {
|
||||
|
||||
if(tags and __tagn) {
|
||||
|
||||
register long _mid;
|
||||
register long _left = 0;
|
||||
register long _right = tags;
|
||||
int _mid;
|
||||
int _left = 0;
|
||||
int _right = tags;
|
||||
|
||||
do {
|
||||
_mid = (_left+_right)/2;
|
||||
@ -285,7 +285,7 @@ uint GTag::ToReln(ulong __tagn, int __closest) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
uint GTag::ToReln(ulong __tagn) {
|
||||
uint GTag::ToReln(uint32_t __tagn) {
|
||||
|
||||
return ToReln(__tagn, TAGN_EXACT);
|
||||
}
|
||||
@ -301,7 +301,7 @@ void GTag::Load(gfile& fp) {
|
||||
count = (uint) val;
|
||||
if(count) {
|
||||
Resize(count);
|
||||
fp.fread(tag, sizeof(ulong), count);
|
||||
fp.fread(tag, sizeof(uint32_t), count);
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ void GTag::Save(gfile& fp) {
|
||||
fp.fwrite(&val, sizeof(dword));
|
||||
|
||||
if(tag and count)
|
||||
fp.fwrite(tag, sizeof(ulong), count);
|
||||
fp.fwrite(tag, sizeof(uint32_t), count);
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,10 +37,10 @@
|
||||
// ------------------------------------------------------------------
|
||||
// Constants
|
||||
|
||||
const ulong TAGN_INVALID = 0;
|
||||
const uint32_t TAGN_INVALID = 0;
|
||||
const uint RELN_INVALID = 0;
|
||||
|
||||
const ulong TAGN_MAX = ((ulong)-1);
|
||||
const uint32_t TAGN_MAX = ((uint32_t)-1);
|
||||
const uint RELN_MAX = ((uint)-1);
|
||||
|
||||
const int TAGN_CLOSEST = true;
|
||||
@ -57,7 +57,7 @@ public:
|
||||
// ----------------------------------------------------------------
|
||||
// Internal data
|
||||
|
||||
ulong* tag; // tag array
|
||||
uint32_t* tag; // tag array
|
||||
uint tags; // tags in array
|
||||
uint count; // fake tags count
|
||||
uint allocated; // actual allocated tags
|
||||
@ -75,31 +75,31 @@ public:
|
||||
void Reset();
|
||||
void ResetAll() { Reset(); count = 0; }
|
||||
|
||||
ulong* Resize(uint __tags);
|
||||
uint32_t* Resize(uint __tags);
|
||||
|
||||
ulong* Append(ulong __tagn);
|
||||
ulong* Add(ulong __tagn);
|
||||
uint Del(ulong __tagn);
|
||||
uint32_t* Append(uint32_t __tagn);
|
||||
uint32_t* Add(uint32_t __tagn);
|
||||
uint Del(uint32_t __tagn);
|
||||
uint DelReln(uint __reln);
|
||||
uint DelResize(ulong __tagn);
|
||||
uint DelResize(uint32_t __tagn);
|
||||
void Sort();
|
||||
void ElimDups();
|
||||
|
||||
ulong CvtReln(uint __reln);
|
||||
uint ToReln(ulong __tagn);
|
||||
uint ToReln(ulong __tagn, int __closest);
|
||||
uint32_t CvtReln(uint __reln);
|
||||
uint ToReln(uint32_t __tagn);
|
||||
uint ToReln(uint32_t __tagn, int __closest);
|
||||
|
||||
uint Find(ulong __tagn) { return ToReln(__tagn); }
|
||||
uint Find(uint32_t __tagn) { return ToReln(__tagn); }
|
||||
|
||||
uint Tags() const { return tags; }
|
||||
uint Count() const { return count; }
|
||||
uint SetCount(uint n) { tags = count = n; return count; }
|
||||
|
||||
void Set(uint n, ulong t) { tag[n] = t; }
|
||||
ulong Get(uint n) { return (tags and (n<tags)) ? tag[n] : TAGN_INVALID; }
|
||||
void Set(uint n, uint32_t t) { tag[n] = t; }
|
||||
uint32_t Get(uint n) { return (tags and (n<tags)) ? tag[n] : TAGN_INVALID; }
|
||||
|
||||
ulong& operator[](uint n) { return tag[n]; }
|
||||
ulong& at(uint n) { return tag[n]; }
|
||||
uint32_t& operator[](uint n) { return tag[n]; }
|
||||
uint32_t& at(uint n) { return tag[n]; }
|
||||
|
||||
void Load(gfile& fp);
|
||||
void Save(gfile& fp);
|
||||
|
@ -173,12 +173,6 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
|
||||
/********************************************************/
|
||||
/* Types */
|
||||
/********************************************************/
|
||||
#if 1
|
||||
typedef unsigned char bit;
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word; /* normal int = 16 bit */
|
||||
typedef unsigned long dword;
|
||||
#endif
|
||||
|
||||
enum ARCers { ARC_Unknown = -1, ARC_SeaArc, ARC_PkArc, ARC_Pak,
|
||||
ARC_ArcPlus, ARC_Zoo, ARC_PkZip, ARC_Lha, ARC_Arj,
|
||||
|
@ -182,11 +182,6 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
|
||||
/********************************************************/
|
||||
/* Types */
|
||||
/********************************************************/
|
||||
#if 1
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word; /* normal int = 16 bit */
|
||||
typedef unsigned long dword;
|
||||
#endif
|
||||
|
||||
enum ARCers { ARC_Unknown = -1, ARC_SeaArc, ARC_PkArc, ARC_Pak,
|
||||
ARC_ArcPlus, ARC_Zoo, ARC_PkZip, ARC_Lha, ARC_Arj,
|
||||
|
@ -51,10 +51,6 @@
|
||||
#define STRUCT_MIN_VERSION 01
|
||||
#define IM_PRD_CODE 0x4B
|
||||
|
||||
// Data type definitions
|
||||
|
||||
typedef unsigned char bit;
|
||||
|
||||
// Internal limits
|
||||
|
||||
#define MAXAKAS 16 /* Max # of addresses */
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -93,8 +93,8 @@ struct EzycHdr {
|
||||
word replyto;
|
||||
word reply1st;
|
||||
|
||||
ulong startposition;
|
||||
ulong messagelength;
|
||||
uint32_t startposition;
|
||||
uint32_t messagelength;
|
||||
|
||||
Addr destnet;
|
||||
Addr orignet;
|
||||
|
@ -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)
|
||||
);
|
||||
|
@ -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) {
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)));
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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, "");
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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, "");
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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:
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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, "");
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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],
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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, "");
|
||||
|
@ -1,59 +1,23 @@
|
||||
/* This is modifyed part of HUSKY project */
|
||||
/*
|
||||
* SMAPI; Modified Squish MSGAPI
|
||||
*
|
||||
* Squish MSGAPI0 is copyright 1991 by Scott J. Dudley. All rights reserved.
|
||||
* Modifications released to the public domain.
|
||||
*
|
||||
* Use of this file is subject to the restrictions contain in the Squish
|
||||
* MSGAPI0 licence agreement. Please refer to licence.txt for complete
|
||||
* details of the licencing restrictions. If you do not find the text
|
||||
* of this agreement in licence.txt, or if you do not have this file,
|
||||
* you should contact Scott Dudley at FidoNet node 1:249/106 or Internet
|
||||
* e-mail Scott.Dudley@f106.n249.z1.fidonet.org.
|
||||
*
|
||||
* In no event should you proceed to use any of the source files in this
|
||||
* archive without having accepted the terms of the MSGAPI0 licensing
|
||||
* agreement, or such other agreement as you are able to reach with the
|
||||
* author.
|
||||
*/
|
||||
/* Completely rewritten */
|
||||
|
||||
#ifndef __TYPEDEFS_H__
|
||||
#define __TYPEDEFS_H__
|
||||
|
||||
#ifdef SASC
|
||||
#include <dos.h>
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
|
||||
typedef unsigned bit;
|
||||
|
||||
#ifndef SASC
|
||||
typedef unsigned char byte;
|
||||
#endif
|
||||
typedef uint8_t byte;
|
||||
|
||||
typedef signed char sbyte;
|
||||
typedef int8_t sbyte;
|
||||
|
||||
typedef unsigned short word;
|
||||
typedef signed short sword;
|
||||
typedef uint16_t word;
|
||||
typedef int16_t sword;
|
||||
|
||||
#ifdef __alpha /* add other 64 bit systems here */
|
||||
typedef unsigned int dword;
|
||||
typedef signed int sdword;
|
||||
#else /* 32 and 16 bit machines */
|
||||
typedef unsigned long dword;
|
||||
typedef signed long sdword;
|
||||
#endif
|
||||
typedef uint32_t dword;
|
||||
typedef int32_t sdword;
|
||||
|
||||
#if !defined(UNIX) && !defined(SASC) && !defined(__MINGW32__)
|
||||
typedef unsigned short ushort;
|
||||
#endif
|
||||
|
||||
typedef signed short sshort;
|
||||
|
||||
#ifndef UNIX
|
||||
typedef unsigned long ulong;
|
||||
#endif
|
||||
|
||||
typedef signed long slong;
|
||||
typedef uint16_t ushort;
|
||||
typedef int16_t sshort;
|
||||
|
||||
#endif
|
||||
|
@ -39,6 +39,7 @@
|
||||
#define _SMBDEFS_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gdefs.h>
|
||||
|
||||
/**********/
|
||||
/* Macros */
|
||||
@ -48,19 +49,6 @@
|
||||
#define SHD_HEADER_ID "SHD\x1a" /* <S> <H> <D> <^Z> */
|
||||
#define LEN_HEADER_ID 4
|
||||
|
||||
#ifndef uchar
|
||||
typedef unsigned char uchar;
|
||||
#endif
|
||||
#ifdef __GLIBC__
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#ifndef ushort
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/* Memory allocation macros for various compilers and environments */
|
||||
/* MALLOC is used for allocations of 64k or less */
|
||||
@ -397,7 +385,7 @@ enum {
|
||||
|
||||
typedef struct _PACK { // Time with time-zone
|
||||
|
||||
ulong time; // Local time (unix format)
|
||||
uint32_t time; // Local time (unix format)
|
||||
short zone; // Time zone
|
||||
|
||||
} when_t;
|
||||
@ -408,9 +396,9 @@ typedef struct _PACK { // Index record
|
||||
ushort from; // 16-bit CRC of sender name (lower case)
|
||||
ushort subj; // 16-bit CRC of subject (lower case, w/o RE:)
|
||||
ushort attr; // attributes (read, permanent, etc.)
|
||||
ulong offset; // offset into header file
|
||||
ulong number; // number of message (1 based)
|
||||
ulong time; // time/date message was imported/posted
|
||||
uint32_t offset; // offset into header file
|
||||
uint32_t number; // number of message (1 based)
|
||||
uint32_t time; // time/date message was imported/posted
|
||||
|
||||
} idxrec_t;
|
||||
|
||||
@ -424,11 +412,11 @@ typedef struct _PACK { // Message base header (fixed portion)
|
||||
|
||||
typedef struct _PACK { // Message base status header
|
||||
|
||||
ulong last_msg; // last message number
|
||||
ulong total_msgs; // total messages
|
||||
ulong header_offset; // byte offset to first header record
|
||||
ulong max_crcs; // Maximum number of CRCs to keep in history
|
||||
ulong max_msgs; // Maximum number of message to keep in sub
|
||||
uint32_t last_msg; // last message number
|
||||
uint32_t total_msgs; // total messages
|
||||
uint32_t header_offset; // byte offset to first header record
|
||||
uint32_t max_crcs; // Maximum number of CRCs to keep in history
|
||||
uint32_t max_msgs; // Maximum number of message to keep in sub
|
||||
ushort max_age; // Maximum age of message to keep in sub (in days)
|
||||
ushort attr; // Attributes for this message base (SMB_HYPER,etc)
|
||||
|
||||
@ -441,17 +429,17 @@ typedef struct _PACK { // Message header
|
||||
ushort version; // Version of type (initially 100h for 1.00)
|
||||
ushort length; // Total length of fixed record + all fields
|
||||
ushort attr; // Attributes (bit field) (duped in SID)
|
||||
ulong auxattr; // Auxillary attributes (bit field)
|
||||
ulong netattr; // Network attributes
|
||||
uint32_t auxattr; // Auxillary attributes (bit field)
|
||||
uint32_t netattr; // Network attributes
|
||||
when_t when_written; // Time message was written (unix format)
|
||||
when_t when_imported; // Time message was imported
|
||||
ulong number; // Message number
|
||||
ulong thread_orig; // Original message number in thread
|
||||
ulong thread_next; // Next message in thread
|
||||
ulong thread_first; // First reply to this message
|
||||
uint32_t number; // Message number
|
||||
uint32_t thread_orig; // Original message number in thread
|
||||
uint32_t thread_next; // Next message in thread
|
||||
uint32_t thread_first; // First reply to this message
|
||||
ushort delivery_attempts; // Delivery attempt counter
|
||||
uchar reserved[14]; // Reserved for future use
|
||||
ulong offset; // Offset for buffer into data file (0 or mod 256)
|
||||
uint32_t offset; // Offset for buffer into data file (0 or mod 256)
|
||||
ushort total_dfields; // Total number of data fields
|
||||
|
||||
} msghdr_t;
|
||||
@ -459,8 +447,8 @@ typedef struct _PACK { // Message header
|
||||
typedef struct _PACK { // Data field
|
||||
|
||||
ushort type; // Type of data field
|
||||
ulong offset; // Offset into buffer
|
||||
ulong length; // Length of data field
|
||||
uint32_t offset; // Offset into buffer
|
||||
uint32_t length; // Length of data field
|
||||
|
||||
} dfield_t;
|
||||
|
||||
@ -525,7 +513,7 @@ typedef struct { // Message
|
||||
hfield_t *hfield; // Header fields (fixed length portion)
|
||||
void **hfield_dat; // Header fields (variable length portion)
|
||||
dfield_t *dfield; // Data fields (fixed length portion)
|
||||
ulong offset; // Offset (number of records) into index
|
||||
uint32_t offset; // Offset (number of records) into index
|
||||
int forwarded; // Forwarded from agent to another
|
||||
when_t expiration; // Message will exipre on this day (if >0)
|
||||
|
||||
@ -539,8 +527,8 @@ typedef struct { // Message base
|
||||
FILE *sid_fp; // File pointer for index (.sid) file
|
||||
FILE *sda_fp; // File pointer for data allocation (.sda) file
|
||||
FILE *sha_fp; // File pointer for header allocation (.sha) file
|
||||
ulong retry_time; // Maximum number of seconds to retry opens/locks
|
||||
ulong retry_delay; // Time-slice yield (milliseconds) while retrying
|
||||
uint32_t retry_time; // Maximum number of seconds to retry opens/locks
|
||||
uint32_t retry_delay; // Time-slice yield (milliseconds) while retrying
|
||||
smbstatus_t status; // Status header record
|
||||
int locked; // SMB header is locked
|
||||
char shd_buf[SHD_BLOCK_LEN]; // File I/O buffer for header file
|
||||
|
@ -221,7 +221,7 @@ int SMBCALL smb_open_da(smb_t* smb)
|
||||
start=time(NULL);
|
||||
else
|
||||
if(time(NULL)-start>=(time_t)smb->retry_time) {
|
||||
sprintf(smb->last_error,"timeout opening %s (retry_time=%ld)"
|
||||
sprintf(smb->last_error,"timeout opening %s (retry_time=%d)"
|
||||
,str,smb->retry_time);
|
||||
return(-2);
|
||||
}
|
||||
@ -266,7 +266,7 @@ int SMBCALL smb_open_ha(smb_t* smb)
|
||||
start=time(NULL);
|
||||
else
|
||||
if(time(NULL)-start>=(time_t)smb->retry_time) {
|
||||
sprintf(smb->last_error,"timeout opening %s (retry_time=%ld)"
|
||||
sprintf(smb->last_error,"timeout opening %s (retry_time=%d)"
|
||||
,str,smb->retry_time);
|
||||
return(-2);
|
||||
}
|
||||
@ -364,7 +364,7 @@ int SMBCALL smb_trunchdr(smb_t* smb)
|
||||
start=time(NULL);
|
||||
else
|
||||
if(time(NULL)-start>=(time_t)smb->retry_time) { /* Time-out */
|
||||
sprintf(smb->last_error,"timeout changing header file size (retry_time=%ld)"
|
||||
sprintf(smb->last_error,"timeout changing header file size (retry_time=%d)"
|
||||
,smb->retry_time);
|
||||
return(-2);
|
||||
}
|
||||
@ -509,7 +509,7 @@ int SMBCALL smb_lockmsghdr(smb_t* smb, smbmsg_t* msg)
|
||||
int SMBCALL smb_getmsgidx(smb_t* smb, smbmsg_t* msg)
|
||||
{
|
||||
idxrec_t idx;
|
||||
ulong l,length,total,bot,top;
|
||||
uint32_t l,length,total,bot,top;
|
||||
|
||||
if(smb->sid_fp==NULL) {
|
||||
sprintf(smb->last_error,"index not open");
|
||||
@ -527,12 +527,12 @@ int SMBCALL smb_getmsgidx(smb_t* smb, smbmsg_t* msg)
|
||||
|
||||
length=filelength(fileno(smb->sid_fp));
|
||||
if(!length) {
|
||||
sprintf(smb->last_error,"invalid index file length: %ld",length);
|
||||
sprintf(smb->last_error,"invalid index file length: %d",length);
|
||||
return(1);
|
||||
}
|
||||
total=length/sizeof(idxrec_t);
|
||||
if(!total) {
|
||||
sprintf(smb->last_error,"invalid index file length: %ld",length);
|
||||
sprintf(smb->last_error,"invalid index file length: %d",length);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@ -546,7 +546,7 @@ int SMBCALL smb_getmsgidx(smb_t* smb, smbmsg_t* msg)
|
||||
return(1);
|
||||
}
|
||||
if(bot==top-1 && idx.number!=msg->hdr.number) {
|
||||
sprintf(smb->last_error,"msg %ld not found",msg->hdr.number);
|
||||
sprintf(smb->last_error,"msg %d not found",msg->hdr.number);
|
||||
return(1);
|
||||
}
|
||||
if(idx.number>msg->hdr.number) {
|
||||
@ -589,7 +589,7 @@ int SMBCALL smb_getfirstidx(smb_t* smb, idxrec_t *idx)
|
||||
/****************************************************************************/
|
||||
int SMBCALL smb_getlastidx(smb_t* smb, idxrec_t *idx)
|
||||
{
|
||||
long length;
|
||||
int32_t length;
|
||||
|
||||
if(smb->sid_fp==NULL) {
|
||||
sprintf(smb->last_error,"index not open");
|
||||
@ -598,7 +598,7 @@ int SMBCALL smb_getlastidx(smb_t* smb, idxrec_t *idx)
|
||||
clearerr(smb->sid_fp);
|
||||
length=filelength(fileno(smb->sid_fp));
|
||||
if(length<sizeof(idxrec_t)) {
|
||||
sprintf(smb->last_error,"invalid index file length: %ld",length);
|
||||
sprintf(smb->last_error,"invalid index file length: %d",length);
|
||||
return(-1);
|
||||
}
|
||||
fseek(smb->sid_fp,length-sizeof(idxrec_t),SEEK_SET);
|
||||
@ -633,10 +633,10 @@ uint SMBCALL smb_getmsghdrlen(smbmsg_t* msg)
|
||||
/* Figures out the total length of the data buffer for 'msg' */
|
||||
/* Returns length */
|
||||
/****************************************************************************/
|
||||
ulong SMBCALL smb_getmsgdatlen(smbmsg_t* msg)
|
||||
uint32_t SMBCALL smb_getmsgdatlen(smbmsg_t* msg)
|
||||
{
|
||||
int i;
|
||||
ulong length=0L;
|
||||
uint32_t length=0L;
|
||||
|
||||
for(i=0;i<msg->hdr.total_dfields;i++)
|
||||
length+=msg->dfield[i].length;
|
||||
@ -654,7 +654,7 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
|
||||
hfield_t *vp;
|
||||
void **vpp;
|
||||
ushort i;
|
||||
ulong l,offset;
|
||||
uint32_t l,offset;
|
||||
idxrec_t idx;
|
||||
|
||||
if(smb->shd_fp==NULL) {
|
||||
@ -967,7 +967,7 @@ void* SMBCALL smb_get_hfield(smbmsg_t* msg, ushort type, hfield_t* hfield)
|
||||
/* Automatically figures out the offset into the data buffer from existing */
|
||||
/* dfield lengths */
|
||||
/****************************************************************************/
|
||||
int SMBCALL smb_dfield(smbmsg_t* msg, ushort type, ulong length)
|
||||
int SMBCALL smb_dfield(smbmsg_t* msg, ushort type, uint32_t length)
|
||||
{
|
||||
dfield_t* vp;
|
||||
int i,j;
|
||||
@ -989,12 +989,12 @@ int SMBCALL smb_dfield(smbmsg_t* msg, ushort type, ulong length)
|
||||
/* Checks CRC history file for duplicate crc. If found, returns 1. */
|
||||
/* If no dupe, adds to CRC history and returns 0, or negative if error. */
|
||||
/****************************************************************************/
|
||||
int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
|
||||
int SMBCALL smb_addcrc(smb_t* smb, uint32_t crc)
|
||||
{
|
||||
char str[128];
|
||||
int file;
|
||||
long length;
|
||||
ulong l,*buf;
|
||||
int32_t length;
|
||||
uint32_t l,*buf;
|
||||
time_t start=0;
|
||||
|
||||
if(!smb->status.max_crcs)
|
||||
@ -1012,7 +1012,7 @@ int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
|
||||
start=time(NULL);
|
||||
else
|
||||
if(time(NULL)-start>=(time_t)smb->retry_time) {
|
||||
sprintf(smb->last_error,"timeout opening %s (retry_time=%ld)"
|
||||
sprintf(smb->last_error,"timeout opening %s (retry_time=%d)"
|
||||
,str,smb->retry_time);
|
||||
return(-2);
|
||||
}
|
||||
@ -1022,17 +1022,17 @@ int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
|
||||
length=filelength(file);
|
||||
if(length<0L) {
|
||||
close(file);
|
||||
sprintf(smb->last_error,"invalid file length: %ld", length);
|
||||
sprintf(smb->last_error,"invalid file length: %d", length);
|
||||
return(-4);
|
||||
}
|
||||
if((buf=(ulong*)MALLOC(smb->status.max_crcs*4))==NULL) {
|
||||
if((buf=(uint32_t*)MALLOC(smb->status.max_crcs*4))==NULL) {
|
||||
close(file);
|
||||
sprintf(smb->last_error
|
||||
,"malloc failure of %ld bytes"
|
||||
,"malloc failure of %d bytes"
|
||||
,smb->status.max_crcs*4);
|
||||
return(-3);
|
||||
}
|
||||
if((ulong)length>=smb->status.max_crcs*4L) { /* Reached or exceeds max crcs */
|
||||
if((uint32_t)length>=smb->status.max_crcs*4L) { /* Reached or exceeds max crcs */
|
||||
read(file,buf,smb->status.max_crcs*4);
|
||||
for(l=0;l<smb->status.max_crcs;l++)
|
||||
if(crc==buf[l])
|
||||
@ -1051,10 +1051,10 @@ int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
|
||||
|
||||
else if(length/4) { /* Less than max crcs */
|
||||
read(file,buf,length);
|
||||
for(l=0;l<(ulong)(length/4);l++)
|
||||
for(l=0;l<(uint32_t)(length/4);l++)
|
||||
if(crc==buf[l])
|
||||
break;
|
||||
if(l<(ulong)(length/4L)) { /* Dupe CRC found */
|
||||
if(l<(uint32_t)(length/4L)) { /* Dupe CRC found */
|
||||
close(file);
|
||||
FREE(buf);
|
||||
sprintf(smb->last_error
|
||||
@ -1080,7 +1080,7 @@ int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
|
||||
int SMBCALL smb_addmsghdr(smb_t* smb, smbmsg_t* msg, int storage)
|
||||
{
|
||||
int i;
|
||||
long l;
|
||||
int32_t l;
|
||||
|
||||
if(!smb->locked && smb_locksmbhdr(smb))
|
||||
return(1);
|
||||
@ -1168,7 +1168,7 @@ int SMBCALL smb_putmsgidx(smb_t* smb, smbmsg_t* msg)
|
||||
int SMBCALL smb_putmsghdr(smb_t* smb, smbmsg_t* msg)
|
||||
{
|
||||
ushort i;
|
||||
ulong l;
|
||||
uint32_t l;
|
||||
|
||||
if(smb->shd_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1176,12 +1176,12 @@ int SMBCALL smb_putmsghdr(smb_t* smb, smbmsg_t* msg)
|
||||
}
|
||||
if(msg->idx.offset<sizeof(smbhdr_t)+sizeof(smbstatus_t)
|
||||
|| msg->idx.offset<smb->status.header_offset) {
|
||||
sprintf(smb->last_error,"invalid header offset: %ld",msg->idx.offset);
|
||||
sprintf(smb->last_error,"invalid header offset: %d",msg->idx.offset);
|
||||
return(-7);
|
||||
}
|
||||
clearerr(smb->shd_fp);
|
||||
if(fseek(smb->shd_fp,msg->idx.offset,SEEK_SET)) {
|
||||
sprintf(smb->last_error,"seeking to %ld in index",msg->idx.offset);
|
||||
sprintf(smb->last_error,"seeking to %d in index",msg->idx.offset);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@ -1215,7 +1215,7 @@ int SMBCALL smb_putmsghdr(smb_t* smb, smbmsg_t* msg)
|
||||
sprintf(smb->last_error,"writing header field");
|
||||
return(-4);
|
||||
}
|
||||
if(msg->hfield[i].length /* more then 0 bytes long */
|
||||
if(msg->hfield[i].length /* more then 0 bytes int32_t */
|
||||
&& !fwrite(msg->hfield_dat[i],msg->hfield[i].length,1,smb->shd_fp)) {
|
||||
sprintf(smb->last_error,"writing header field data");
|
||||
return(-5);
|
||||
@ -1281,9 +1281,9 @@ int SMBCALL smb_create(smb_t* smb)
|
||||
/****************************************************************************/
|
||||
/* Returns number of data blocks required to store "length" amount of data */
|
||||
/****************************************************************************/
|
||||
ulong SMBCALL smb_datblocks(ulong length)
|
||||
uint32_t SMBCALL smb_datblocks(uint32_t length)
|
||||
{
|
||||
ulong blocks;
|
||||
uint32_t blocks;
|
||||
|
||||
blocks=length/SDT_BLOCK_LEN;
|
||||
if(length%SDT_BLOCK_LEN)
|
||||
@ -1294,9 +1294,9 @@ ulong SMBCALL smb_datblocks(ulong length)
|
||||
/****************************************************************************/
|
||||
/* Returns number of header blocks required to store "length" size header */
|
||||
/****************************************************************************/
|
||||
ulong SMBCALL smb_hdrblocks(ulong length)
|
||||
uint32_t SMBCALL smb_hdrblocks(uint32_t length)
|
||||
{
|
||||
ulong blocks;
|
||||
uint32_t blocks;
|
||||
|
||||
blocks=length/SHD_BLOCK_LEN;
|
||||
if(length%SHD_BLOCK_LEN)
|
||||
@ -1313,10 +1313,10 @@ ulong SMBCALL smb_hdrblocks(ulong length)
|
||||
/* smb_close_da() should be called after */
|
||||
/* Returns negative on error */
|
||||
/****************************************************************************/
|
||||
long SMBCALL smb_allocdat(smb_t* smb, ulong length, ushort headers)
|
||||
int32_t SMBCALL smb_allocdat(smb_t* smb, uint32_t length, ushort headers)
|
||||
{
|
||||
ushort i,j;
|
||||
ulong l,blocks,offset=0L;
|
||||
uint32_t l,blocks,offset=0L;
|
||||
|
||||
if(smb->sda_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1352,9 +1352,9 @@ long SMBCALL smb_allocdat(smb_t* smb, ulong length, ushort headers)
|
||||
/* Allocates space for data, but doesn't search for unused blocks */
|
||||
/* Returns negative on error */
|
||||
/****************************************************************************/
|
||||
long SMBCALL smb_fallocdat(smb_t* smb, ulong length, ushort headers)
|
||||
int32_t SMBCALL smb_fallocdat(smb_t* smb, uint32_t length, ushort headers)
|
||||
{
|
||||
ulong l,blocks,offset;
|
||||
uint32_t l,blocks,offset;
|
||||
|
||||
if(smb->sda_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1380,13 +1380,13 @@ long SMBCALL smb_fallocdat(smb_t* smb, ulong length, ushort headers)
|
||||
/* De-allocates space for data */
|
||||
/* Returns non-zero on error */
|
||||
/****************************************************************************/
|
||||
int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length
|
||||
int SMBCALL smb_freemsgdat(smb_t* smb, uint32_t offset, uint32_t length
|
||||
, ushort headers)
|
||||
{
|
||||
int da_opened=0;
|
||||
int retval=0;
|
||||
ushort i;
|
||||
ulong l,blocks;
|
||||
uint32_t l,blocks;
|
||||
|
||||
if(smb->status.attr&SMB_HYPERALLOC) /* do nothing */
|
||||
return(0);
|
||||
@ -1438,10 +1438,10 @@ int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length
|
||||
/* Adds to data allocation records for blocks starting at 'offset' */
|
||||
/* Returns non-zero on error */
|
||||
/****************************************************************************/
|
||||
int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort headers)
|
||||
int SMBCALL smb_incdat(smb_t* smb, uint32_t offset, uint32_t length, ushort headers)
|
||||
{
|
||||
ushort i;
|
||||
ulong l,blocks;
|
||||
uint32_t l,blocks;
|
||||
|
||||
if(smb->sda_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1470,10 +1470,10 @@ int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort headers)
|
||||
/* De-allocates blocks for header record */
|
||||
/* Returns non-zero on error */
|
||||
/****************************************************************************/
|
||||
int SMBCALL smb_freemsghdr(smb_t* smb, ulong offset, ulong length)
|
||||
int SMBCALL smb_freemsghdr(smb_t* smb, uint32_t offset, uint32_t length)
|
||||
{
|
||||
uchar c=0;
|
||||
ulong l,blocks;
|
||||
uint32_t l,blocks;
|
||||
|
||||
if(smb->sha_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1520,11 +1520,11 @@ int SMBCALL smb_freemsg(smb_t* smb, smbmsg_t* msg)
|
||||
/* smb_close_ha() should be called after */
|
||||
/* Returns -1L on error */
|
||||
/****************************************************************************/
|
||||
long SMBCALL smb_allochdr(smb_t* smb, ulong length)
|
||||
int32_t SMBCALL smb_allochdr(smb_t* smb, uint32_t length)
|
||||
{
|
||||
uchar c;
|
||||
ushort i;
|
||||
ulong l,blocks,offset=0;
|
||||
uint32_t l,blocks,offset=0;
|
||||
|
||||
if(smb->sha_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1561,10 +1561,10 @@ long SMBCALL smb_allochdr(smb_t* smb, ulong length)
|
||||
/* Allocates space for index, but doesn't search for unused blocks */
|
||||
/* Returns -1L on error */
|
||||
/****************************************************************************/
|
||||
long SMBCALL smb_fallochdr(smb_t* smb, ulong length)
|
||||
int32_t SMBCALL smb_fallochdr(smb_t* smb, uint32_t length)
|
||||
{
|
||||
uchar c=1;
|
||||
ulong l,blocks,offset;
|
||||
uint32_t l,blocks,offset;
|
||||
|
||||
if(smb->sha_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1589,9 +1589,9 @@ long SMBCALL smb_fallochdr(smb_t* smb, ulong length)
|
||||
/* this function should be most likely not be called from anywhere but */
|
||||
/* smb_addmsghdr() */
|
||||
/************************************************************************/
|
||||
long SMBCALL smb_hallochdr(smb_t* smb)
|
||||
int32_t SMBCALL smb_hallochdr(smb_t* smb)
|
||||
{
|
||||
ulong l;
|
||||
uint32_t l;
|
||||
|
||||
if(smb->shd_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1613,9 +1613,9 @@ long SMBCALL smb_hallochdr(smb_t* smb)
|
||||
/* unlocked until all data fields for this message have been written */
|
||||
/* to the SDT file */
|
||||
/************************************************************************/
|
||||
long SMBCALL smb_hallocdat(smb_t* smb)
|
||||
int32_t SMBCALL smb_hallocdat(smb_t* smb)
|
||||
{
|
||||
long l;
|
||||
int32_t l;
|
||||
|
||||
if(smb->sdt_fp==NULL) {
|
||||
sprintf(smb->last_error,"msgbase not open");
|
||||
@ -1657,22 +1657,22 @@ int SMBCALL smb_fputc(int ch, FILE* fp)
|
||||
return(fputc(ch,fp));
|
||||
}
|
||||
|
||||
int SMBCALL smb_fseek(FILE* fp, long offset, int whence)
|
||||
int SMBCALL smb_fseek(FILE* fp, int32_t offset, int whence)
|
||||
{
|
||||
return(fseek(fp,offset,whence));
|
||||
}
|
||||
|
||||
long SMBCALL smb_ftell(FILE* fp)
|
||||
int32_t SMBCALL smb_ftell(FILE* fp)
|
||||
{
|
||||
return(ftell(fp));
|
||||
}
|
||||
|
||||
long SMBCALL smb_fgetlength(FILE* fp)
|
||||
int32_t SMBCALL smb_fgetlength(FILE* fp)
|
||||
{
|
||||
return(filelength(fileno(fp)));
|
||||
}
|
||||
|
||||
int SMBCALL smb_fsetlength(FILE* fp, long length)
|
||||
int SMBCALL smb_fsetlength(FILE* fp, int32_t length)
|
||||
{
|
||||
return(chsize(fileno(fp),length));
|
||||
}
|
||||
@ -1687,12 +1687,12 @@ void SMBCALL smb_clearerr(FILE* fp)
|
||||
clearerr(fp);
|
||||
}
|
||||
|
||||
long SMBCALL smb_fread(void HUGE16* buf, long bytes, FILE* fp)
|
||||
int32_t SMBCALL smb_fread(void HUGE16* buf, int32_t bytes, FILE* fp)
|
||||
{
|
||||
#ifdef __FLAT__
|
||||
return(fread(buf,1,bytes,fp));
|
||||
#else
|
||||
long count;
|
||||
int32_t count;
|
||||
|
||||
for(count=bytes;count>0x7fff;count-=0x7fff,(char*)buf+=0x7fff)
|
||||
if(fread((char*)buf,1,0x7fff,fp)!=0x7fff)
|
||||
@ -1703,12 +1703,12 @@ long SMBCALL smb_fread(void HUGE16* buf, long bytes, FILE* fp)
|
||||
#endif
|
||||
}
|
||||
|
||||
long SMBCALL smb_fwrite(void HUGE16* buf, long bytes, FILE* fp)
|
||||
int32_t SMBCALL smb_fwrite(void HUGE16* buf, int32_t bytes, FILE* fp)
|
||||
{
|
||||
#ifdef __FLAT__
|
||||
return(fwrite(buf,1,bytes,fp));
|
||||
#else
|
||||
long count;
|
||||
int32_t count;
|
||||
|
||||
for(count=bytes;count>0x7fff;count-=0x7fff,(char*)buf+=0x7fff)
|
||||
if(fwrite((char*)buf,1,0x7fff,fp)!=0x7fff)
|
||||
|
@ -106,34 +106,34 @@ SMBEXPORT int SMBCALL smb_getmsgidx(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_getfirstidx(smb_t* smb, idxrec_t *idx);
|
||||
SMBEXPORT int SMBCALL smb_getlastidx(smb_t* smb, idxrec_t *idx);
|
||||
SMBEXPORT uint SMBCALL smb_getmsghdrlen(smbmsg_t* msg);
|
||||
SMBEXPORT ulong SMBCALL smb_getmsgdatlen(smbmsg_t* msg);
|
||||
SMBEXPORT uint32_t SMBCALL smb_getmsgdatlen(smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_lockmsghdr(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_unlockmsghdr(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_addcrc(smb_t* smb, ulong crc);
|
||||
SMBEXPORT int SMBCALL smb_addcrc(smb_t* smb, uint32_t crc);
|
||||
SMBEXPORT int SMBCALL smb_hfield(smbmsg_t* msg, ushort type, size_t length, void* data);
|
||||
SMBEXPORT int SMBCALL smb_dfield(smbmsg_t* msg, ushort type, ulong length);
|
||||
SMBEXPORT int SMBCALL smb_dfield(smbmsg_t* msg, ushort type, uint32_t length);
|
||||
SMBEXPORT void* SMBCALL smb_get_hfield(smbmsg_t* msg, ushort type, hfield_t* hfield);
|
||||
SMBEXPORT int SMBCALL smb_addmsghdr(smb_t* smb, smbmsg_t* msg,int storage);
|
||||
SMBEXPORT int SMBCALL smb_putmsg(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_putmsgidx(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_putmsghdr(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT void SMBCALL smb_freemsgmem(smbmsg_t* msg);
|
||||
SMBEXPORT ulong SMBCALL smb_hdrblocks(ulong length);
|
||||
SMBEXPORT ulong SMBCALL smb_datblocks(ulong length);
|
||||
SMBEXPORT long SMBCALL smb_allochdr(smb_t* smb, ulong length);
|
||||
SMBEXPORT long SMBCALL smb_fallochdr(smb_t* smb, ulong length);
|
||||
SMBEXPORT long SMBCALL smb_hallochdr(smb_t* smb);
|
||||
SMBEXPORT long SMBCALL smb_allocdat(smb_t* smb, ulong length, ushort headers);
|
||||
SMBEXPORT long SMBCALL smb_fallocdat(smb_t* smb, ulong length, ushort headers);
|
||||
SMBEXPORT long SMBCALL smb_hallocdat(smb_t* smb);
|
||||
SMBEXPORT int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort headers);
|
||||
SMBEXPORT uint32_t SMBCALL smb_hdrblocks(uint32_t length);
|
||||
SMBEXPORT uint32_t SMBCALL smb_datblocks(uint32_t length);
|
||||
SMBEXPORT int32_t SMBCALL smb_allochdr(smb_t* smb, uint32_t length);
|
||||
SMBEXPORT int32_t SMBCALL smb_fallochdr(smb_t* smb, uint32_t length);
|
||||
SMBEXPORT int32_t SMBCALL smb_hallochdr(smb_t* smb);
|
||||
SMBEXPORT int32_t SMBCALL smb_allocdat(smb_t* smb, uint32_t length, ushort headers);
|
||||
SMBEXPORT int32_t SMBCALL smb_fallocdat(smb_t* smb, uint32_t length, ushort headers);
|
||||
SMBEXPORT int32_t SMBCALL smb_hallocdat(smb_t* smb);
|
||||
SMBEXPORT int SMBCALL smb_incdat(smb_t* smb, uint32_t offset, uint32_t length, ushort headers);
|
||||
SMBEXPORT int SMBCALL smb_freemsg(smb_t* smb, smbmsg_t* msg);
|
||||
SMBEXPORT int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length, ushort headers);
|
||||
SMBEXPORT int SMBCALL smb_freemsghdr(smb_t* smb, ulong offset, ulong length);
|
||||
SMBEXPORT int SMBCALL smb_freemsgdat(smb_t* smb, uint32_t offset, uint32_t length, ushort headers);
|
||||
SMBEXPORT int SMBCALL smb_freemsghdr(smb_t* smb, uint32_t offset, uint32_t length);
|
||||
SMBEXPORT void SMBCALL smb_freemsgtxt(char* buf);
|
||||
SMBEXPORT int SMBCALL smb_copymsgmem(smbmsg_t* destmsg, smbmsg_t* srcmsg);
|
||||
SMBEXPORT char* SMBCALL smb_getmsgtxt(smb_t* smb, smbmsg_t* msg, ulong mode);
|
||||
SMBEXPORT char* SMBCALL smb_getmsgtxt(smb_t* smb, smbmsg_t* msg, uint32_t mode);
|
||||
SMBEXPORT int SMBCALL smb_tzutc(short timezone);
|
||||
|
||||
/* FILE pointer I/O functions */
|
||||
@ -143,12 +143,12 @@ SMBEXPORT int SMBCALL smb_ferror(FILE* fp);
|
||||
SMBEXPORT int SMBCALL smb_fflush(FILE* fp);
|
||||
SMBEXPORT int SMBCALL smb_fgetc(FILE* fp);
|
||||
SMBEXPORT int SMBCALL smb_fputc(int ch, FILE* fp);
|
||||
SMBEXPORT int SMBCALL smb_fseek(FILE* fp, long offset, int whence);
|
||||
SMBEXPORT long SMBCALL smb_ftell(FILE* fp);
|
||||
SMBEXPORT long SMBCALL smb_fread(void HUGE16* buf, long bytes, FILE* fp);
|
||||
SMBEXPORT long SMBCALL smb_fwrite(void HUGE16* buf, long bytes, FILE* fp);
|
||||
SMBEXPORT long SMBCALL smb_fgetlength(FILE* fp);
|
||||
SMBEXPORT int SMBCALL smb_fsetlength(FILE* fp, long length);
|
||||
SMBEXPORT int SMBCALL smb_fseek(FILE* fp, int32_t offset, int whence);
|
||||
SMBEXPORT int32_t SMBCALL smb_ftell(FILE* fp);
|
||||
SMBEXPORT int32_t SMBCALL smb_fread(void HUGE16* buf, int32_t bytes, FILE* fp);
|
||||
SMBEXPORT int32_t SMBCALL smb_fwrite(void HUGE16* buf, int32_t bytes, FILE* fp);
|
||||
SMBEXPORT int32_t SMBCALL smb_fgetlength(FILE* fp);
|
||||
SMBEXPORT int SMBCALL smb_fsetlength(FILE* fp, int32_t length);
|
||||
SMBEXPORT void SMBCALL smb_rewind(FILE* fp);
|
||||
SMBEXPORT void SMBCALL smb_clearerr(FILE* fp);
|
||||
|
||||
|
@ -259,7 +259,7 @@ static char* fast_parse_addr(char* str, Addr* addr) {
|
||||
point = strchr(str, '.');
|
||||
domain = strchr(str, '@');
|
||||
if(domain and point)
|
||||
if((dword)point > (dword)domain)
|
||||
if((ulong)point > (ulong)domain)
|
||||
point = NULL;
|
||||
|
||||
if(space)
|
||||
@ -304,7 +304,7 @@ static char* parse_address(char* str, Addr* addr, Addr* mainaka) {
|
||||
char* point = strchr(str, '.');
|
||||
domain = strchr(str, '@');
|
||||
if(domain and point)
|
||||
if((dword)point > (dword)domain)
|
||||
if((ulong)point > (ulong)domain)
|
||||
point = NULL;
|
||||
|
||||
if(net) {
|
||||
@ -1011,7 +1011,7 @@ static void read_nodelists() {
|
||||
if(not quiet) std::cout << ' ' << std::endl << "* Writing " << name << std::endl;
|
||||
for(fno=nodelist.begin(); fno != nodelist.end(); fno++) {
|
||||
if(*(fno->fn))
|
||||
fprintf(fp, "%s %lu\n", fno->fn, fno->ft);
|
||||
fprintf(fp, "%s %u\n", fno->fn, fno->ft);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user