summaryrefslogtreecommitdiff
path: root/src/source.h
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2026-04-12 20:57:06 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2026-04-12 20:59:39 +0200
commite5af28536bfb0f4c9131df56d2009ba5196f5e3a (patch)
tree3ab928f961a1ccd8440b070d7b57f79146457e8c /src/source.h
downloadanimtool-e5af28536bfb0f4c9131df56d2009ba5196f5e3a.tar.xz
init
Diffstat (limited to 'src/source.h')
-rw-r--r--src/source.h31
1 files changed, 31 insertions, 0 deletions
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 <stddef.h>
+#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