From 44342619d43375313b56f7c530c4532b0f69be25 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 25 Mar 2026 13:22:42 -0400 Subject: Refactor program structure --- target.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 target.h (limited to 'target.h') 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 +#include + +#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 -- cgit