renamed file-win32.c/h to dir-win32.c/h

corrected function definition for directory access functions.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@302 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Felix Arends 2002-04-28 19:27:16 +00:00
parent aca76186c0
commit 98ed5ed17a
4 changed files with 11 additions and 27 deletions

View file

@ -19,8 +19,8 @@
#include <io.h> #include <io.h>
#include <malloc.h> #include <malloc.h>
#include "file-win32.h" #include "dir-win32.h"
#include "file.h" #include "dir.h"
// Directory operations // Directory operations
// //
@ -36,7 +36,7 @@ DIR *opendir (
if ((p->handle = _findfirst (dirname, &fd)) == -1) if ((p->handle = _findfirst (dirname, &fd)) == -1)
{ {
free (p); free (p);
return NULL; return 0;
} }
return p; return p;
} }
@ -53,14 +53,13 @@ int closedir (
// read dir // read dir
// read next entry in directory // read next entry in directory
dirent *readdir ( struct dirent *readdir (
DIR *dir DIR *dir
) )
{ {
struct _finddata_t fd; struct _finddata_t fd;
if (_findnext (dir->handle, &fd) == -1) if (_findnext (dir->handle, &fd) == -1)
return NULL; return 0;
memcpy (dir->fd.d_name, fd.name, 256); memcpy (dir->fd.d_name, fd.name, 256);
dir->fd.d_reclen = sizeof (dirent);
return &dir->fd; return &dir->fd;
} }

View file

@ -21,22 +21,7 @@
#define __FILE_WIN32_H__ #define __FILE_WIN32_H__
#include <io.h> #include <io.h>
#include "dir.h"
struct direnttag
{
long d_ino; /* inode number */
long d_off; /* offset to the next dirent */
unsigned short d_reclen;/* length of this record */
unsigned char d_type; /* type of file */
char d_name[256]; /* filename */
};
typedef struct direnttag dirent;
struct DIRtag
{
dirent fd;
intptr_t handle;
};
typedef struct DIRtag DIR;
#endif // #ifndef __FILE_WIN32_H__ #endif // #ifndef __FILE_WIN32_H__

Binary file not shown.

View file

@ -115,6 +115,9 @@
<File <File
RelativePath="..\..\firmware\chartables.c"> RelativePath="..\..\firmware\chartables.c">
</File> </File>
<File
RelativePath="dir-win32.c">
</File>
<File <File
RelativePath="kernel.c"> RelativePath="kernel.c">
</File> </File>
@ -134,9 +137,6 @@
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc"> Filter="h;hpp;hxx;hm;inl;inc">
<File
RelativePath="file-win32.h">
</File>
<File <File
RelativePath="lcd-win32.h"> RelativePath="lcd-win32.h">
</File> </File>