]> Pileus Git - lackey/blob - src/cal.h
Add cal_load function and update cal APIs
[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 /* Cal status types */
19 typedef enum {
20         NEW  = 0,
21         DONE = 100,
22 } status_t;
23
24 /* Calendar type */
25 typedef struct {
26         char *name;
27         char *desc;
28         void *data;
29 } cal_t;
30
31 /* Calendar item types */
32 typedef struct event_t {
33         const char     *name;
34         const char     *desc;
35         const char     *loc;
36         const char     *cat;
37         date_t          start;
38         date_t          end;
39         const cal_t    *cal;
40         struct event_t *next;
41 } event_t;
42
43 typedef struct todo_t {
44         const char    *name;
45         const char    *desc;
46         const char    *cat;
47         status_t       status;
48         date_t         start;
49         date_t         due;
50         cal_t         *cal;
51         struct todo_t *next;
52 } todo_t;
53
54 /* Global data */
55 extern event_t *EVENTS;
56 extern todo_t  *TODOS;
57
58 /* Calendar functions */
59 void cal_init(void);
60 void cal_load(year_t year, month_t month, day_t day, int days);
61
62 /* Test fuctions */
63 void ical_test(void);