summaryrefslogtreecommitdiff
path: root/src/source.h
diff options
context:
space:
mode:
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