refactor: make room for loading and outputting pre-compiled files

This commit is contained in:
Brett Broadhurst 2026-04-13 18:40:04 -06:00
parent 3afbbb6ec2
commit 96866ba9ae
Failed to generate hash of commit
11 changed files with 537 additions and 433 deletions

View file

@ -230,7 +230,6 @@ int main(int argc, char *argv[])
int flags = 0;
const char *filename = NULL;
struct ink_source source;
struct ink_story *story = NULL;
option_setopts(cli_options, argv);
@ -285,11 +284,6 @@ int main(int argc, char *argv[])
return rc;
}
story = ink_open();
if (!story) {
goto out;
}
const struct ink_story_options opts = {
.source_bytes = source.bytes,
.source_length = source.length,
@ -298,8 +292,8 @@ int main(int argc, char *argv[])
.flags = flags,
};
rc = ink_load_story_options(story, &opts);
if (rc < 0) {
struct ink_story *const story = ink_load_story_options(&opts);
if (story == NULL) {
goto out;
}
if (!compile_only) {