]> Pileus Git - lackey/blobdiff - cals/dummy.c
Add calendar edit/save functions
[lackey] / cals / dummy.c
index 1926bdbff99f299fdf2fc4e69bd9ef86d7b37628..9de8ed979564815b91d691911a9bf3c177a1df7b 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)
 {
@@ -85,3 +99,12 @@ todo_t *dummy_todos(date_t start, date_t end)
        }
        return enable ? todo.next : 0;
 }
+
+/* Edit functions */
+void dummy_edit(edit_t mode)
+{
+}
+
+void dummy_save(edit_t mode)
+{
+}