Changed time_t type to time32_t
This commit is contained in:
parent
d8a855aa42
commit
44c26c3b0a
@ -550,17 +550,17 @@ enum {
|
|||||||
// The Message Browser
|
// The Message Browser
|
||||||
|
|
||||||
struct MLst {
|
struct MLst {
|
||||||
ulong msgno;
|
ulong msgno;
|
||||||
byte high;
|
byte high;
|
||||||
char num[8];
|
char num[8];
|
||||||
char marks[3];
|
char marks[3];
|
||||||
char by[sizeof(Name)+20];
|
char by[sizeof(Name)+20];
|
||||||
char to[sizeof(Name)+20];
|
char to[sizeof(Name)+20];
|
||||||
Subj re;
|
Subj re;
|
||||||
time_t written;
|
time32_t written;
|
||||||
time_t arrived;
|
time32_t arrived;
|
||||||
time_t received;
|
time32_t received;
|
||||||
char goldmark;
|
char goldmark;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2581,7 +2581,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
|
|||||||
gotorowcol(mincol, minrow);
|
gotorowcol(mincol, minrow);
|
||||||
dispins();
|
dispins();
|
||||||
|
|
||||||
time_t _lasttime = time(NULL);
|
time32_t _lasttime = gtime(NULL);
|
||||||
|
|
||||||
while(not done) {
|
while(not done) {
|
||||||
|
|
||||||
@ -2613,7 +2613,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(EDIT->AutoSave()) {
|
if(EDIT->AutoSave()) {
|
||||||
time_t _thistime = time(NULL);
|
time32_t _thistime = gtime(NULL);
|
||||||
if(_thistime >= (_lasttime+EDIT->AutoSave())) {
|
if(_thistime >= (_lasttime+EDIT->AutoSave())) {
|
||||||
_lasttime = _thistime;
|
_lasttime = _thistime;
|
||||||
SaveFile();
|
SaveFile();
|
||||||
|
@ -515,7 +515,7 @@ void Initialize(int argc, char* argv[]) {
|
|||||||
#if defined(GUTLOS_FUNCS)
|
#if defined(GUTLOS_FUNCS)
|
||||||
g_init_os(1);
|
g_init_os(1);
|
||||||
#endif
|
#endif
|
||||||
srand((unsigned)time(NULL));
|
srand(gtime(NULL));
|
||||||
|
|
||||||
// Display startup banner
|
// Display startup banner
|
||||||
std::cout << __gver_longpid__ << " " << __gver_ver__ << "\n";
|
std::cout << __gver_longpid__ << " " << __gver_ver__ << "\n";
|
||||||
|
@ -797,11 +797,11 @@ void KludgeDATE(GMsg* msg, const char* ptr) {
|
|||||||
t.tm_min = minute;
|
t.tm_min = minute;
|
||||||
t.tm_sec = second;
|
t.tm_sec = second;
|
||||||
t.tm_isdst = -1;
|
t.tm_isdst = -1;
|
||||||
time_t a = mktime(&t);
|
time32_t a = gmktime(&t);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
msg->written = a + a - b;
|
msg->written = a + a - b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
|
|||||||
char nbuf[33], dbuf[20];
|
char nbuf[33], dbuf[20];
|
||||||
strcpy(dbuf, LNG->n_a);
|
strcpy(dbuf, LNG->n_a);
|
||||||
|
|
||||||
time_t dt = 0;
|
time32_t dt = 0;
|
||||||
switch(AA->Msglistdate()) {
|
switch(AA->Msglistdate()) {
|
||||||
case MSGLISTDATE_WRITTEN: dt = ml->written; break;
|
case MSGLISTDATE_WRITTEN: dt = ml->written; break;
|
||||||
case MSGLISTDATE_ARRIVED: dt = ml->arrived; break;
|
case MSGLISTDATE_ARRIVED: dt = ml->arrived; break;
|
||||||
@ -896,7 +896,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
|
|||||||
|
|
||||||
if(AA->Msglistdate() != MSGLISTDATE_NONE) {
|
if(AA->Msglistdate() != MSGLISTDATE_NONE) {
|
||||||
char dbuf[11];
|
char dbuf[11];
|
||||||
time_t dt = 0;
|
time32_t dt = 0;
|
||||||
|
|
||||||
memset(dbuf, ' ', 10);
|
memset(dbuf, ' ', 10);
|
||||||
dbuf[10] = NUL;
|
dbuf[10] = NUL;
|
||||||
|
@ -34,7 +34,7 @@ static ulong msgcount = 0;
|
|||||||
|
|
||||||
ulong getClassicMsgId() {
|
ulong getClassicMsgId() {
|
||||||
|
|
||||||
return time(NULL)+(msgcount++);
|
return gtime(NULL)+(msgcount++);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -106,7 +106,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
|||||||
const char *xmailer = get_informative_string();
|
const char *xmailer = get_informative_string();
|
||||||
const char *osver = ggetosstring();
|
const char *osver = ggetosstring();
|
||||||
|
|
||||||
time_t t = time(NULL);
|
time32_t t = gtime(NULL);
|
||||||
struct tm* written_tm = glocaltime(&t);
|
struct tm* written_tm = glocaltime(&t);
|
||||||
char cdate[80];
|
char cdate[80];
|
||||||
strftimei(cdate, 80, LNG->DateFmt, written_tm);
|
strftimei(cdate, 80, LNG->DateFmt, written_tm);
|
||||||
|
@ -243,10 +243,10 @@ static void MakeMsg3(int& mode, GMsg* msg) {
|
|||||||
|
|
||||||
// Do Timefields
|
// Do Timefields
|
||||||
if(msg->attr.fmu()) {
|
if(msg->attr.fmu()) {
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
a += a - b;
|
a += a - b;
|
||||||
if(AA->havereceivedstamp())
|
if(AA->havereceivedstamp())
|
||||||
msg->received = a;
|
msg->received = a;
|
||||||
@ -824,10 +824,10 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
|||||||
dochgdate = false;
|
dochgdate = false;
|
||||||
}
|
}
|
||||||
if(dochgdate) {
|
if(dochgdate) {
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
a += a - b;
|
a += a - b;
|
||||||
msg->received = msg->arrived = msg->written = a;
|
msg->received = msg->arrived = msg->written = a;
|
||||||
}
|
}
|
||||||
|
@ -208,15 +208,15 @@ int ImportQWK() {
|
|||||||
_tm.tm_min = _minute;
|
_tm.tm_min = _minute;
|
||||||
_tm.tm_sec = 0;
|
_tm.tm_sec = 0;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
time32_t a = gmktime(&_tm);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
msg->written = a + a - b;
|
msg->written = a + a - b;
|
||||||
a = time(NULL);
|
a = gtime(NULL);
|
||||||
tp = ggmtime(&a);
|
tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
b = mktime(tp);
|
b = gmktime(tp);
|
||||||
msg->arrived = a + a - b;
|
msg->arrived = a + a - b;
|
||||||
|
|
||||||
// Read message text
|
// Read message text
|
||||||
|
@ -1174,10 +1174,10 @@ int LoadMessage(GMsg* msg, int margin) {
|
|||||||
if(msg->attr.tou()) {
|
if(msg->attr.tou()) {
|
||||||
reader_rcv_noise = 1;
|
reader_rcv_noise = 1;
|
||||||
if(not msg->attr.rcv()) { // Have we seen it?
|
if(not msg->attr.rcv()) { // Have we seen it?
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
msg->received = a + a - b; // Get current date
|
msg->received = a + a - b; // Get current date
|
||||||
msg->attr.rcv1(); // Mark as received
|
msg->attr.rcv1(); // Mark as received
|
||||||
reader_rcv_noise++;
|
reader_rcv_noise++;
|
||||||
|
@ -171,11 +171,11 @@ void ProcessSoupMsg(char* lbuf, GMsg* msg, int& msgs, char* areaname, int tossto
|
|||||||
|
|
||||||
msg->orig = msg->oorig = CFG->internetgate.addr.valid() ? CFG->internetgate.addr : AA->aka();
|
msg->orig = msg->oorig = CFG->internetgate.addr.valid() ? CFG->internetgate.addr : AA->aka();
|
||||||
msg->dest = msg->odest = AA->aka();
|
msg->dest = msg->odest = AA->aka();
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
msg->arrived = a + a - b;
|
msg->arrived = a + a - b;
|
||||||
|
|
||||||
Line* line = NULL;
|
Line* line = NULL;
|
||||||
Line* fline = NULL;
|
Line* fline = NULL;
|
||||||
@ -697,11 +697,11 @@ int ExportSoupMsg(GMsg* msg, char* msgfile, gfile& fp, int ismail) {
|
|||||||
msg->attr.snt1();
|
msg->attr.snt1();
|
||||||
msg->attr.scn1();
|
msg->attr.scn1();
|
||||||
msg->attr.uns0();
|
msg->attr.uns0();
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
msg->arrived = a + a - b;
|
msg->arrived = a + a - b;
|
||||||
AA->SaveHdr(GMSG_UPDATE, msg);
|
AA->SaveHdr(GMSG_UPDATE, msg);
|
||||||
if(msg->attr.k_s())
|
if(msg->attr.k_s())
|
||||||
AA->DeleteMsg(msg, DIR_NEXT);
|
AA->DeleteMsg(msg, DIR_NEXT);
|
||||||
|
@ -342,7 +342,7 @@ bool guserbase::edit_entry(uint idx) {
|
|||||||
window.prints(13, 53, wattr, "Times Used:");
|
window.prints(13, 53, wattr, "Times Used:");
|
||||||
|
|
||||||
char dbuf[16];
|
char dbuf[16];
|
||||||
time_t dt = entry.firstdate;
|
time32_t dt = entry.firstdate;
|
||||||
if(dt)
|
if(dt)
|
||||||
window.prints(13, 13, wattr, strftimei(dbuf, 16, "%d %b %y", ggmtime(&dt)));
|
window.prints(13, 13, wattr, strftimei(dbuf, 16, "%d %b %y", ggmtime(&dt)));
|
||||||
dt = entry.lastdate;
|
dt = entry.lastdate;
|
||||||
@ -427,10 +427,10 @@ bool guserbase::find_entry(char* name, bool lookup) {
|
|||||||
void guserbase::write_entry(uint idx, bool updateit) {
|
void guserbase::write_entry(uint idx, bool updateit) {
|
||||||
|
|
||||||
if(updateit and not entry.is_deleted) {
|
if(updateit and not entry.is_deleted) {
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
entry.lastdate = a + a - b;
|
entry.lastdate = a + a - b;
|
||||||
if(not entry.firstdate)
|
if(not entry.firstdate)
|
||||||
entry.firstdate = entry.lastdate;
|
entry.firstdate = entry.lastdate;
|
||||||
|
@ -54,7 +54,7 @@ void update_statuslines() {
|
|||||||
*help = NUL;
|
*help = NUL;
|
||||||
|
|
||||||
if(CFG->switches.get(statuslineclock)) {
|
if(CFG->switches.get(statuslineclock)) {
|
||||||
time_t t = time(NULL);
|
time32_t t = gtime(NULL);
|
||||||
sprintf(clkinfo, " %s", strftimei(help, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
|
sprintf(clkinfo, " %s", strftimei(help, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ void ScreenBlankIdle() {
|
|||||||
|
|
||||||
char blankmsg1[80];
|
char blankmsg1[80];
|
||||||
char blankmsg2[80];
|
char blankmsg2[80];
|
||||||
time_t t = time(NULL);
|
time32_t t = gtime(NULL);
|
||||||
sprintf(blankmsg1, " %s %s %s ", __gver_longpid__, __gver_ver__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
|
sprintf(blankmsg1, " %s %s %s ", __gver_longpid__, __gver_ver__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
|
||||||
sprintf(blankmsg2, " %s ", LNG->BlankMsg);
|
sprintf(blankmsg2, " %s ", LNG->BlankMsg);
|
||||||
if(strblank(blankmsg2)) {
|
if(strblank(blankmsg2)) {
|
||||||
|
@ -155,7 +155,7 @@ inline int is_dir(const std::string& path) { return is_dir(path.c_str()); }
|
|||||||
inline bool fexist(const char* filename) { return *filename ? ((access(filename, R_OK) == 0) and not is_dir(filename)) : false; }
|
inline bool fexist(const char* filename) { return *filename ? ((access(filename, R_OK) == 0) and not is_dir(filename)) : false; }
|
||||||
inline bool fexist(const std::string& filename) { return fexist(filename.c_str()); }
|
inline bool fexist(const std::string& filename) { return fexist(filename.c_str()); }
|
||||||
|
|
||||||
dword gfixstattime(time_t st_time);
|
dword gfixstattime(time32_t st_time);
|
||||||
|
|
||||||
dword GetFiletime(const char* file);
|
dword GetFiletime(const char* file);
|
||||||
inline dword GetFiletime(const std::string& file) { return GetFiletime(file.c_str()); }
|
inline dword GetFiletime(const std::string& file) { return GetFiletime(file.c_str()); }
|
||||||
|
@ -96,7 +96,7 @@ long GetFilesize(const char* file) {
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Convert time returned with stat to FFTime
|
// Convert time returned with stat to FFTime
|
||||||
|
|
||||||
dword gfixstattime(time_t st_time) {
|
dword gfixstattime(time32_t st_time) {
|
||||||
|
|
||||||
#if (defined(__MINGW32__) && !defined(__MSVCRT__)) || defined(__CYGWIN__)
|
#if (defined(__MINGW32__) && !defined(__MSVCRT__)) || defined(__CYGWIN__)
|
||||||
struct tm &f = *ggmtime(&st_time);
|
struct tm &f = *ggmtime(&st_time);
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
struct tm* glog::time_now;
|
struct tm* glog::time_now;
|
||||||
int glog::count = 0;
|
int glog::count = 0;
|
||||||
time_t glog::secs_now;
|
time32_t glog::secs_now;
|
||||||
char glog::timebuf[20];
|
char glog::timebuf[20];
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ void glog::printf(const char* format, ...) {
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
char logbuf[256];
|
char logbuf[256];
|
||||||
|
|
||||||
secs_now = time(NULL);
|
secs_now = gtime(NULL);
|
||||||
time_now = glocaltime(&secs_now);
|
time_now = glocaltime(&secs_now);
|
||||||
|
|
||||||
lineswritten++;
|
lineswritten++;
|
||||||
|
@ -61,7 +61,7 @@ private:
|
|||||||
|
|
||||||
static int count;
|
static int count;
|
||||||
static struct tm* time_now;
|
static struct tm* time_now;
|
||||||
static time_t secs_now;
|
static time32_t secs_now;
|
||||||
static char timebuf[20];
|
static char timebuf[20];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -123,40 +123,54 @@ extern const char* gmonths[];
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Prototypes
|
// Prototypes
|
||||||
|
|
||||||
inline struct tm *ggmtime(const time_t *timep)
|
inline struct tm *ggmtime(const time32_t *timep)
|
||||||
{
|
{
|
||||||
|
const time_t temp(*timep);
|
||||||
#if defined(__WIN32__)
|
#if defined(__WIN32__)
|
||||||
const time_t zero(0);
|
const time_t zero(0);
|
||||||
struct tm *time = gmtime(timep);
|
struct tm *time = gmtime(&temp);
|
||||||
return time ? time : gmtime(&zero);
|
return time ? time : gmtime(&zero);
|
||||||
#else
|
#else
|
||||||
return gmtime(&timep);
|
return gmtime(&temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline struct tm* glocaltime(const time_t *timep)
|
inline struct tm *glocaltime(const time32_t *timep)
|
||||||
{
|
{
|
||||||
|
const time_t temp(*timep);
|
||||||
#if defined(__WIN32__)
|
#if defined(__WIN32__)
|
||||||
const time_t zero(0);
|
const time_t zero(0);
|
||||||
struct tm *time = localtime(timep);
|
struct tm *time = localtime(&temp);
|
||||||
return time ? time : localtime(&zero);
|
return time ? time : localtime(&zero);
|
||||||
#else
|
#else
|
||||||
return localtime(timep);
|
return localtime(&temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline struct tm* ggmtime(const time32_t *timep)
|
inline char *gctime(const time32_t *timep)
|
||||||
{
|
{
|
||||||
const time_t temp(*timep);
|
const time_t temp(*timep);
|
||||||
return ggmtime(&temp);
|
#if defined(__WIN32__)
|
||||||
|
const time_t zero(0);
|
||||||
|
char *time = ctime(&temp);
|
||||||
|
return time ? time : ctime(&zero);
|
||||||
|
#else
|
||||||
|
return ctime(&temp);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline struct tm* glocaltime(const time32_t *timep)
|
inline time32_t gtime(time32_t *timep)
|
||||||
{
|
{
|
||||||
const time_t temp(*timep);
|
time32_t temp = (time32_t)time(NULL);
|
||||||
return glocaltime(&temp);
|
return timep ? *timep = temp : temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline time32_t gmktime(struct tm *timep)
|
||||||
|
{
|
||||||
|
return (time32_t)mktime(timep);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__OS2__)
|
#if defined(__OS2__)
|
||||||
inline void usleep(long duration) { DosSleep(duration); }
|
inline void usleep(long duration) { DosSleep(duration); }
|
||||||
#elif defined(__MINGW32__) || defined(_MSC_VER)
|
#elif defined(__MINGW32__) || defined(_MSC_VER)
|
||||||
@ -178,13 +192,13 @@ int tzoffset();
|
|||||||
|
|
||||||
char* strftimei(char* s, size_t maxsize, const char* fmt, const struct tm* t); // __attribute__ ((format (strftime, 3, 0)));
|
char* strftimei(char* s, size_t maxsize, const char* fmt, const struct tm* t); // __attribute__ ((format (strftime, 3, 0)));
|
||||||
|
|
||||||
FTime TimeToFTime(time_t __time) __attribute__ ((const));
|
FTime TimeToFTime(time32_t __time) __attribute__ ((const));
|
||||||
time_t FTimeToTime(FTime* __ftime, struct tm* __tm=NULL);
|
time32_t FTimeToTime(FTime* __ftime, struct tm* __tm=NULL);
|
||||||
|
|
||||||
time_t FidoTimeToUnix(char* __fidotime);
|
time32_t FidoTimeToUnix(char* __fidotime);
|
||||||
|
|
||||||
char* FTimeToStr(char* buf, FTime &t);
|
char* FTimeToStr(char* buf, FTime &t);
|
||||||
char* TimeToStr(char* buf, time_t t);
|
char* TimeToStr(char* buf, time32_t t);
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -60,10 +60,10 @@ const char* gmonths[] = {
|
|||||||
|
|
||||||
int tzoffset() {
|
int tzoffset() {
|
||||||
|
|
||||||
time_t t1 = time(NULL);
|
time32_t t1 = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&t1);
|
struct tm *tp = ggmtime(&t1);
|
||||||
tp->tm_isdst=-1;
|
tp->tm_isdst = -1;
|
||||||
time_t t2 = mktime(tp);
|
time32_t t2 = gmktime(tp);
|
||||||
int dt = (int)(t1 - t2);
|
int dt = (int)(t1 - t2);
|
||||||
return (dt / 3600) * 100 + (dt % 3600) / 60;
|
return (dt / 3600) * 100 + (dt % 3600) / 60;
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ int str2mon(const char* ptr) {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
time_t FTimeToTime(FTime* __ftime, struct tm* __tm) {
|
time32_t FTimeToTime(FTime* __ftime, struct tm* __tm) {
|
||||||
|
|
||||||
struct tm _tm;
|
struct tm _tm;
|
||||||
ulong _time = 0;
|
ulong _time = 0;
|
||||||
@ -350,10 +350,10 @@ time_t FTimeToTime(FTime* __ftime, struct tm* __tm) {
|
|||||||
__tm->tm_sec = __ftime->ft_tsec * 2;
|
__tm->tm_sec = __ftime->ft_tsec * 2;
|
||||||
__tm->tm_isdst = -1;
|
__tm->tm_isdst = -1;
|
||||||
|
|
||||||
time_t a = mktime(__tm);
|
time32_t a = gmktime(__tm);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
_time = a + a - b;
|
_time = a + a - b;
|
||||||
|
|
||||||
if(_time == (ulong)0xFFFFFFFFL)
|
if(_time == (ulong)0xFFFFFFFFL)
|
||||||
@ -368,7 +368,7 @@ time_t FTimeToTime(FTime* __ftime, struct tm* __tm) {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
FTime TimeToFTime(time_t __time) {
|
FTime TimeToFTime(time32_t __time) {
|
||||||
|
|
||||||
FTime _ft;
|
FTime _ft;
|
||||||
memset(&_ft, 0, sizeof(FTime));
|
memset(&_ft, 0, sizeof(FTime));
|
||||||
@ -390,7 +390,7 @@ FTime TimeToFTime(time_t __time) {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
time_t FidoTimeToUnix(char* ptr) {
|
time32_t FidoTimeToUnix(char* ptr) {
|
||||||
|
|
||||||
bool date_ok = false;
|
bool date_ok = false;
|
||||||
int year=0, month=0, day=0;
|
int year=0, month=0, day=0;
|
||||||
@ -441,10 +441,10 @@ time_t FidoTimeToUnix(char* ptr) {
|
|||||||
t.tm_min = minute;
|
t.tm_min = minute;
|
||||||
t.tm_sec = second;
|
t.tm_sec = second;
|
||||||
t.tm_isdst = -1;
|
t.tm_isdst = -1;
|
||||||
time_t a = mktime(&t);
|
time32_t a = gmktime(&t);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
return a + a - b;
|
return a + a - b;
|
||||||
}
|
}
|
||||||
return (ulong)-1;
|
return (ulong)-1;
|
||||||
@ -453,7 +453,7 @@ time_t FidoTimeToUnix(char* ptr) {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
char* TimeToStr(char* buf, time_t t) {
|
char* TimeToStr(char* buf, time32_t t) {
|
||||||
|
|
||||||
return strftimei(buf, 20, "%Y-%m-%d %H:%M:%S", ggmtime(&t));
|
return strftimei(buf, 20, "%Y-%m-%d %H:%M:%S", ggmtime(&t));
|
||||||
}
|
}
|
||||||
|
@ -300,9 +300,9 @@ struct areas_record_type {
|
|||||||
byte days; /* days to keep messages */
|
byte days; /* days to keep messages */
|
||||||
word msgs; /* num messages to keep */
|
word msgs; /* num messages to keep */
|
||||||
struct im_stats stats; /* statistics */
|
struct im_stats stats; /* statistics */
|
||||||
time_t creation; /* date/time of statistic start */
|
time32_t creation; /* date/time of statistic start */
|
||||||
time_t update; /* last update by midnight update */
|
time32_t update; /* last update by midnight update */
|
||||||
time_t marked; /* used by kill dead */
|
time32_t marked; /* used by kill dead */
|
||||||
byte kill_dead; /* kill echos without traffic */
|
byte kill_dead; /* kill echos without traffic */
|
||||||
word read_sec; /* Security level for read access */
|
word read_sec; /* Security level for read access */
|
||||||
word write_sec; /* Security level for write access */
|
word write_sec; /* Security level for write access */
|
||||||
|
@ -229,7 +229,7 @@ struct im_config_type {
|
|||||||
bit ulnk_hudson_passth:1; /* unlinked Hudson areas passth */
|
bit ulnk_hudson_passth:1; /* unlinked Hudson areas passth */
|
||||||
bit compr_before_unpack:1; /* compress before unpacking */
|
bit compr_before_unpack:1; /* compress before unpacking */
|
||||||
bit rsvd3:1; /* reserved */
|
bit rsvd3:1; /* reserved */
|
||||||
time_t last_run; /* last maintenance run */
|
time32_t last_run; /* last maintenance run */
|
||||||
word rsvd4; /* reserved */
|
word rsvd4; /* reserved */
|
||||||
byte rsvd5; /* reserved */
|
byte rsvd5; /* reserved */
|
||||||
byte rsvd6; /* reserved */
|
byte rsvd6; /* reserved */
|
||||||
@ -322,9 +322,9 @@ struct areas_record_type
|
|||||||
byte days; /* days to keep messages */
|
byte days; /* days to keep messages */
|
||||||
word msgs; /* num messages to keep */
|
word msgs; /* num messages to keep */
|
||||||
struct im_stats stats; /* statistics */
|
struct im_stats stats; /* statistics */
|
||||||
time_t creation; /* date/time of statistic start */
|
time32_t creation; /* date/time of statistic start */
|
||||||
time_t update; /* last update by midnight update */
|
time32_t update; /* last update by midnight update */
|
||||||
time_t marked; /* used by kill dead */
|
time32_t marked; /* used by kill dead */
|
||||||
byte kill_dead; /* kill echos without traffic */
|
byte kill_dead; /* kill echos without traffic */
|
||||||
word read_sec; /* Security level for read access */
|
word read_sec; /* Security level for read access */
|
||||||
word write_sec; /* Security level for write access */
|
word write_sec; /* Security level for write access */
|
||||||
|
@ -505,10 +505,10 @@ typedef struct _user_info
|
|||||||
USHORT computer_type;
|
USHORT computer_type;
|
||||||
ULONG userid;
|
ULONG userid;
|
||||||
USHORT pointid;
|
USHORT pointid;
|
||||||
time_t initial_logon;
|
time32_t initial_logon;
|
||||||
time_t expires;
|
time32_t expires;
|
||||||
time_t last_logon;
|
time32_t last_logon;
|
||||||
time_t logon_today;
|
time32_t logon_today;
|
||||||
USHORT birthyear;
|
USHORT birthyear;
|
||||||
UCHAR birthmonth;
|
UCHAR birthmonth;
|
||||||
UCHAR birthday;
|
UCHAR birthday;
|
||||||
@ -551,8 +551,8 @@ typedef struct _user_info
|
|||||||
SHORT CallsToday;
|
SHORT CallsToday;
|
||||||
LONG TotalMinsEver;
|
LONG TotalMinsEver;
|
||||||
LONG NetmailDebits;
|
LONG NetmailDebits;
|
||||||
time_t LastPWChange;
|
time32_t LastPWChange;
|
||||||
time_t LastListedNewFiles; //JM940822
|
time32_t LastListedNewFiles; //JM940822
|
||||||
ULONG FileKCredit;
|
ULONG FileKCredit;
|
||||||
CHAR UnixId[8];
|
CHAR UnixId[8];
|
||||||
CHAR Country[24];
|
CHAR Country[24];
|
||||||
@ -591,7 +591,7 @@ typedef struct _xmsg
|
|||||||
CHAR indate[4]; /* import date (YMD(null)) */
|
CHAR indate[4]; /* import date (YMD(null)) */
|
||||||
ULONG msgnum;
|
ULONG msgnum;
|
||||||
ULONG timesread;
|
ULONG timesread;
|
||||||
time_t timerecv;
|
time32_t timerecv;
|
||||||
ULONG length; /* Length of message */
|
ULONG length; /* Length of message */
|
||||||
LONG start; /* Starting postition in text file */
|
LONG start; /* Starting postition in text file */
|
||||||
ULONG OrigMsg;
|
ULONG OrigMsg;
|
||||||
|
@ -97,10 +97,10 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
|
|||||||
__msg->written = __msg->written ? __msg->written : FidoTimeToUnix(__hdr.datetime);
|
__msg->written = __msg->written ? __msg->written : FidoTimeToUnix(__hdr.datetime);
|
||||||
|
|
||||||
if(__msg->arrived == 0) {
|
if(__msg->arrived == 0) {
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->arrived = a + a - b;
|
__msg->arrived = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,10 +134,10 @@ int _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::load_message(in
|
|||||||
_tm.tm_min = _minute;
|
_tm.tm_min = _minute;
|
||||||
_tm.tm_sec = 0;
|
_tm.tm_sec = 0;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
time32_t a = gmktime(&_tm);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->written = a + a - b;
|
__msg->written = a + a - b;
|
||||||
__msg->arrived = 0;
|
__msg->arrived = 0;
|
||||||
|
|
||||||
|
@ -152,10 +152,10 @@ void JamArea::open_area() {
|
|||||||
|
|
||||||
// Initialize header info
|
// Initialize header info
|
||||||
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
|
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
|
||||||
time_t a = time(NULL);
|
time32_t a = gtime(NULL);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
data->hdrinfo.datecreated = a + a - b;
|
data->hdrinfo.datecreated = a + a - b;
|
||||||
data->hdrinfo.passwordcrc = 0xFFFFFFFFL;
|
data->hdrinfo.passwordcrc = 0xFFFFFFFFL;
|
||||||
data->hdrinfo.basemsgnum = 1;
|
data->hdrinfo.basemsgnum = 1;
|
||||||
|
@ -79,10 +79,10 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
|
|||||||
_tm.tm_min = _minute;
|
_tm.tm_min = _minute;
|
||||||
_tm.tm_sec = 0;
|
_tm.tm_sec = 0;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
time32_t a = gmktime(&_tm);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->written = a + a - b;
|
__msg->written = a + a - b;
|
||||||
__msg->arrived = 0;
|
__msg->arrived = 0;
|
||||||
|
|
||||||
|
@ -324,13 +324,13 @@ int SMBArea::load_hdr(gmsg* __msg, smbmsg_t *smsg)
|
|||||||
__msg->attr.cfm(smsgp->hdr.auxattr & MSG_CONFIRMREQ);
|
__msg->attr.cfm(smsgp->hdr.auxattr & MSG_CONFIRMREQ);
|
||||||
__msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE);
|
__msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE);
|
||||||
|
|
||||||
time_t a = smsgp->hdr.when_written.time;
|
time32_t a = smsgp->hdr.when_written.time;
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->written = a + a - b;
|
__msg->written = a + a - b;
|
||||||
a = smsgp->hdr.when_imported.time;
|
a = smsgp->hdr.when_imported.time;
|
||||||
b = mktime(ggmtime(&a));
|
b = gmktime(ggmtime(&a));
|
||||||
__msg->arrived = a + a - b;
|
__msg->arrived = a + a - b;
|
||||||
__msg->received = 0;
|
__msg->received = 0;
|
||||||
|
|
||||||
@ -538,9 +538,9 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
|
|||||||
smsg.hdr.version = smb_ver();
|
smsg.hdr.version = smb_ver();
|
||||||
struct tm *tp = ggmtime(&msg->written);
|
struct tm *tp = ggmtime(&msg->written);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
smsg.hdr.when_written.time = mktime(tp);
|
smsg.hdr.when_written.time = gmktime(tp);
|
||||||
}
|
}
|
||||||
smsg.hdr.when_imported.time = time(NULL);
|
smsg.hdr.when_imported.time = gtime(NULL);
|
||||||
|
|
||||||
// Transfer attributes
|
// Transfer attributes
|
||||||
if(msg->attr.pvt()) smsg.hdr.attr |= MSG_PRIVATE;
|
if(msg->attr.pvt()) smsg.hdr.attr |= MSG_PRIVATE;
|
||||||
@ -968,9 +968,9 @@ Line* SMBArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
|
|||||||
line = AddLineF(line, "Attr : %04Xh", smsg.hdr.attr);
|
line = AddLineF(line, "Attr : %04Xh", smsg.hdr.attr);
|
||||||
line = AddLineF(line, "AUXAttr : %04Xh", smsg.hdr.auxattr);
|
line = AddLineF(line, "AUXAttr : %04Xh", smsg.hdr.auxattr);
|
||||||
line = AddLineF(line, "NetAttr : %04Xh", smsg.hdr.netattr);
|
line = AddLineF(line, "NetAttr : %04Xh", smsg.hdr.netattr);
|
||||||
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_written.time))[-1] = NUL;
|
stpcpy(buf, gctime(&smsg.hdr.when_written.time))[-1] = NUL;
|
||||||
line = AddLineF(line, "Written : %s", buf);
|
line = AddLineF(line, "Written : %s", buf);
|
||||||
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_imported.time))[-1] = NUL;
|
stpcpy(buf, gctime(&smsg.hdr.when_imported.time))[-1] = NUL;
|
||||||
line = AddLineF(line, "Imported : %s", buf);
|
line = AddLineF(line, "Imported : %s", buf);
|
||||||
line = AddLineF(line, "Number : %d (%d)", smsg.hdr.number, (int32_t)(ftell(data->sid_fp)/sizeof(idxrec_t)));
|
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 orig : %d", smsg.hdr.thread_orig);
|
||||||
|
@ -128,7 +128,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
|
|||||||
__msg->dest.point = __msg->odest.point = __hdr.dest.point;
|
__msg->dest.point = __msg->odest.point = __hdr.dest.point;
|
||||||
|
|
||||||
// Convert date and time
|
// Convert date and time
|
||||||
time_t _written = FTimeToTime(&__hdr.date_written);
|
time32_t _written = FTimeToTime(&__hdr.date_written);
|
||||||
__msg->written = _written ? _written : FidoTimeToUnix(__hdr.ftsc_date);
|
__msg->written = _written ? _written : FidoTimeToUnix(__hdr.ftsc_date);
|
||||||
__msg->arrived = FTimeToTime(&__hdr.date_arrived);
|
__msg->arrived = FTimeToTime(&__hdr.date_arrived);
|
||||||
|
|
||||||
|
@ -103,10 +103,10 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
|
|||||||
_tm.tm_min = _minute;
|
_tm.tm_min = _minute;
|
||||||
_tm.tm_sec = _second;
|
_tm.tm_sec = _second;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
time32_t a = gmktime(&_tm);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->written = a + a - b;
|
__msg->written = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,10 +123,10 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
|
|||||||
_tm.tm_min = _minute;
|
_tm.tm_min = _minute;
|
||||||
_tm.tm_sec = _second;
|
_tm.tm_sec = _second;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
time32_t a = gmktime(&_tm);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->received = a + a - b;
|
__msg->received = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,10 +72,10 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
|
|||||||
t.tm_mday = __hdr.indate[2];
|
t.tm_mday = __hdr.indate[2];
|
||||||
t.tm_hour = t.tm_min = t.tm_sec = 0;
|
t.tm_hour = t.tm_min = t.tm_sec = 0;
|
||||||
t.tm_isdst = -1;
|
t.tm_isdst = -1;
|
||||||
time_t a = mktime(&t);
|
time32_t a = gmktime(&t);
|
||||||
struct tm *tp = ggmtime(&a);
|
struct tm *tp = ggmtime(&a);
|
||||||
tp->tm_isdst = -1;
|
tp->tm_isdst = -1;
|
||||||
time_t b = mktime(tp);
|
time32_t b = gmktime(tp);
|
||||||
__msg->arrived = a + a - b;
|
__msg->arrived = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ typedef int16_t sshort;
|
|||||||
typedef uint16_t ushort;
|
typedef uint16_t ushort;
|
||||||
|
|
||||||
typedef uint32_t dword;
|
typedef uint32_t dword;
|
||||||
|
typedef uint32_t time32_t; /* 32-bit time_t type */
|
||||||
|
|
||||||
#endif //#ifndef __goldall_h
|
#endif //#ifndef __goldall_h
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -143,7 +143,7 @@ const word _TEST = 777;
|
|||||||
|
|
||||||
static std::string nodepath; // Path to the nodelist files
|
static std::string nodepath; // Path to the nodelist files
|
||||||
|
|
||||||
static time_t runtime = 0;
|
static time32_t runtime = 0;
|
||||||
static int sh_mod = SH_DENYWR;
|
static int sh_mod = SH_DENYWR;
|
||||||
static bool fidouser = false;
|
static bool fidouser = false;
|
||||||
static Path fidouserlst;
|
static Path fidouserlst;
|
||||||
@ -1017,7 +1017,7 @@ static void read_nodelists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note compile time
|
// Note compile time
|
||||||
runtime = time(NULL) - runtime;
|
runtime = gtime(NULL) - runtime;
|
||||||
|
|
||||||
if(not quiet) {
|
if(not quiet) {
|
||||||
if(dups) {
|
if(dups) {
|
||||||
@ -1051,7 +1051,7 @@ static void check_nodelists(bool force) {
|
|||||||
strcpy(ext, ".*");
|
strcpy(ext, ".*");
|
||||||
gposixdir f(newpath);
|
gposixdir f(newpath);
|
||||||
const gdirentry *de;
|
const gdirentry *de;
|
||||||
time_t listtime = 0;
|
time32_t listtime = 0;
|
||||||
bool listdefined = false;
|
bool listdefined = false;
|
||||||
while((de = f.nextentry(buf)) != NULL)
|
while((de = f.nextentry(buf)) != NULL)
|
||||||
if(atoi(de->name.c_str()+extpos)) {
|
if(atoi(de->name.c_str()+extpos)) {
|
||||||
|
Reference in New Issue
Block a user