aboutsummaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'job.c')
-rw-r--r--job.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/job.c b/job.c
index 7cd3602782..aa4c746c8a 100644
--- a/job.c
+++ b/job.c
@@ -199,6 +199,28 @@ bool job_is_cancelled(Job *job)
return job->cancelled;
}
+bool job_is_ready(Job *job)
+{
+ switch (job->status) {
+ case JOB_STATUS_UNDEFINED:
+ case JOB_STATUS_CREATED:
+ case JOB_STATUS_RUNNING:
+ case JOB_STATUS_PAUSED:
+ case JOB_STATUS_WAITING:
+ case JOB_STATUS_PENDING:
+ case JOB_STATUS_ABORTING:
+ case JOB_STATUS_CONCLUDED:
+ case JOB_STATUS_NULL:
+ return false;
+ case JOB_STATUS_READY:
+ case JOB_STATUS_STANDBY:
+ return true;
+ default:
+ g_assert_not_reached();
+ }
+ return false;
+}
+
bool job_is_completed(Job *job)
{
switch (job->status) {