X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Futil.c;h=de5eec5b38e2616c87fa3812c36fbd5261fa3e96;hb=e8fdc252f2df9a42b359633c4ca1612174e50444;hp=d091c3e155fba957bd57d38fd72b1131cba7100d;hpb=885632f08c75c1d7bb5d25436231c78f6ad7e0c0;p=wimlib diff --git a/src/util.c b/src/util.c index d091c3e1..de5eec5b 100644 --- a/src/util.c +++ b/src/util.c @@ -53,6 +53,22 @@ void wimlib_error(const char *format, ...) va_end(va); } } + +void wimlib_warning(const char *format, ...) +{ + if (__wimlib_print_errors) { + va_list va; + int errno_save; + + va_start(va, format); + errno_save = errno; + fputs("WARNING: ", stderr); + vfprintf(stderr, format, va); + errno = errno_save; + va_end(va); + } +} + #endif WIMLIBAPI int wimlib_set_print_errors(bool show_error_messages) @@ -131,8 +147,10 @@ static const char *error_strings[] = { = "Could not read data from a file", [WIMLIB_ERR_RENAME] = "Could not rename a file", - [WIMLIB_ERR_SPLIT] - = "The WIM is part of a split WIM, which Wimlib does not support", + [WIMLIB_ERR_SPLIT_INVALID] + = "The WIM is part of an invalid split WIM", + [WIMLIB_ERR_SPLIT_UNSUPPORTED] + = "The WIM is part of a split WIM, which is not supported for this operation", [WIMLIB_ERR_STAT] = "Could not read the metadata for a file or directory", [WIMLIB_ERR_TIMEOUT]