]> Pileus Git - lackey/blob - src/event.h
Working iCalendar parsing
[lackey] / src / event.h
1 /*
2  * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 /* Calendar types */
19 typedef struct {
20         char *name;
21         char *desc;
22         void *data;
23 } cal_t;
24
25 /* Event types */
26 typedef struct {
27         year_t  year;
28         month_t month;
29         day_t   day;
30         hour_t  hour;
31         min_t   min;
32 } date_t;
33
34 typedef struct event_t {
35         const cal_t    *cal;
36         const char     *name;
37         const char     *desc;
38         date_t          start;
39         date_t          end;
40         struct event_t *next;
41 } event_t;
42
43 /* Global data */
44 extern event_t *EVENTS;
45
46 /* Event functions */
47 void event_init(void);
48 event_t *event_get(year_t year, month_t month, day_t day, int days);
49
50 /* Calendar implementation functions */
51 event_t *dummy_get(cal_t *cal, year_t year, month_t month, day_t day, int days);
52 event_t *ical_get(cal_t *cal, year_t year, month_t month, day_t day, int days);
53
54 /* Test fuctions */
55 void ical_test(void);