-// under Win16 use compiler-specific functions
-#ifdef __WIN16__
- #ifdef __VISUALC__
- #include <dos.h>
- #include <errno.h>
-
- typedef struct _find_t FIND_STRUCT;
- #elif defined(__BORLANDC__)
- #include <dir.h>
-
- typedef struct ffblk FIND_STRUCT;
- #else
- #error "No directory searching functions for this compiler"
- #endif
-
- typedef FIND_STRUCT *FIND_DATA;
- typedef char FIND_ATTR;
-
- static inline FIND_DATA InitFindData() { return (FIND_DATA)NULL; }
- static inline bool IsFindDataOk(FIND_DATA fd) { return fd != NULL; }
- static inline void FreeFindData(FIND_DATA fd) { free(fd); }
-
- static inline FIND_DATA FindFirst(const wxString& spec,
- FIND_STRUCT * WXUNUSED(finddata))
- {
- // attribute to find all files
- static const FIND_ATTR attr = 0x3F;
-
- FIND_DATA fd = (FIND_DATA)malloc(sizeof(FIND_STRUCT));
-
- if (
- #ifdef __VISUALC__
- _dos_findfirst(spec, attr, fd) == 0
- #else // Borland
- findfirst(spec, fd, attr) == 0
- #endif
- )
- {
- return fd;
- }
- else
- {
- free(fd);
-
- return NULL;
- }
- }
-
- static inline bool FindNext(FIND_DATA fd, FIND_STRUCT * WXUNUSED(finddata))
- {
- #ifdef __VISUALC__
- return _dos_findnext(fd) == 0;
- #else // Borland
- return findnext(fd) == 0;
- #endif
- }
-
- static const wxChar *GetNameFromFindData(FIND_STRUCT *finddata)
- {
- #ifdef __VISUALC__
- return finddata->name;
- #else // Borland
- return finddata->ff_name;
- #endif
- }
-
- static const FIND_ATTR GetAttrFromFindData(FIND_STRUCT *finddata)
- {
- #ifdef __VISUALC__
- return finddata->attrib;
- #else // Borland
- return finddata->ff_attrib;
- #endif
- }
-
- static inline bool IsDir(FIND_ATTR attr)
- {
- return (attr & _A_SUBDIR) != 0;
- }