]> Pileus Git - lackey/blob - src/cal.h
Start keeping track of calendars
[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 cal_t {
26         char         *type;
27         char         *name;
28         char         *desc;
29         struct cal_t *next;
30 } cal_t;
31
32 /* Calendar item types */
33 typedef struct event_t {
34         char           *name;
35         char           *desc;
36         char           *loc;
37         char           *cat;
38         date_t          start;
39         date_t          end;
40         const cal_t    *cal;
41         struct event_t *next;
42 } event_t;
43
44 typedef struct todo_t {
45         char          *name;
46         char          *desc;
47         char          *cat;
48         status_t       status;
49         date_t         start;
50         date_t         due;
51         cal_t         *cal;
52         struct todo_t *next;
53 } todo_t;
54
55 /* Global data */
56 extern cal_t   *CALS;
57 extern event_t *EVENTS;
58 extern todo_t  *TODOS;
59
60 /* Calendar functions */
61 void cal_init(void);
62 void cal_load(year_t year, month_t month, day_t day, int days);
63 void cal_config(const char *group, const char *name, const char *key, const char *value);