/*
- * Copyright (C) 2010-2012 jeanfi@gmail.com
+ * Copyright (C) 2012-2013 jeanfi@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
#include <stdlib.h>
#include <string.h>
+#include <json/json.h>
+
#include "note.h"
+#include "tw.h"
-char *task_exec(char *opts)
+static char *task_exec(char *opts)
{
FILE *f;
int ret;
return str;
}
-#include <json/json.h>
-
-#include "tw.h"
-
static struct json_object *task_exec_json(char *opts)
{
struct json_object *o;
return tasks;
}
-char *escape(const char *txt)
+static char *escape(const char *txt)
{
char *result;
char *c;
free(opts);
}
+
+static void task_free(struct task *task)
+{
+ if (!task)
+ return ;
+
+ free(task->description);
+ free(task->status);
+ free(task->uuid);
+ free(task->note);
+ free(task->project);
+ free(task->priority);
+
+ free(task);
+}
+
+void tw_task_list_free(struct task **tasks)
+{
+ struct task **cur;
+
+ if (!tasks)
+ return ;
+
+ for (cur = tasks; *cur; cur++)
+ task_free(*cur);
+
+ free(tasks);
+}