X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fcal.h;h=72bcd955db4825844db259cda32196608f9bb8a6;hb=296fd1bb5f87b1961e98c7ea4c224219012f7161;hp=83d9def58c258d56f036c02f355492cc466a5c6f;hpb=daded0f3fb930e7758e1009683c0cdb46eada3f6;p=lackey diff --git a/src/cal.h b/src/cal.h index 83d9def..72bcd95 100644 --- a/src/cal.h +++ b/src/cal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Andy Spencer + * Copyright (C) 2012-2013 Andy Spencer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,51 +22,44 @@ typedef enum { } status_t; /* Calendar type */ -typedef struct { - char *name; - char *desc; - void *data; +typedef struct cal_t { + char *type; + char *name; + char *desc; + struct cal_t *next; } cal_t; /* Calendar item types */ typedef struct event_t { - const char *name; - const char *desc; - const char *loc; - const char *cat; + char *name; + char *desc; + char *loc; + char *cat; date_t start; date_t end; const cal_t *cal; struct event_t *next; + struct event_t *prev; } event_t; typedef struct todo_t { - const char *name; - const char *desc; - const char *cat; + char *name; + char *desc; + char *cat; status_t status; date_t start; date_t due; cal_t *cal; struct todo_t *next; + struct todo_t *prev; } todo_t; /* Global data */ +extern cal_t *CALS; extern event_t *EVENTS; extern todo_t *TODOS; /* Calendar functions */ void cal_init(void); -event_t *cal_events(year_t year, month_t month, day_t day, int days); -todo_t *cal_todos(year_t year, month_t month, day_t day, int days); - -/* Calendar event functions */ -event_t *dummy_events(cal_t *cal, year_t year, month_t month, day_t day, int days); -event_t *ical_events(cal_t *cal, year_t year, month_t month, day_t day, int days); - -/* Calendar todo functions */ -todo_t *dummy_todos(cal_t *cal, year_t year, month_t month, day_t day, int days); -todo_t *ical_todos(cal_t *cal, year_t year, month_t month, day_t day, int days); - -/* Test fuctions */ -void ical_test(void); +void cal_load(year_t year, month_t month, day_t day, int days); +void cal_config(const char *group, const char *name, const char *key, const char *value);