diff options
Diffstat (limited to 'apps/wince/sword/src/dirent.cpp')
-rw-r--r-- | apps/wince/sword/src/dirent.cpp | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/apps/wince/sword/src/dirent.cpp b/apps/wince/sword/src/dirent.cpp deleted file mode 100644 index 6b99cb9..0000000 --- a/apps/wince/sword/src/dirent.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include <dirent.h> - -#include <io.h> - - - -#ifdef _WIN32_WCE - -#include <swordce.h> - -#include <stdio.h> - -#endif - - - -DIR* opendir( const char *pSpec ) - -{ - - DIR *pDir = (DIR*) malloc(sizeof(DIR)); - -#ifdef _WIN32_WCE - - pDir->hFind = FindFirstFile(strtowstr(strcmp(pSpec, ".") ? pSpec : "*"), &pDir->wfd); - -#else - - pDir->hFind = FindFirstFile((strcmp(pSpec, ".") ? pSpec : "*"), &pDir->wfd); - -#endif - - return pDir; - -} - - - -void closedir(DIR * pDir) - -{ - - FindClose( pDir->hFind ); - - free(pDir); - -} - - - -struct dirent* readdir(DIR *pDir) - -{ - - if (pDir->hFind) - - { - -#ifdef _WIN32_WCE - - strcpy(pDir->de.d_name, wstrtostr(pDir->wfd.cFileName)); - -#else - - strcpy(pDir->de.d_name, pDir->wfd.cFileName); - -#endif - - - - if ( !FindNextFile(pDir->hFind, &pDir->wfd) ) - - pDir->hFind = NULL; - - - - return &pDir->de; - - } - - return NULL; - -} - - - -void rewinddir( DIR* dir ) - -{ - - lseek( (int) dir->hFind,0,SEEK_SET); - -} - - - -#define fclose(f) { if (f!=NULL) fclose(f); } - |