X-Git-Url: http://pileus.org/git/?p=lackey;a=blobdiff_plain;f=src%2Fcal.h;h=7d308ec23fe47f60dad9681571407685af30941f;hp=48e1af4d20b1b0daf2cb0846c862283f76a9ae41;hb=bfc415555da3be7f94738b3ac62c511a53b78674;hpb=2b8964c94d39fc6d888e0b274cfb9fbe59424c1c diff --git a/src/cal.h b/src/cal.h index 48e1af4..7d308ec 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,10 +22,11 @@ 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 */ @@ -38,6 +39,7 @@ typedef struct event_t { date_t end; const cal_t *cal; struct event_t *next; + struct event_t *prev; } event_t; typedef struct todo_t { @@ -49,13 +51,18 @@ typedef struct todo_t { date_t due; cal_t *cal; struct todo_t *next; + struct todo_t *prev; } todo_t; /* Global data */ -extern event_t *EVENTS; -extern todo_t *TODOS; +extern cal_t *CAL, *CALS; +extern event_t *EVENT, *EVENTS; +extern todo_t *TODO, *TODOS; /* Calendar functions */ void cal_init(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); + +/* Event functions */ +event_t *find_event(date_t *target);