#include #include #include #include #include #include #include #include #include "mfjterm.h" #include "misc.h" #include "inout.h" int chk_time(int mode) { char locstr[81], utcstr[31]; time_t timer; struct tm *tblk; timer = time(NULL); tblk = localtime(&timer); if (tblk->tm_min != old_min) { old_min = tblk->tm_min; strftime(locstr, 80, "%y%m%d %H:%M LOCAL ", tblk); tblk = gmtime(&timer); strftime(utcstr, 30, "%y%m%d %H:%M UTC", tblk); strcat(locstr, utcstr); attrset(A_REVERSE); if (mode) curs_set(0); move(0, 1); addstr(locstr); refresh(); move(tnc_y, tnc_x); if (mode) curs_set(1); attrset(A_NORMAL); refresh(); return 1; } return 0; } void send_daytime(void) { char daytimestr[21]; time_t t; struct tm *tblk; t = time(NULL); tblk = localtime(&t); strftime(daytimestr, 20, "DAYTIME %y%m%d%H%M", tblk); send_string(daytimestr, 1); } void zleep(int ticks) { static clock_t clk; clk = clock(); while ((int)((clock() - clk)) < ticks); } .