diff options
Diffstat (limited to 'libXfont/src/fontfile')
-rw-r--r-- | libXfont/src/fontfile/catalogue.c | 5 | ||||
-rw-r--r-- | libXfont/src/fontfile/fontfile.c | 33 | ||||
-rw-r--r-- | libXfont/src/fontfile/makefile | 25 | ||||
-rw-r--r-- | libXfont/src/fontfile/renderers.c | 1 |
4 files changed, 63 insertions, 1 deletions
diff --git a/libXfont/src/fontfile/catalogue.c b/libXfont/src/fontfile/catalogue.c index 3a04a754d..5ce8a0799 100644 --- a/libXfont/src/fontfile/catalogue.c +++ b/libXfont/src/fontfile/catalogue.c @@ -27,6 +27,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include <X11/Xwindows.h> #include <X11/fonts/fntfilst.h> #include <sys/types.h> #include <sys/stat.h> @@ -140,7 +141,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan) int pathlen; path = fpe->name + strlen(CataloguePrefix); - if (stat(path, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode)) + if (stat(path, &statbuf) < 0 || (statbuf.st_mode&_S_IFDIR)) return BadFontPath; if ((forceScan == FALSE) && (statbuf.st_mtime <= cat->mtime)) @@ -154,6 +155,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan) } CatalogueUnrefFPEs (fpe); + #ifndef _MSC_VER while (entry = readdir(dir), entry != NULL) { snprintf(link, sizeof link, "%s/%s", path, entry->d_name); @@ -218,6 +220,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan) continue; } } + #endif closedir(dir); diff --git a/libXfont/src/fontfile/fontfile.c b/libXfont/src/fontfile/fontfile.c index a738c4d34..ced1b90b2 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) @@ -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 diff --git a/libXfont/src/fontfile/makefile b/libXfont/src/fontfile/makefile new file mode 100644 index 000000000..12e289d30 --- /dev/null +++ b/libXfont/src/fontfile/makefile @@ -0,0 +1,25 @@ + +LIBRARY = libfontfile + +INCLUDES += $(MHMAKECONF)\zlib\src\zlib-1.2.3 + +DEFINES += X_GZIP_FONT_COMPRESSION + +CSRCS = bitsource.c \ + bufio.c \ + decompress.c \ + defaults.c \ + dirfile.c \ + fileio.c \ + filewr.c \ + fontdir.c \ + fontencc.c \ + fontfile.c \ + fontscale.c \ + gunzip.c \ + register.c \ + renderers.c \ + catalogue.c + +INCLUDES := ../../../../build $(INCLUDES) + diff --git a/libXfont/src/fontfile/renderers.c b/libXfont/src/fontfile/renderers.c index bf82c1c1e..f75faea0a 100644 --- a/libXfont/src/fontfile/renderers.c +++ b/libXfont/src/fontfile/renderers.c @@ -33,6 +33,7 @@ in this Software without prior written authorization from The Open Group. #include <config.h> #endif #include <X11/fonts/fntfilst.h> +#include <unistd.h> extern void ErrorF(const char *f, ...); static FontRenderersRec renderers; |