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

@@ -575,7 +575,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
line->kludge = GKLUD_RFC;
}
struct tm* tm = gmtime(&msg->written);
struct tm* tm = ggmtime(&msg->written);
sprintf(buf, "%sDate: %s, %02d %s %04d %02d:%02d:%02d", rfc,
__gsweekday[tm->tm_wday],
tm->tm_mday, __gsmonth[tm->tm_mon], 1900+tm->tm_year,

View File

@@ -177,7 +177,7 @@ void DispHeader(GMsg* msg, bool prn, FILE* fp, int width) {
strsetsz(buf1, nodewidth);
if(msg->written)
strftimei(buf2, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->written));
strftimei(buf2, CFG->disphdrdateset.len, LNG->DateTimeFmt, ggmtime(&msg->written));
strsetsz(buf2, datewidth);
// write from line
@@ -206,7 +206,7 @@ void DispHeader(GMsg* msg, bool prn, FILE* fp, int width) {
strsetsz(buf2, nodewidth);
if(msg->arrived)
strftimei(buf2, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->arrived));
strftimei(buf2, CFG->disphdrdateset.len, LNG->DateTimeFmt, ggmtime(&msg->arrived));
strsetsz(buf2, datewidth);
// write to line

View File

@@ -798,7 +798,7 @@ void KludgeDATE(GMsg* msg, const char* ptr) {
t.tm_sec = second;
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->written = a + a - b;

View File

@@ -321,7 +321,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
case MSGLISTDATE_RECEIVED: dt = ml->received; break;
}
if(dt)
strftimei(dbuf, 20, "%d %b %y", gmtime(&dt));
strftimei(dbuf, 20, "%d %b %y", ggmtime(&dt));
if(AA->Msglistdate())
strsetsz(dbuf, 10);
else
@@ -909,7 +909,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
}
if(dt)
strftimei(dbuf, 20, "%d %b %y", gmtime(&dt));
strftimei(dbuf, 20, "%d %b %y", ggmtime(&dt));
strcat(buf, dbuf);
}
strcat(buf, " ");

View File

@@ -107,14 +107,14 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
const char *osver = ggetosstring();
time_t t = time(NULL);
struct tm* written_tm = localtime(&t);
struct tm* written_tm = glocaltime(&t);
char cdate[80];
strftimei(cdate, 80, LNG->DateFmt, written_tm);
char ctime[80];
strftimei(ctime, 80, LNG->TimeFmt, written_tm);
char cdtime[80];
strftimei(cdtime, 80, LNG->DateTimeFmt, written_tm);
written_tm = gmtime(&oldmsg->written);
written_tm = ggmtime(&oldmsg->written);
char odate[80];
strftimei(odate, 80, LNG->DateFmt, written_tm);
char otime[80];

View File

