From 98ed5ed17a246e01805b6d187bdfc445fe7d0f7b Mon Sep 17 00:00:00 2001 From: Felix Arends Date: Sun, 28 Apr 2002 19:27:16 +0000 Subject: 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 --- uisimulator/win32/dir-win32.c | 65 +++++++++++++++++++++++++++++++++++++++ uisimulator/win32/dir-win32.h | 27 ++++++++++++++++ uisimulator/win32/file-win32.c | 66 ---------------------------------------- uisimulator/win32/file-win32.h | 42 ------------------------- uisimulator/win32/uisw32.suo | Bin 9728 -> 11264 bytes uisimulator/win32/uisw32.vcproj | 6 ++-- 6 files changed, 95 insertions(+), 111 deletions(-) create mode 100644 uisimulator/win32/dir-win32.c create mode 100644 uisimulator/win32/dir-win32.h delete mode 100644 uisimulator/win32/file-win32.c delete mode 100644 uisimulator/win32/file-win32.h diff --git a/uisimulator/win32/dir-win32.c b/uisimulator/win32/dir-win32.c new file mode 100644 index 0000000000..3a30d57ae1 --- /dev/null +++ b/uisimulator/win32/dir-win32.c @@ -0,0 +1,65 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Felix Arends + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include +#include +#include "dir-win32.h" +#include "dir.h" + +// Directory operations +// + +// opendir +// open directory for scanning +DIR *opendir ( + char *dirname // directory name + ) +{ + DIR *p = (DIR*)malloc(sizeof(DIR)); + struct _finddata_t fd; + if ((p->handle = _findfirst (dirname, &fd)) == -1) + { + free (p); + return 0; + } + return p; +} + +// closedir +// close directory +int closedir ( + DIR *dir // previously opened dir search + ) +{ + free(dir); + return 0; +} + +// read dir +// read next entry in directory +struct dirent *readdir ( + DIR *dir + ) +{ + struct _finddata_t fd; + if (_findnext (dir->handle, &fd) == -1) + return 0; + memcpy (dir->fd.d_name, fd.name, 256); + return &dir->fd; +} \ No newline at end of file diff --git a/uisimulator/win32/dir-win32.h b/uisimulator/win32/dir-win32.h new file mode 100644 index 0000000000..e51dfba747 --- /dev/null +++ b/uisimulator/win32/dir-win32.h @@ -0,0 +1,27 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Felix Arends + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef __FILE_WIN32_H__ +#define __FILE_WIN32_H__ + +#include +#include "dir.h" + + +#endif // #ifndef __FILE_WIN32_H__ \ No newline at end of file diff --git a/uisimulator/win32/file-win32.c b/uisimulator/win32/file-win32.c deleted file mode 100644 index 57431e92a2..0000000000 --- a/uisimulator/win32/file-win32.c +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Felix Arends - * - * All files in this archive are subject to the GNU General Public License. - * See the file COPYING in the source tree root for full license agreement. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#include -#include -#include "file-win32.h" -#include "file.h" - -// Directory operations -// - -// opendir -// open directory for scanning -DIR *opendir ( - char *dirname // directory name - ) -{ - DIR *p = (DIR*)malloc(sizeof(DIR)); - struct _finddata_t fd; - if ((p->handle = _findfirst (dirname, &fd)) == -1) - { - free (p); - return NULL; - } - return p; -} - -// closedir -// close directory -int closedir ( - DIR *dir // previously opened dir search - ) -{ - free(dir); - return 0; -} - -// read dir -// read next entry in directory -dirent *readdir ( - DIR *dir - ) -{ - struct _finddata_t fd; - if (_findnext (dir->handle, &fd) == -1) - return NULL; - memcpy (dir->fd.d_name, fd.name, 256); - dir->fd.d_reclen = sizeof (dirent); - return &dir->fd; -} \ No newline at end of file diff --git a/uisimulator/win32/file-win32.h b/uisimulator/win32/file-win32.h deleted file mode 100644 index a89ee4319d..0000000000 --- a/uisimulator/win32/file-win32.h +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Felix Arends - * - * All files in this archive are subject to the GNU General Public License. - * See the file COPYING in the source tree root for full license agreement. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#ifndef __FILE_WIN32_H__ -#define __FILE_WIN32_H__ - -#include - -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__ \ No newline at end of file diff --git a/uisimulator/win32/uisw32.suo b/uisimulator/win32/uisw32.suo index fa961efe48..b14fa23728 100644 Binary files a/uisimulator/win32/uisw32.suo and b/uisimulator/win32/uisw32.suo differ diff --git a/uisimulator/win32/uisw32.vcproj b/uisimulator/win32/uisw32.vcproj index 00d87f610b..4419bef715 100644 --- a/uisimulator/win32/uisw32.vcproj +++ b/uisimulator/win32/uisw32.vcproj @@ -115,6 +115,9 @@ + + @@ -134,9 +137,6 @@ - - -- cgit v1.2.3