Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/appdir.c
| Context not available. | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "CLG_log.h" | |||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| # include "utf_winfunc.h" | # include "utf_winfunc.h" | ||||
| # include "utfconv.h" | # include "utfconv.h" | ||||
| Context not available. | |||||
| #endif /* WIN32 */ | #endif /* WIN32 */ | ||||
| /* local */ | /* local */ | ||||
| static CLG_LogRef LOG = { "bke.appdir" }; | |||||
| static char bprogname[FILE_MAX]; /* full path to program executable */ | static char bprogname[FILE_MAX]; /* full path to program executable */ | ||||
| static char bprogdir[FILE_MAX]; /* full path to directory in which executable is located */ | static char bprogdir[FILE_MAX]; /* full path to directory in which executable is located */ | ||||
| static char btempdir_base[FILE_MAX]; /* persistent temporary directory */ | static char btempdir_base[FILE_MAX]; /* persistent temporary directory */ | ||||
| Context not available. | |||||
| if (GetModuleFileNameW(0, fullname_16, maxlen)) { | if (GetModuleFileNameW(0, fullname_16, maxlen)) { | ||||
| conv_utf_16_to_8(fullname_16, fullname, maxlen); | conv_utf_16_to_8(fullname_16, fullname, maxlen); | ||||
| if (!BLI_exists(fullname)) { | if (!BLI_exists(fullname)) { | ||||
| printf("path can't be found: \"%.*s\"\n", (int)maxlen, fullname); | CLOG_ERROR(&LOG, "path can't be found: \"%.*s\"", (int)maxlen, fullname); | ||||
| MessageBox(NULL, "path contains invalid characters or is too long (see console)", "Error", MB_OK); | MessageBox(NULL, "path contains invalid characters or is too long (see console)", "Error", MB_OK); | ||||
| } | } | ||||
| MEM_freeN(fullname_16); | MEM_freeN(fullname_16); | ||||
| Context not available. | |||||
| #if defined(DEBUG) | #if defined(DEBUG) | ||||
| if (!STREQ(name, fullname)) { | if (!STREQ(name, fullname)) { | ||||
| printf("guessing '%s' == '%s'\n", name, fullname); | CLOG_INFO(&LOG, 2, "guessing '%s' == '%s'", name, fullname); | ||||
| } | } | ||||
| #endif | #endif | ||||
| } | } | ||||
| Context not available. | |||||
| BLI_add_slash(fullname); | BLI_add_slash(fullname); | ||||
| } | } | ||||
| else { | else { | ||||
| printf("Warning! Could not generate a temp file name for '%s', falling back to '%s'\n", tmp_name, fullname); | CLOG_WARN(&LOG, "Could not generate a temp file name for '%s', falling back to '%s'", tmp_name, fullname); | ||||
| } | } | ||||
| MEM_freeN(tmp_name); | MEM_freeN(tmp_name); | ||||
| Context not available. | |||||