]> Pileus Git - lackey/blob - src/cal.h
3191733f24b70451cbdd4638aa8e4763a43dd223
[lackey] / src / cal.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 /* Calendar items */
26 typedef struct event_t {
27         const cal_t    *cal;
28         const char     *name;
29         const char     *desc;
30         const char     *loc;
31         const char     *cat;
32         date_t          start;
33         date_t          end;
34         struct event_t *next;
35 } event_t;
36
37 /* Global data */
38 extern event_t *EVENTS;
39
40 /* Calendar functions */
41 void cal_init(void);
42 event_t *cal_events(year_t year, month_t month, day_t day, int days);
43
44 /* Calendar event functions */
45 event_t *dummy_events(cal_t *cal, year_t year, month_t month, day_t day, int days);
46 event_t *ical_events(cal_t *cal, year_t year, month_t month, day_t day, int days);
47
48 /* Test fuctions */
49 void ical_test(void);