Windows CE Only. Implementing _fullpath and getcwd

This commit is contained in:
dougt%meer.net 2005-04-27 23:11:37 +00:00
Родитель c6e79b7b3b
Коммит dbb256bb0f
3 изменённых файлов: 27 добавлений и 6 удалений

Просмотреть файл

@ -154,7 +154,7 @@ void dumpMemoryInfo();
extern "C" { extern "C" {
#endif #endif
MOZCE_SHUNT_API int mozce_printf(const char *, ...); MOZCE_SHUNT_API int mozce_printf(const char *, ...);
#ifdef __cplusplus #ifdef __cplusplus
}; };

Просмотреть файл

@ -129,9 +129,17 @@ MOZCE_SHUNT_API char* mozce_getcwd(char* buff, size_t size)
MOZCE_PRECHECK MOZCE_PRECHECK
#ifdef DEBUG #ifdef DEBUG
mozce_printf("mozce_getcwd called. NOT IMPLEMENTED!!\n"); mozce_printf("mozce_getcwd called.\n");
#endif #endif
return NULL;
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, ...) 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 LOG_CALLS
#ifdef DEBUG #ifdef DEBUG
mozce_printf("*mozce_fullpath called\n"); mozce_printf("mozce_fullpath called\n");
#endif #endif
#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) MOZCE_SHUNT_API void mozce_splitpath(const char* inPath, char* outDrive, char* outDir, char* outFname, char* outExt)