aboutsummaryrefslogtreecommitdiff
path: root/target.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-03-25 13:22:42 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-03-25 13:22:42 -0400
commit44342619d43375313b56f7c530c4532b0f69be25 (patch)
treecbb68df916001a3b6c3ea17eeea40e28cdc8f307 /target.h
parentd79588bdf85b8c1514019e679c7eefbc9014edd9 (diff)
downloaddo-44342619d43375313b56f7c530c4532b0f69be25.tar.gz
Refactor program structure
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