return NULL;
}
-struct task **get_all_tasks()
+struct task **tw_get_all_tasks(const char *status)
{
int i, n;
struct json_object *jtasks, *jtask, *json;
struct task **tasks;
+ char *opts;
- jtasks = task_exec_json("export");
+ opts = malloc(strlen("export status:") + strlen(status) + 1);
+ sprintf(opts, "export status:%s", status);
+
+ jtasks = task_exec_json(opts);
+ free(opts);
if (!jtasks)
return NULL;
return result;
}
+void tw_modify_description(const char *uuid, const char *newdesc)
+{
+ char *str;
+ char *opts;
+
+ str = escape(newdesc);
+
+ opts = malloc(1
+ + strlen(uuid)
+ + strlen(" modify :\"")
+ + strlen(str)
+ + strlen("\"")
+ + 1);
+ sprintf(opts, " %s modify \"%s\"", uuid, str);
+
+ task_exec(opts);
+
+ free(str);
+ free(opts);
+}
+
+void tw_modify_project(const char *uuid, const char *newproject)
+{
+ char *str;
+ char *opts;
+
+ str = escape(newproject);
+
+ opts = malloc(1
+ + strlen(uuid)
+ + strlen(" modify project:\"")
+ + strlen(str)
+ + strlen("\"")
+ + 1);
+ sprintf(opts, " %s modify project:\"%s\"", uuid, str);
+
+ task_exec(opts);
+
+ free(str);
+ free(opts);
+}
+
+void tw_add(const char *newdesc)
+{
+ char *str;
+ char *opts;
+
+ str = escape(newdesc);
+
+ opts = malloc(1
+ + strlen(" add \"")
+ + strlen(str)
+ + strlen("\"")
+ + 1);
+ sprintf(opts, " add \"%s\"", str);
+
+ task_exec(opts);
+
+ free(str);
+ free(opts);
+}