diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/jobs.h | 15 | ||||
-rw-r--r-- | include/util.h | 7 |
2 files changed, 7 insertions, 15 deletions
diff --git a/include/jobs.h b/include/jobs.h index 3a1fb19..d223ec2 100644 --- a/include/jobs.h +++ b/include/jobs.h @@ -3,23 +3,22 @@ #ifndef JOBS_H -LIST_HEAD(output_dlist, output); struct output { char *name, *store_path; - LIST_ENTRY(output) dlist; }; -LIST_HEAD(job_dlist, job); -CIRCLEQ_HEAD(job_clist, job); struct job { char *name, *drv_path; - struct output_dlist outputs; - struct job_dlist deps; - /* TODO: replace dlist with clist jobs.c */ - LIST_ENTRY(job) dlist; + size_t outputs_size, outputs_filled; + struct output **outputs; + + size_t deps_size, deps_filled; + struct job **deps; + CIRCLEQ_ENTRY(job) clist; }; +CIRCLEQ_HEAD(job_clist, job); typedef enum { JOB_READ_SUCCESS = 0, diff --git a/include/util.h b/include/util.h index 5279a07..130bbdd 100644 --- a/include/util.h +++ b/include/util.h @@ -5,13 +5,6 @@ #define print_err(fmt, ...) \ fprintf(stderr, "[%s:%d] " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__) -#define LIST_FOREACH_FREE(cur, next, head, field, func_free) \ - for ((cur) = ((head)->lh_first); (cur);) { \ - (next) = ((cur)->field.le_next); \ - func_free((cur)); \ - (cur) = (next); \ - } - #define CIRCLEQ_FOREACH_FREE(cur, next, head, field, func_free) \ for ((cur) = ((head)->cqh_first); (cur) != (const void *)(head);) { \ (next) = ((cur)->field.cqe_next); \ |