X-Git-Url: http://pileus.org/git/?p=lackey;a=blobdiff_plain;f=src%2Fmain.c;h=6daa8f8cfcfcdf9770065c6948758d397ce1ffb5;hp=20bea55e766185ee350f0ab0e1982231b4ab5b74;hb=c222556b46998f2eb2466ded089c1b01091c88a6;hpb=bfc7ff1dff587b125bd3e0a58d6fa4a895842302 diff --git a/src/main.c b/src/main.c index 20bea55..6daa8f8 100644 --- a/src/main.c +++ b/src/main.c @@ -26,9 +26,11 @@ #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;