]> Pileus Git - lackey/blob - src/event.h
Start on events and calendars
[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 #ifndef EVENT_H
19 #define EVENT_H
20
21 #include "util.h"
22
23 /* Calendar types */
24 typedef struct {
25         char *name;
26         char *desc;
27         void *data;
28 } cal_t;
29
30 /* Event types */
31 typedef struct {
32         year_t  year;
33         month_t month;
34         day_t   day;
35         hour_t  hour;
36         min_t   min;
37 } datetime_t;
38
39 typedef struct event_t {
40         const cal_t    *cal;
41         datetime_t      start;
42         datetime_t      end;
43         const char     *name;
44         const char     *desc;
45         struct event_t *next;
46 } event_t;
47
48 /* Event functions */
49 event_t *event_get(year_t year, month_t month, day_t day, int days);
50
51 /* Calendar implementation functions */
52 event_t *dummy_get(cal_t *cal, year_t year, month_t month, day_t day, int days);
53
54 #endif