diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/console.c | 20 | ||||
-rw-r--r-- | tools/serd-filter.c | 8 | ||||
-rw-r--r-- | tools/serd-pipe.c | 2 | ||||
-rw-r--r-- | tools/serd-sort.c | 4 |
4 files changed, 17 insertions, 17 deletions
diff --git a/tools/console.c b/tools/console.c index ab36364d..0e41a2a0 100644 --- a/tools/console.c +++ b/tools/console.c @@ -45,7 +45,7 @@ serd_tool_setup(SerdTool* const tool, "%s: failed to open output file (%s)\n", program, strerror(errno)); - return SERD_ERR_UNKNOWN; + return SERD_UNKNOWN_ERROR; } // We have something to write to, so build the writing environment @@ -61,7 +61,7 @@ serd_tool_setup(SerdTool* const tool, &tool->out, options.block_size))) { fprintf(stderr, "%s: failed to set up writing environment\n", program); - return SERD_ERR_INTERNAL; + return SERD_UNKNOWN_ERROR; } return SERD_SUCCESS; @@ -75,7 +75,7 @@ serd_tool_cleanup(SerdTool tool) // Close the output stream explicitly to check if there were any errors if (serd_close_output(&tool.out)) { perror("write error"); - st = SERD_ERR_BAD_WRITE; + st = SERD_BAD_WRITE; } } @@ -120,7 +120,7 @@ serd_get_argument(OptionIter* const iter, const char** const argument) if (iter->argv[iter->a][iter->f] || (iter->a + 1) == iter->argc) { fprintf( stderr, "%s: option requires an argument -- %c\n", iter->argv[0], flag); - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } *argument = iter->argv[++iter->a]; @@ -141,7 +141,7 @@ serd_get_size_argument(OptionIter* const iter, size_t* const argument) char* endptr = NULL; const long size = strtol(string, &endptr, 10); if (size <= 0 || size == LONG_MAX || *endptr != '\0') { - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } *argument = (size_t)size; @@ -181,7 +181,7 @@ serd_set_input_option(const SerdStringView name, } } - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } SerdStatus @@ -238,7 +238,7 @@ serd_set_output_option(const SerdStringView name, } } - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } SerdStatus @@ -384,12 +384,12 @@ serd_set_base_uri_from_path(SerdEnv* const env, const char* const path) { const size_t path_len = path ? strlen(path) : 0u; if (!path_len) { - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } char* const real_path = serd_canonical_path(path); if (!real_path) { - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } const size_t real_path_len = strlen(real_path); @@ -455,7 +455,7 @@ serd_read_inputs(SerdWorld* const world, // Open the input stream SerdInputStream in = serd_open_tool_input(in_path); if (!in.stream) { - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } // Read the entire file diff --git a/tools/serd-filter.c b/tools/serd-filter.c index ed22373c..0804d6ba 100644 --- a/tools/serd-filter.c +++ b/tools/serd-filter.c @@ -51,7 +51,7 @@ on_pattern_event(void* const handle, const SerdEvent* const event) if (event->type == SERD_STATEMENT) { FilterPattern* const pat = (FilterPattern*)handle; if (pat->s) { - return SERD_ERR_INVALID; + return SERD_BAD_PATTERN; } const SerdStatement* const statement = event->statement.statement; @@ -149,7 +149,7 @@ run(Options opts) if (!pattern.stream) { log_error(app.world, "failed to open pattern"); - return SERD_ERR_UNKNOWN; + return SERD_UNKNOWN_ERROR; } // Set up the output pipeline: filter -> writer @@ -157,7 +157,7 @@ run(Options opts) parse_pattern(app.world, target, &pattern, !opts.invert); if (!filter) { log_error(app.world, "failed to set up filter"); - return SERD_ERR_UNKNOWN; + return SERD_UNKNOWN_ERROR; } serd_close_input(&pattern); @@ -245,7 +245,7 @@ parse_option(OptionIter* const iter, Options* const opts) } ARG_ERRORF("invalid option -- '%c'\n", opt); - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; #undef ARG_ERRORF } diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c index 879a56b5..f2891f9b 100644 --- a/tools/serd-pipe.c +++ b/tools/serd-pipe.c @@ -163,7 +163,7 @@ parse_option(OptionIter* const iter, Options* const opts) } ARG_ERRORF("invalid option -- '%c'\n", opt); - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; #undef ARG_ERRORF } diff --git a/tools/serd-sort.c b/tools/serd-sort.c index 1018350d..7219fa26 100644 --- a/tools/serd-sort.c +++ b/tools/serd-sort.c @@ -162,7 +162,7 @@ parse_statement_order(const char* const string, SerdStatementOrder* const order) } } - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; } static int @@ -237,7 +237,7 @@ parse_option(OptionIter* const iter, Options* const opts) } ARG_ERRORF("invalid option -- '%c'\n", opt); - return SERD_ERR_BAD_ARG; + return SERD_BAD_ARG; #undef ARG_ERRORF } |