]> Pileus Git - lackey/blobdiff - src/main.c
Start on events and calendars
[lackey] / src / main.c
index 20bea55e766185ee350f0ab0e1982231b4ab5b74..6daa8f8cfcfcdf9770065c6948758d397ce1ffb5 100644 (file)
 #include "screen.h"
 
 /* Debugging */
-year_t  YEAR  = 2012;
-month_t MONTH = 8;
-day_t   DAY   = 29;
+year_t   YEAR   = 2012;
+month_t  MONTH  = 8;
+day_t    DAY    = 29;
+
+event_t *EVENTS = NULL;
 
 /* Static data */
 static FILE *debug_fd = NULL;
@@ -74,9 +76,11 @@ int main(int argc, char **argv)
        /* 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;
+       YEAR   = tm->tm_year+1900;
+       MONTH  = tm->tm_mon;
+       DAY    = tm->tm_mday-1;
+
+       EVENTS = event_get(2012, JAN, 0, 366);
 
        /* Curses setup */
        setlocale(LC_ALL, "");
@@ -92,6 +96,12 @@ int main(int argc, char **argv)
        screen_init();
        screen_draw();
 
+       /* Debug */
+       for (event_t *e = EVENTS; e; e = e->next)
+               debug("event: %04d-%02d-%02d %02d:%02d: %s - %s\n",
+                               e->start.year, e->start.month, e->start.day,
+                               e->start.hour, e->start.min, e->name, e->desc);
+
        /* Run */
        while (1) {
                MEVENT btn;