diff options
Diffstat (limited to 'tools/console.c')
-rw-r--r-- | tools/console.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/console.c b/tools/console.c index 89223eaf..53e86389 100644 --- a/tools/console.c +++ b/tools/console.c @@ -11,6 +11,7 @@ #include "serd/uri.h" #include "serd/version.h" #include "zix/attributes.h" +#include "zix/string_view.h" #ifdef _WIN32 # ifdef _MSC_VER @@ -223,7 +224,7 @@ serd_choose_syntax(SerdWorld* const world, } SerdStatus -serd_set_input_option(const SerdStringView name, +serd_set_input_option(const ZixStringView name, SerdSyntax* const syntax, SerdReaderFlags* const flags) { @@ -268,7 +269,7 @@ serd_parse_input_argument(OptionIter* const iter, if (!(st = serd_get_argument(iter, &argument))) { if ((st = serd_set_input_option( - serd_string(argument), &options->syntax, &options->flags))) { + zix_string(argument), &options->syntax, &options->flags))) { fprintf(stderr, "%s: unknown option \"%s\"\n", iter->argv[0], argument); } else if (!strcmp(argument, "empty") || options->syntax) { options->overridden = true; @@ -279,7 +280,7 @@ serd_parse_input_argument(OptionIter* const iter, } SerdStatus -serd_set_output_option(const SerdStringView name, +serd_set_output_option(const ZixStringView name, SerdSyntax* const syntax, SerdWriterFlags* const flags) { @@ -325,7 +326,7 @@ serd_parse_output_argument(OptionIter* const iter, if (!(st = serd_get_argument(iter, &argument))) { if ((st = serd_set_output_option( - serd_string(argument), &options->syntax, &options->flags))) { + zix_string(argument), &options->syntax, &options->flags))) { fprintf(stderr, "%s: unknown option \"%s\"\n", iter->argv[0], argument); } else if (!strcmp(argument, "empty") || options->syntax) { options->overridden = true; @@ -397,7 +398,7 @@ serd_create_env(SerdAllocator* const allocator, const char* const out_filename) { if (serd_uri_string_has_scheme(base_string)) { - return serd_env_new(allocator, serd_string(base_string)); + return serd_env_new(allocator, zix_string(base_string)); } const bool is_rebase = !strcmp(base_string, "rebase"); @@ -407,14 +408,14 @@ serd_create_env(SerdAllocator* const allocator, return NULL; } - SerdEnv* const env = serd_env_new(allocator, serd_empty_string()); - serd_env_set_base_path(env, serd_string(out_filename)); + SerdEnv* const env = serd_env_new(allocator, zix_empty_string()); + serd_env_set_base_path(env, zix_string(out_filename)); return env; } - SerdEnv* const env = serd_env_new(allocator, serd_empty_string()); - const SerdStringView base = serd_string(base_string); - const SerdStatus st = serd_env_set_base_path(env, base); + SerdEnv* const env = serd_env_new(allocator, zix_empty_string()); + const ZixStringView base = zix_string(base_string); + const SerdStatus st = serd_env_set_base_path(env, base); if (st) { fprintf(stderr, "%s: invalid base URI \"%s\"\n", program, base_string); serd_env_free(env); @@ -506,7 +507,7 @@ serd_read_inputs(SerdWorld* const world, // Use the filename as the base URI if possible if user didn't override it const char* const in_path = inputs[i]; if (!opts.base_uri[0] && !!strcmp(in_path, "-")) { - serd_env_set_base_path(env, serd_string(in_path)); + serd_env_set_base_path(env, zix_string(in_path)); } // Open the input stream |