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 --- targetlist.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 targetlist.h (limited to 'targetlist.h') 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 -- cgit