X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Ferror.c;h=6e04a06ae1cd94f125307502844c9cdce437fa1e;hp=06f09f5dae080aa54486b02b7880eb349a5de70d;hb=b982f17d9d036b7a0cac445c62983a30a0d16eb2;hpb=be5acf31aa8292dcd4a2829492faefb0b200d28f diff --git a/src/error.c b/src/error.c index 06f09f5d..6e04a06a 100644 --- a/src/error.c +++ b/src/error.c @@ -43,24 +43,18 @@ #include "wimlib.h" #include "wimlib/error.h" #include "wimlib/util.h" -#ifdef __WIN32__ -# include "wimlib/win32.h" -#endif +#include "wimlib/win32.h" #ifdef ENABLE_ERROR_MESSAGES bool wimlib_print_errors = false; FILE *wimlib_error_file = NULL; /* Set in wimlib_global_init() */ static bool wimlib_owns_error_file = false; -#endif -#if defined(ENABLE_ERROR_MESSAGES) || defined(ENABLE_DEBUG) static void wimlib_vmsg(const tchar *tag, const tchar *format, va_list va, bool perror) { -#ifndef ENABLE_DEBUG if (!wimlib_print_errors) return; -#endif int errno_save = errno; fflush(stdout); tfputs(tag, wimlib_error_file); @@ -84,9 +78,7 @@ wimlib_vmsg(const tchar *tag, const tchar *format, va_list va, bool perror) fflush(wimlib_error_file); errno = errno_save; } -#endif -#ifdef ENABLE_ERROR_MESSAGES void wimlib_error(const tchar *format, ...) { @@ -126,22 +118,7 @@ wimlib_warning_with_errno(const tchar *format, ...) wimlib_vmsg(T("\r[WARNING] "), format, va, true); va_end(va); } - -#endif - -#ifdef ENABLE_DEBUG -void wimlib_debug(const tchar *filename, int line, const char *func, - const tchar *format, ...) -{ - va_list va; - tchar buf[tstrlen(filename) + strlen(func) + 30]; - - tsprintf(buf, T("[%"TS" %d] %s(): "), filename, line, func); - va_start(va, format); - wimlib_vmsg(buf, format, va, false); - va_end(va); -} -#endif +#endif /* ENABLE_ERROR_MESSAGES */ void print_byte_field(const u8 *field, size_t len, FILE *out) @@ -222,7 +199,7 @@ static const tchar * const error_strings[] = { [WIMLIB_ERR_INTEGRITY] = T("The WIM file is corrupted (failed integrity check)"), [WIMLIB_ERR_INVALID_CAPTURE_CONFIG] - = T("The capture configuration string was invalid"), + = T("The contents of the capture configuration file were invalid"), [WIMLIB_ERR_INVALID_CHUNK_SIZE] = T("The compression chunk size was unrecognized"), [WIMLIB_ERR_INVALID_COMPRESSION_TYPE] @@ -356,6 +333,8 @@ static const tchar * const error_strings[] = { = T("The current user does not have permission to unmount the WIM image"), [WIMLIB_ERR_FVE_LOCKED_VOLUME] = T("The volume must be unlocked before it can be used"), + [WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG] + = T("The capture configuration file could not be read"), }; WIMLIBAPI const tchar *