aboutsummaryrefslogtreecommitdiff
path: root/targetlist.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 /targetlist.h
parentd79588bdf85b8c1514019e679c7eefbc9014edd9 (diff)
downloaddo-44342619d43375313b56f7c530c4532b0f69be25.tar.gz
Refactor program structure
Diffstat (limited to 'targetlist.h')
-rw-r--r--targetlist.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/targetlist.h b/targetlist.h
new file mode 100644
index 0000000..fdda2be
--- /dev/null
+++ b/targetlist.h
@@ -0,0 +1,24 @@
+#ifndef DO_TARGETLIST_H
+#define DO_TARGETLIST_H
+
+#include "target.h"
+
+#define TARGETLIST_INITIAL_COUNT 100
+
+// Data structures
+struct TargetList {
+ size_t count_used;
+ size_t count_alloc;
+ struct Target **targets;
+};
+
+// Prototypes
+struct TargetList *target_list_new(size_t len);
+struct TargetList *target_list_from_file(const char *filename);
+int target_list_add(struct TargetList *list, struct Target *t);
+int target_list_append(struct TargetList **dest, const struct TargetList *src);
+struct Target *target_list_get(const struct TargetList *list, const char *id);
+void target_list_show(const struct TargetList *list);
+void target_list_free(struct TargetList **list);
+
+#endif //DO_TARGETLIST_H \ No newline at end of file