+void
+wimlib_warning(const tchar *format, ...)
+{
+ va_list va;
+
+ va_start(va, format);
+ wimlib_vmsg(T("\r[WARNING] "), format, va, false);
+ va_end(va);
+}
+
+void
+wimlib_warning_with_errno(const tchar *format, ...)
+{
+ va_list va;
+
+ va_start(va, format);
+ wimlib_vmsg(T("\r[WARNING] "), format, va, true);
+ va_end(va);
+}
+
+#endif
+
+#if defined(ENABLE_DEBUG) || defined(ENABLE_MORE_DEBUG)
+void wimlib_debug(const tchar *file, int line, const char *func,
+ const tchar *format, ...)
+{
+ va_list va;
+ tchar buf[tstrlen(file) + strlen(func) + 30];
+
+ static bool debug_enabled = false;
+ if (!debug_enabled) {
+ char *value = getenv("WIMLIB_DEBUG");
+ if (!value || strcmp(value, "0"))
+ debug_enabled = true;
+ else
+ return;
+ }
+
+ tsprintf(buf, T("[%"TS" %d] %s(): "), file, line, func);
+
+ va_start(va, format);
+ wimlib_vmsg(buf, format, va, false);
+ va_end(va);
+}