@@ -244,7 +244,7 @@ static void MakeMsg3(int& mode, GMsg* msg) {
// Do Timefields
if(msg->attr.fmu()) {
time_t a = time(NULL);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
a += a - b;
@@ -825,7 +825,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
}
if(dochgdate) {
time_t a = time(NULL);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
a += a - b;

View File

@@ -209,12 +209,12 @@ int ImportQWK() {
_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;
a = time(NULL);
tp = gmtime(&a);
tp = ggmtime(&a);
tp->tm_isdst = -1;
b = mktime(tp);
msg->arrived = a + a - b;
@@ -369,7 +369,7 @@ int ExportQwkMsg(GMsg* msg, gfile& fp, int confno, int& pktmsgno) {
hdr.status = msg->attr.pvt() ? '*' : ' ';
sprintf(buf, "%u", confno);
memcpy(hdr.msgno, buf, strlen(buf));
struct tm* _tm = gmtime(&msg->written);
struct tm* _tm = ggmtime(&msg->written);
int _year = _tm->tm_year % 100;
sprintf(buf, "%02d-%02d-%02d", _tm->tm_mon+1, _tm->tm_mday, _year);
memcpy(hdr.date, buf, 8);

View File

@@ -1175,7 +1175,7 @@ int LoadMessage(GMsg* msg, int margin) {
reader_rcv_noise = 1;
if(not msg->attr.rcv()) { // Have we seen it?
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->received = a + a - b; // Get current date
@@ -1419,7 +1419,7 @@ void GotoReplies() {
sprintf(rlist[replies].addr, " (%s) ", buf);
}
maxaddr = MaxV(maxaddr, (uint)strlen(rlist[replies].addr));
strftimei(rlist[replies].written, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&rmsg->written));
strftimei(rlist[replies].written, CFG->disphdrdateset.len, LNG->DateTimeFmt, ggmtime(&rmsg->written));
maxwritten = MaxV(maxwritten, (uint)strlen(rlist[replies].written));
rlist[replies].reln = reln;
replies++;

View File

@@ -172,7 +172,7 @@ 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->dest = msg->odest = AA->aka();
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;
@@ -698,7 +698,7 @@ int ExportSoupMsg(GMsg* msg, char* msgfile, gfile& fp, int ismail) {
msg->attr.scn1();
msg->attr.uns0();
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

@@ -344,10 +344,10 @@ bool guserbase::edit_entry(uint idx) {
char dbuf[16];
time_t dt = entry.firstdate;
if(dt)
window.prints(13, 13, wattr, strftimei(dbuf, 16, "%d %b %y", gmtime(&dt)));
window.prints(13, 13, wattr, strftimei(dbuf, 16, "%d %b %y", ggmtime(&dt)));
dt = entry.lastdate;
if(dt)
window.prints(13, 38, wattr, strftimei(dbuf, 16, "%d %b %y", gmtime(&dt)));
window.prints(13, 38, wattr, strftimei(dbuf, 16, "%d %b %y", ggmtime(&dt)));
sprintf(dbuf, "%8ld", entry.times);
window.prints(13, width-11, wattr, dbuf);
@@ -428,7 +428,7 @@ void guserbase::write_entry(uint idx, bool updateit) {
if(updateit and not entry.is_deleted) {
time_t a = time(NULL);
struct tm *tp = gmtime(&a);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
entry.lastdate = a + a - b;

View File

@@ -55,7 +55,7 @@ void update_statuslines() {
if(CFG->switches.get(statuslineclock)) {
time_t t = time(NULL);
sprintf(clkinfo, " %s", strftimei(help, 40, LNG->StatusLineTimeFmt, localtime(&t)));
sprintf(clkinfo, " %s", strftimei(help, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
}
if(CFG->statuslinehelp == -1)

View File

@@ -268,7 +268,7 @@ void ScreenBlankIdle() {
char blankmsg1[80];
char blankmsg2[80];
time_t t = time(NULL);
sprintf(blankmsg1, " %s %s %s ", __gver_longpid__, __gver_ver__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, localtime(&t)));
sprintf(blankmsg1, " %s %s %s ", __gver_longpid__, __gver_ver__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
sprintf(blankmsg2, " %s ", LNG->BlankMsg);
if(strblank(blankmsg2)) {
*blankmsg2 = NUL;

View File

@@ -216,7 +216,7 @@ void GMsgHeaderView::Paint() {
if(datewidth > 0) {
if(msg->written)
strftimei(buf, datewidth, LNG->DateTimeFmt, gmtime(&msg->written));
strftimei(buf, datewidth, LNG->DateTimeFmt, ggmtime(&msg->written));
else
*buf = NUL;
strsetsz(buf, datewidth);
@@ -254,7 +254,7 @@ void GMsgHeaderView::Paint() {
if(datewidth > 0) {
if(msg->arrived)
strftimei(buf, datewidth, LNG->DateTimeFmt, gmtime(&msg->arrived));
strftimei(buf, datewidth, LNG->DateTimeFmt, ggmtime(&msg->arrived));
else
*buf = NUL;
strsetsz(buf, datewidth);