зеркало из https://github.com/mozilla/pjs.git
Windows CE Only. Implementing _fullpath and getcwd
This commit is contained in:
Родитель
c1648bc125
Коммит
8d3b6f07a7
|
@ -154,7 +154,7 @@ void dumpMemoryInfo();
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
MOZCE_SHUNT_API int mozce_printf(const char *, ...);
|
||||
MOZCE_SHUNT_API int mozce_printf(const char *, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
|
|
@ -129,9 +129,17 @@ MOZCE_SHUNT_API char* mozce_getcwd(char* buff, size_t size)
|
|||
MOZCE_PRECHECK
|
||||
|
||||
#ifdef DEBUG
|
||||
mozce_printf("mozce_getcwd called. NOT IMPLEMENTED!!\n");
|
||||
#endif
|
||||
return NULL;
|
||||
mozce_printf("mozce_getcwd called.\n");
|
||||
#endif
|
||||
|
||||
unsigned short dir[MAX_PATH];
|
||||
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH);
|
||||
for (int i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {}
|
||||
dir[i + 1] = TCHAR('\0');
|
||||
|
||||
w2a_buffer(dir, -1, buff, size);
|
||||
|
||||
return buff;
|
||||
}
|
||||
|
||||
MOZCE_SHUNT_API int mozce_printf(const char * format, ...)
|
||||
|
|
|
@ -55,10 +55,23 @@ MOZCE_SHUNT_API char *mozce_fullpath(char *absPath, const char *relPath, size_t
|
|||
|
||||
#ifdef LOG_CALLS
|
||||
#ifdef DEBUG
|
||||
mozce_printf("*mozce_fullpath called\n");
|
||||
mozce_printf("mozce_fullpath called\n");
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
if (relPath[0] != '\\')
|
||||
{
|
||||
unsigned short dir[MAX_PATH];
|
||||
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH);
|
||||
for (int i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {}
|
||||
|
||||
dir[i + 1] = TCHAR('\0');
|
||||
|
||||
w2a_buffer(dir, -1, absPath, maxLength);
|
||||
}
|
||||
strcat(absPath, relPath);
|
||||
|
||||
return absPath;
|
||||
}
|
||||
|
||||
MOZCE_SHUNT_API void mozce_splitpath(const char* inPath, char* outDrive, char* outDir, char* outFname, char* outExt)
|
||||
|
|
Загрузка…
Ссылка в новой задаче