aboutsummaryrefslogtreecommitdiffstats
path: root/src/serdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/serdi.c')
-rw-r--r--src/serdi.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/serdi.c b/src/serdi.c
index b391f549..f0cf8f4b 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -309,20 +309,18 @@ main(int argc, char** argv)
const SerdWriterFlags writer_flags =
choose_style(input_syntax, output_syntax, ascii, bulk_write, full_uris);
- SerdURIView base_uri = SERD_URI_NULL;
- SerdNode* base = NULL;
+ SerdNode* base = NULL;
if (a < argc) { // Base URI given on command line
- base_uri = serd_parse_uri(argv[a]);
- base = serd_new_parsed_uri(base_uri);
+ base = serd_new_uri(SERD_MEASURE_STRING((const char*)argv[a]));
} else if (from_file && in_fd != stdin) { // Use input file URI
- base = serd_new_file_uri(input, NULL, &base_uri);
+ base = serd_new_file_uri(SERD_MEASURE_STRING(input), SERD_EMPTY_STRING());
}
FILE* const out_fd = stdout;
- SerdEnv* const env = serd_env_new(base);
+ SerdEnv* const env = serd_env_new(serd_node_string_view(base));
- SerdWriter* const writer = serd_writer_new(
- output_syntax, writer_flags, env, &base_uri, serd_file_sink, out_fd);
+ SerdWriter* const writer =
+ serd_writer_new(output_syntax, writer_flags, env, serd_file_sink, out_fd);
SerdReader* const reader =
serd_reader_new(input_syntax,
@@ -339,7 +337,7 @@ main(int argc, char** argv)
serd_writer_set_error_sink(writer, quiet_error_sink, NULL);
}
- SerdNode* root = root_uri ? serd_new_string(SERD_URI, root_uri) : NULL;
+ SerdNode* root = serd_new_uri(SERD_MEASURE_STRING(root_uri));
serd_writer_set_root_uri(writer, root);
serd_writer_chop_blank_prefix(writer, chop_prefix);
serd_reader_add_blank_prefix(reader, add_prefix);