All gmtime and localtime calls was rewritten to internal defined functions

This commit is contained in:
Ianos Gnatiuc
2005-10-17 19:51:33 +00:00
parent d5b32cade9
commit 50c20ae93d
32 changed files with 87 additions and 79 deletions

View File

@@ -98,7 +98,7 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
if(__msg->arrived == 0) {
time_t a = time(NULL);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->arrived = a + a - b;

View File

@@ -168,7 +168,7 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
__hdr.opus.written = TimeToFTime(__msg->written);
__hdr.opus.arrived = TimeToFTime(__msg->arrived);
}
struct tm* _tm = gmtime(&__msg->written);
struct tm* _tm = ggmtime(&__msg->written);
sprintf(__hdr.datetime, "%02d %3s %02d %02d:%02d:%02d",
_tm->tm_mday, gmonths[_tm->tm_mon+1], _tm->tm_year % 100,
_tm->tm_hour, _tm->tm_min, _tm->tm_sec

View File

@@ -135,7 +135,7 @@ int _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::load_message(in
_tm.tm_sec = 0;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->written = a + a - b;

View File

@@ -127,7 +127,7 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
__hdr.replyto = (msgn_t)__msg->link.to();
__hdr.reply1st = (msgn_t)__msg->link.first();
struct tm* _tmp = gmtime(&__msg->written);
struct tm* _tmp = ggmtime(&__msg->written);
strc2p(strftimei(__hdr.date, 9, "%m-%d-%y", _tmp));
strc2p(strftimei(__hdr.time, 6, "%H:%M", _tmp));

View File

@@ -153,7 +153,7 @@ void JamArea::open_area() {
// Initialize header info
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
time_t a = time(NULL);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
data->hdrinfo.datecreated = a + a - b;

View File

@@ -80,7 +80,7 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
_tm.tm_sec = 0;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->written = a + a - b;

View File

@@ -158,13 +158,13 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Convert dates and times
char _dtbuf[9];
struct tm* _tm = gmtime(&__msg->written);
struct tm* _tm = ggmtime(&__msg->written);
memcpy(__hdr.date, strftimei(_dtbuf, 9, __msg->attr.uns() ? "%d-%m-%y" : "%d-%m\xC4%y", _tm), 8);
memcpy(__hdr.time, strftimei(_dtbuf, 6, "%H:%M", _tm), 5);
_idx.date = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
if(__msg->link.first()) {
__hdr.hasreply = 'R';
_tm = gmtime(&__msg->pcboard.reply_written);
_tm = ggmtime(&__msg->pcboard.reply_written);
int _year = _tm->tm_year % 100;
__hdr.replydate = L2B((10000L*_year) + (100L*(_tm->tm_mon+1)) + _tm->tm_mday);
memcpy(__hdr.replytime, strftimei(_dtbuf, 6, "%H:%M", _tm), 5);

View File

@@ -325,12 +325,12 @@ int SMBArea::load_hdr(gmsg* __msg, smbmsg_t *smsg)
__msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE);
time_t a = smsgp->hdr.when_written.time;
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->written = a + a - b;
a = smsgp->hdr.when_imported.time;
b = mktime(gmtime(&a));
b = mktime(ggmtime(&a));
__msg->arrived = a + a - b;
__msg->received = 0;
@@ -536,7 +536,7 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
else {
memcpy(smsg.hdr.id, "SHD\x1a", 4);
smsg.hdr.version = smb_ver();
struct tm *tp = gmtime(&msg->written);
struct tm *tp = ggmtime(&msg->written);
tp->tm_isdst = -1;
smsg.hdr.when_written.time = mktime(tp);
}

View File

@@ -437,7 +437,7 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
__hdr.date_written = TimeToFTime(__msg->written);
__hdr.date_arrived = TimeToFTime(__msg->arrived);
struct tm* _tm = gmtime(&__msg->written);
struct tm* _tm = ggmtime(&__msg->written);
sprintf(__hdr.ftsc_date, "%02d %3s %02d %02d:%02d:%02d",
_tm->tm_mday, gmonths[_tm->tm_mon+1], _tm->tm_year % 100,
_tm->tm_hour, _tm->tm_min, _tm->tm_sec

View File

@@ -104,7 +104,7 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
_tm.tm_sec = _second;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->written = a + a - b;
@@ -124,7 +124,7 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
_tm.tm_sec = _second;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->received = a + a - b;

View File

@@ -119,13 +119,13 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
strc2p(strcpy(__hdr.network, __msg->wildcat.network));
if(__msg->written) {
struct tm* _tm = gmtime(&__msg->written);
struct tm* _tm = ggmtime(&__msg->written);
__hdr.msgdate = (word)(YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday)-1);
__hdr.msgtime = ((_tm->tm_hour*3600L)+(_tm->tm_min*60L)+_tm->tm_sec)+1;
}
if(__msg->received) {
struct tm* _tm = gmtime(&__msg->received);
struct tm* _tm = ggmtime(&__msg->received);
__hdr.readdate = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readtime = ((_tm->tm_hour*3600L)+(_tm->tm_min*60L)+_tm->tm_sec)+1;
}

View File

@@ -77,8 +77,8 @@ Line* WCatArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
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, %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, "MsgTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", ggmtime(&msg->written)), _hdr.msgdate, _hdr.msgtime);
AddLineF(line, "ReadTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", ggmtime(&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);

View File

@@ -73,7 +73,7 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
t.tm_hour = t.tm_min = t.tm_sec = 0;
t.tm_isdst = -1;
time_t a = mktime(&t);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
__msg->arrived = a + a - b;

View File

@@ -135,13 +135,13 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
strxcpy(__hdr.to, __msg->to, sizeof(__hdr.to));
strxcpy(__hdr.subj, __msg->re, sizeof(__hdr.subj));
struct tm* _tm = gmtime(&__msg->written);
struct tm* _tm = ggmtime(&__msg->written);
sprintf(__hdr.date, "%02d %3s %02d %02d:%02d:%02d",
_tm->tm_mday, gmonths[_tm->tm_mon+1], _tm->tm_year % 100,
_tm->tm_hour, _tm->tm_min, _tm->tm_sec
);
if(__msg->arrived)
_tm = gmtime(&__msg->arrived);
_tm = ggmtime(&__msg->arrived);
__hdr.indate[0] = (byte)(_tm->tm_year - 89);
__hdr.indate[1] = (byte)(_tm->tm_mon + 1);
__hdr.indate[2] = (byte)(_tm->tm_mday);