mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
Windows CE Only. Implementing _fullpath and getcwd
This commit is contained in:
parent
c6e79b7b3b
commit
dbb256bb0f
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user