aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/jobs.h22
-rw-r--r--include/util.h9
2 files changed, 31 insertions, 0 deletions
diff --git a/include/jobs.h b/include/jobs.h
new file mode 100644
index 0000000..571be0d
--- /dev/null
+++ b/include/jobs.h
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <sys/queue.h>
+
+LIST_HEAD(output_dlist, output);
+struct output {
+ char *name, *store_path;
+ LIST_ENTRY(output) dlist;
+};
+
+LIST_HEAD(job_dlist, job);
+struct job {
+ char *drv_path, *name;
+ struct output_dlist outputs;
+ struct job_dlist deps;
+
+ LIST_ENTRY(job) dlist;
+};
+
+int jobs_init(FILE **stream);
+int job_new(struct job **j, char *name, char *drv_path);
+void job_free(struct job *j);
+int jobs_read(FILE *stream, struct job *jobs);
diff --git a/include/util.h b/include/util.h
index e69de29..c5aa0ab 100644
--- a/include/util.h
+++ b/include/util.h
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+#include <cjson/cJSON.h>
+
+#define print_err(fmt, ...) \
+ fprintf(stderr, "[%s:%d] " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
+
+int json_streaming_read(FILE *stream, cJSON **json);
+int vpopen(FILE **stream, const char *file, char *const argv[]);