mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
add error handling for tasks
This commit is contained in:
parent
2dc9358085
commit
b675cef99c
6 changed files with 93 additions and 52 deletions
|
@ -237,23 +237,23 @@ void tc_task_to_immut(struct TCTask *task);
|
|||
/**
|
||||
* Get a task's UUID.
|
||||
*/
|
||||
struct TCUuid tc_task_get_uuid(const struct TCTask *task);
|
||||
struct TCUuid tc_task_get_uuid(struct TCTask *task);
|
||||
|
||||
/**
|
||||
* Get a task's status.
|
||||
*/
|
||||
enum TCStatus tc_task_get_status(const struct TCTask *task);
|
||||
enum TCStatus tc_task_get_status(struct TCTask *task);
|
||||
|
||||
/**
|
||||
* Get a task's description, or NULL if the task cannot be represented as a C string (e.g., if it
|
||||
* contains embedded NUL characters).
|
||||
*/
|
||||
struct TCString *tc_task_get_description(const struct TCTask *task);
|
||||
struct TCString *tc_task_get_description(struct TCTask *task);
|
||||
|
||||
/**
|
||||
* Check if a task is active (started and not stopped).
|
||||
*/
|
||||
bool tc_task_is_active(const struct TCTask *task);
|
||||
bool tc_task_is_active(struct TCTask *task);
|
||||
|
||||
/**
|
||||
* Set a mutable task's status.
|
||||
|
@ -290,6 +290,13 @@ enum TCResult tc_task_stop(struct TCTask *task);
|
|||
*/
|
||||
enum TCResult tc_task_add_tag(struct TCTask *task, struct TCString *tag);
|
||||
|
||||
/**
|
||||
* Get the latest error for a task, or NULL if the last operation succeeded. Subsequent calls
|
||||
* to this function will return NULL. The task pointer must not be NULL. The caller must free the
|
||||
* returned string.
|
||||
*/
|
||||
struct TCString *tc_task_error(struct TCTask *task);
|
||||
|
||||
/**
|
||||
* Free a task. The given task must not be NULL. The task must not be used after this function
|
||||
* returns, and must not be freed more than once.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue