WIMLIBAPI int wimlib_set_error_file_by_name(const tchar *path) { #ifdef ENABLE_ERROR_MESSAGES FILE *fp; #ifdef __WIN32__ fp = win32_open_logfile(path); #else fp = fopen(path, "a"); #endif if (!fp) return WIMLIB_ERR_OPEN; wimlib_set_error_file(fp); wimlib_owns_error_file = true; return 0; #else return WIMLIB_ERR_UNSUPPORTED; #endif }
/* API function documented in wimlib.h */ WIMLIBAPI void wimlib_global_cleanup(void) { if (!lib_initialized) return; pthread_mutex_lock(&lib_initialization_mutex); if (!lib_initialized) goto out_unlock; libxml_global_cleanup(); iconv_global_cleanup(); #ifdef __WIN32__ win32_global_cleanup(); #endif wimlib_set_error_file(NULL); lib_initialized = false; out_unlock: pthread_mutex_unlock(&lib_initialization_mutex); }