diff options
Diffstat (limited to 'libXfont/src/fontfile/fontfile.c')
-rw-r--r-- | libXfont/src/fontfile/fontfile.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libXfont/src/fontfile/fontfile.c b/libXfont/src/fontfile/fontfile.c index a738c4d34..b56d76a9c 100644 --- a/libXfont/src/fontfile/fontfile.c +++ b/libXfont/src/fontfile/fontfile.c @@ -41,6 +41,12 @@ in this Software without prior written authorization from The Open Group. #ifdef WIN32 #include <ctype.h> #endif +#ifdef _MSC_VER +#define BOOL W32BOOL +#include <windows.h> +#undef _X_HIDDEN +#define _X_HIDDEN static +#endif static unsigned char ISOLatin1ToLower(unsigned char source) @@ -54,7 +60,7 @@ ISOLatin1ToLower(unsigned char source) return source; } -_X_HIDDEN void +void CopyISOLatin1Lowered(char *dest, char *source, int length) { int i; @@ -76,6 +82,32 @@ static int FontFileOpenBitmapNCF (FontPathElementPtr fpe, FontPtr *pFont, int FontFileNameCheck (char *name) { +#ifdef _MSC_VER + WIN32_FIND_DATA FindData; + HANDLE hFind; + char Tmp; + int LenName=strlen(name)-1; + Tmp=name[LenName]; + if (Tmp=='/') + name[LenName]=0; + hFind=FindFirstFile(name,&FindData); + name[LenName]=Tmp; + + if (hFind==INVALID_HANDLE_VALUE) + { + return 0; + } + else + { + FindClose(hFind); + if (FindData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) + { + return 1; + } + return 0; + } + +#else #ifndef NCD #if defined(WIN32) /* OS/2 uses D:/... as a path name for fonts, so accept this as a valid @@ -88,6 +120,7 @@ FontFileNameCheck (char *name) #else return ((strcmp(name, "built-ins") == 0) || (*name == '/')); #endif +#endif } int |