summaryrefslogtreecommitdiff
path: root/firmware/include/dir.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/include/dir.h')
-rw-r--r--firmware/include/dir.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/firmware/include/dir.h b/firmware/include/dir.h
new file mode 100644
index 0000000000..6b275abda8
--- /dev/null
+++ b/firmware/include/dir.h
@@ -0,0 +1,81 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Björn Stenberg
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef _DIR_H_
20#define _DIR_H_
21
22#include <stdbool.h>
23#include "file.h"
24
25#ifndef DIRENT_DEFINED
26
27#define ATTR_READ_ONLY 0x01
28#define ATTR_HIDDEN 0x02
29#define ATTR_SYSTEM 0x04
30#define ATTR_VOLUME_ID 0x08
31#define ATTR_DIRECTORY 0x10
32#define ATTR_ARCHIVE 0x20
33
34struct dirent {
35 unsigned char d_name[MAX_PATH];
36 int attribute;
37 int size;
38 int startcluster;
39};
40#endif
41
42
43#ifndef SIMULATOR
44
45#include "fat.h"
46
47typedef struct {
48 bool busy;
49 int startcluster;
50 struct fat_dir fatdir;
51 struct dirent theent;
52} DIR;
53
54#else // SIMULATOR
55
56#ifdef WIN32
57#ifndef __MINGW32__
58#include <io.h>
59#endif /* __MINGW32__ */
60
61typedef struct DIRtag
62{
63 struct dirent fd;
64 int handle;
65} DIR;
66
67#endif /* WIN32 */
68
69#endif // SIMULATOR
70
71#ifndef DIRFUNCTIONS_DEFINED
72
73extern DIR* opendir(char* name);
74extern int closedir(DIR* dir);
75extern int mkdir(char* name);
76
77extern struct dirent* readdir(DIR* dir);
78
79#endif /* DIRFUNCTIONS_DEFINED */
80
81#endif