diff options
Diffstat (limited to 'firmware/include/dir_uncached.h')
-rw-r--r-- | firmware/include/dir_uncached.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h new file mode 100644 index 0000000000..575c3b67e4 --- /dev/null +++ b/firmware/include/dir_uncached.h | |||
@@ -0,0 +1,91 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: dir.h 13741 2007-06-30 02:08:27Z jethead71 $ | ||
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_UNCACHED_H_ | ||
20 | #define _DIR_UNCACHED_H_ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | #include "file.h" | ||
24 | |||
25 | #define ATTR_READ_ONLY 0x01 | ||
26 | #define ATTR_HIDDEN 0x02 | ||
27 | #define ATTR_SYSTEM 0x04 | ||
28 | #define ATTR_VOLUME_ID 0x08 | ||
29 | #define ATTR_DIRECTORY 0x10 | ||
30 | #define ATTR_ARCHIVE 0x20 | ||
31 | #define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ | ||
32 | |||
33 | #ifdef SIMULATOR | ||
34 | #define dirent_uncached sim_dirent | ||
35 | #define DIR_UNCACHED SIM_DIR | ||
36 | #define opendir_uncached sim_opendir | ||
37 | #define readdir_uncached sim_readdir | ||
38 | #define closedir_uncached sim_closedir | ||
39 | #define mkdir_uncached sim_mkdir | ||
40 | #define rmdir_uncached sim_rmdir | ||
41 | #endif | ||
42 | |||
43 | #ifndef DIRENT_DEFINED | ||
44 | |||
45 | struct dirent_uncached { | ||
46 | unsigned char d_name[MAX_PATH]; | ||
47 | int attribute; | ||
48 | long size; | ||
49 | long startcluster; | ||
50 | unsigned short wrtdate; /* Last write date */ | ||
51 | unsigned short wrttime; /* Last write time */ | ||
52 | }; | ||
53 | #endif | ||
54 | |||
55 | #include "fat.h" | ||
56 | |||
57 | typedef struct { | ||
58 | #ifndef SIMULATOR | ||
59 | bool busy; | ||
60 | long startcluster; | ||
61 | struct fat_dir fatdir; | ||
62 | struct fat_dir parent_dir; | ||
63 | struct dirent_uncached theent; | ||
64 | #ifdef HAVE_MULTIVOLUME | ||
65 | int volumecounter; /* running counter for faked volume entries */ | ||
66 | #endif | ||
67 | #else | ||
68 | /* simulator: */ | ||
69 | void *dir; /* actually a DIR* dir */ | ||
70 | char *name; | ||
71 | #endif | ||
72 | } DIR_UNCACHED; | ||
73 | |||
74 | #ifdef HAVE_HOTSWAP | ||
75 | char *get_volume_name(int volume); | ||
76 | #endif | ||
77 | |||
78 | #ifndef DIRFUNCTIONS_DEFINED | ||
79 | |||
80 | extern DIR_UNCACHED* opendir_uncached(const char* name); | ||
81 | extern int closedir_uncached(DIR_UNCACHED* dir); | ||
82 | extern int mkdir_uncached(const char* name); | ||
83 | extern int rmdir_uncached(const char* name); | ||
84 | |||
85 | extern struct dirent_uncached* readdir_uncached(DIR_UNCACHED* dir); | ||
86 | |||
87 | extern int release_dirs(int volume); | ||
88 | |||
89 | #endif /* DIRFUNCTIONS_DEFINED */ | ||
90 | |||
91 | #endif | ||