]> Pileus Git - lackey/blobdiff - cals/dummy.c
Add bit flags for event and todo line items
[lackey] / cals / dummy.c
index 1926bdbff99f299fdf2fc4e69bd9ef86d7b37628..1f57b1149b506760c64a1d2b908c18152a665265 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
+ * Copyright (C) 2012-2013 Andy Spencer <andy753421@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <stdlib.h>
 
 #include "util.h"
+#include "conf.h"
 #include "date.h"
 #include "cal.h"
 
 /* Test data */
 static cal_t cal = {
+       .type  = "dummy",
        .name  = "dummy",
        .desc  = "dummy calendar",
-       .data  = NULL,
 };
 
 static event_t event = {
@@ -46,6 +47,19 @@ static todo_t todo = {
 
 static int     enable;
 
+/* Config parser */
+void dummy_config(const char *group, const char *name, const char *key, const char *value)
+{
+       if (match(group, "dummy") && match(key, "enable"))
+               enable = get_bool(value);
+}
+
+/* Cal functions */
+cal_t *dummy_cals(void)
+{
+       return &cal;
+}
+
 /* Event functions */
 event_t *dummy_events(date_t start, date_t end)
 {