]> Pileus Git - lackey/commitdiff
Add flag for dummy events
authorAndy Spencer <andy753421@gmail.com>
Sat, 8 Jun 2013 08:48:34 +0000 (08:48 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 10 Jun 2013 04:54:02 +0000 (04:54 +0000)
cals/dummy.c

index 588a1db7a7ec7fdd2b3c2bfc9a161cbfaf6e2129..427ca791d033de6d1acd25c36d2db365b16c8660 100644 (file)
@@ -44,6 +44,7 @@ static todo_t todo = {
        .status  = 50,
 };
 
        .status  = 50,
 };
 
+static int     enable;
 static event_t events[8];
 static todo_t  todos[6];
 
 static event_t events[8];
 static todo_t  todos[6];
 
@@ -59,7 +60,7 @@ event_t *dummy_events(cal_t *cal, year_t year, month_t month, day_t day, int day
                if (i+1 < N_ELEMENTS(events))
                        events[i].next = &events[i+1];
        }
                if (i+1 < N_ELEMENTS(events))
                        events[i].next = &events[i+1];
        }
-       return &events[0];
+       return enable ? &events[0] : 0;
 }
 
 /* Todo functions */
 }
 
 /* Todo functions */
@@ -71,5 +72,5 @@ todo_t *dummy_todos(cal_t *cal, year_t year, month_t month, day_t day, int days)
                if (i+1 < N_ELEMENTS(todos))
                        todos[i].next = &todos[i+1];
        }
                if (i+1 < N_ELEMENTS(todos))
                        todos[i].next = &todos[i+1];
        }
-       return &todos[0];
+       return enable ? &todos[0] : 0;
 }
 }