From e5af28536bfb0f4c9131df56d2009ba5196f5e3a Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Sun, 12 Apr 2026 20:57:06 +0200 Subject: init --- src/source.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/source.h (limited to 'src/source.h') diff --git a/src/source.h b/src/source.h new file mode 100644 index 0000000..c88c2b4 --- /dev/null +++ b/src/source.h @@ -0,0 +1,31 @@ +#ifndef ANIMTOOL_SOURCE_H +#define ANIMTOOL_SOURCE_H + +#include +#include "util/container.h" +#include "util/str.h" + +struct range +{ + size_t start, end; +}; + +struct loc_str +{ + struct range loc; + str str; +}; + +struct source +{ + str name; + str contents; + size_t offset; + arraybuf(str) strings; +}; + +[[noreturn]] void source_error(struct source *source, struct range loc, const char *fmt, ...) __attribute__((format (printf, 3, 4))); +void source_init(struct source *source, str name, str contents); +void source_free(struct source *source); + +#endif -- cgit v1.2.3