aboutsummaryrefslogtreecommitdiff
path: root/target.h
diff options
context:
space:
mode:
Diffstat (limited to 'target.h')
-rw-r--r--target.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/target.h b/target.h
new file mode 100644
index 0000000..a035e42
--- /dev/null
+++ b/target.h
@@ -0,0 +1,34 @@
+#ifndef DO_TARGET_H
+#define DO_TARGET_H
+
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#define TARGET_RUN_MAX_DEPTH 100
+#define TARGET_SCRIPT_FILENAME_TEMPLATE "do_XXXXXX"
+
+// Data structures
+struct TargetInfo {
+ size_t line_no;
+ char *line;
+ char *filename;
+};
+
+struct Target {
+ char *id;
+ char *_tmp_deps;
+ char *script;
+ struct TargetList *dependencies;
+ struct TargetInfo info;
+};
+
+
+// Prototypes
+struct Target *target_new();
+struct Target *target_clone(const struct Target *src);
+char *target_create_script_file(struct Target *t);
+int target_run(struct Target *t, const size_t *depth); // single
+int target_run_all(struct Target *t, size_t *depth); // recursive
+void target_free(struct Target **target);
+
+#endif //DO_TARGET_H \ No newline at end of file