]> Pileus Git - lackey/blobdiff - src/main.c
Fix some time keeping bugs
[lackey] / src / main.c
index 1327a8240a6327882cb237a3800cf8b39224ffc3..6ae9798fed3509ed9374c44f65bc388d24bb4e25 100644 (file)
 #include <stdarg.h>
 #include <stdlib.h>
 #include <signal.h>
+#include <time.h>
 #include <ncurses.h>
 
 #include "main.h"
 #include "screen.h"
 
+/* Debugging */
+int YEAR  = 2012;
+int MONTH = 8;
+int DAY   = 29;
+
 /* Static data */
 static FILE *debug_fd = NULL;
 
@@ -83,6 +89,13 @@ int main(int argc, char **argv)
        act.sa_handler = on_sigwinch;
        sigaction(SIGWINCH, &act, NULL);
 
+       /* Time setup */
+       time_t sec = time(NULL);
+       struct tm *tm = localtime(&sec);
+       YEAR  = tm->tm_year+1900;
+       MONTH = tm->tm_mon;
+       DAY   = tm->tm_mday-1;
+
        /* Curses setup */
        initscr();
        cbreak();