diff options
Diffstat (limited to 'firmware/include')
-rw-r--r-- | firmware/include/dir.h | 13 | ||||
-rw-r--r-- | firmware/include/dir_uncached.h | 26 | ||||
-rw-r--r-- | firmware/include/dircache.h | 10 | ||||
-rw-r--r-- | firmware/include/file.h | 2 |
4 files changed, 29 insertions, 22 deletions
diff --git a/firmware/include/dir.h b/firmware/include/dir.h index 9ff96e3419..d143ed2664 100644 --- a/firmware/include/dir.h +++ b/firmware/include/dir.h | |||
@@ -41,6 +41,15 @@ | |||
41 | 41 | ||
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #define ATTR_READ_ONLY 0x01 | ||
45 | #define ATTR_HIDDEN 0x02 | ||
46 | #define ATTR_SYSTEM 0x04 | ||
47 | #define ATTR_VOLUME_ID 0x08 | ||
48 | #define ATTR_DIRECTORY 0x10 | ||
49 | #define ATTR_ARCHIVE 0x20 | ||
50 | #define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ | ||
51 | |||
52 | #if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL)) | ||
44 | #ifdef HAVE_DIRCACHE | 53 | #ifdef HAVE_DIRCACHE |
45 | # include "dircache.h" | 54 | # include "dircache.h" |
46 | # define DIR DIR_CACHED | 55 | # define DIR DIR_CACHED |
@@ -62,5 +71,9 @@ | |||
62 | # define mkdir mkdir_uncached | 71 | # define mkdir mkdir_uncached |
63 | # define rmdir rmdir_uncached | 72 | # define rmdir rmdir_uncached |
64 | #endif | 73 | #endif |
74 | #else | ||
75 | #include "dir_uncached.h" | ||
76 | #include "dir-target.h" | ||
77 | #endif | ||
65 | 78 | ||
66 | #endif | 79 | #endif |
diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h index f225cf8e39..5c7ed14658 100644 --- a/firmware/include/dir_uncached.h +++ b/firmware/include/dir_uncached.h | |||
@@ -21,18 +21,20 @@ | |||
21 | #ifndef _DIR_UNCACHED_H_ | 21 | #ifndef _DIR_UNCACHED_H_ |
22 | #define _DIR_UNCACHED_H_ | 22 | #define _DIR_UNCACHED_H_ |
23 | 23 | ||
24 | #include "config.h" | ||
25 | |||
26 | struct dirinfo { | ||
27 | int attribute; | ||
28 | long size; | ||
29 | unsigned short wrtdate; | ||
30 | unsigned short wrttime; | ||
31 | }; | ||
32 | |||
33 | #ifndef APPLICATION | ||
24 | #include <stdbool.h> | 34 | #include <stdbool.h> |
25 | #include "file.h" | 35 | #include "file.h" |
26 | 36 | ||
27 | #define ATTR_READ_ONLY 0x01 | 37 | #if (CONFIG_PLATFORM & PLATFORM_SDL) |
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 | #define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ | ||
34 | |||
35 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) | ||
36 | #define dirent_uncached sim_dirent | 38 | #define dirent_uncached sim_dirent |
37 | #define DIR_UNCACHED SIM_DIR | 39 | #define DIR_UNCACHED SIM_DIR |
38 | #define opendir_uncached sim_opendir | 40 | #define opendir_uncached sim_opendir |
@@ -46,11 +48,8 @@ | |||
46 | 48 | ||
47 | struct dirent_uncached { | 49 | struct dirent_uncached { |
48 | unsigned char d_name[MAX_PATH]; | 50 | unsigned char d_name[MAX_PATH]; |
49 | int attribute; | 51 | struct dirinfo info; |
50 | long size; | ||
51 | long startcluster; | 52 | long startcluster; |
52 | unsigned short wrtdate; /* Last write date */ | ||
53 | unsigned short wrttime; /* Last write time */ | ||
54 | }; | 53 | }; |
55 | #endif | 54 | #endif |
56 | 55 | ||
@@ -92,5 +91,6 @@ extern struct dirent_uncached* readdir_uncached(DIR_UNCACHED* dir); | |||
92 | extern int release_dirs(int volume); | 91 | extern int release_dirs(int volume); |
93 | 92 | ||
94 | #endif /* DIRFUNCTIONS_DEFINED */ | 93 | #endif /* DIRFUNCTIONS_DEFINED */ |
94 | #endif | ||
95 | 95 | ||
96 | #endif | 96 | #endif |
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h index 650b92632d..37a803c63c 100644 --- a/firmware/include/dircache.h +++ b/firmware/include/dircache.h | |||
@@ -63,25 +63,19 @@ struct fdbind_queue { | |||
63 | 63 | ||
64 | /* Exported structures. */ | 64 | /* Exported structures. */ |
65 | struct dircache_entry { | 65 | struct dircache_entry { |
66 | struct dirinfo info; | ||
66 | struct dircache_entry *next; | 67 | struct dircache_entry *next; |
67 | struct dircache_entry *up; | 68 | struct dircache_entry *up; |
68 | struct dircache_entry *down; | 69 | struct dircache_entry *down; |
69 | int attribute; | ||
70 | long size; | ||
71 | long startcluster; | 70 | long startcluster; |
72 | unsigned short wrtdate; | ||
73 | unsigned short wrttime; | ||
74 | unsigned long name_len; | 71 | unsigned long name_len; |
75 | char *d_name; | 72 | char *d_name; |
76 | }; | 73 | }; |
77 | 74 | ||
78 | struct dirent_cached { | 75 | struct dirent_cached { |
76 | struct dirinfo info; | ||
79 | char *d_name; | 77 | char *d_name; |
80 | int attribute; | ||
81 | long size; | ||
82 | long startcluster; | 78 | long startcluster; |
83 | unsigned short wrtdate; /* Last write date */ | ||
84 | unsigned short wrttime; /* Last write time */ | ||
85 | }; | 79 | }; |
86 | 80 | ||
87 | typedef struct { | 81 | typedef struct { |
diff --git a/firmware/include/file.h b/firmware/include/file.h index 8a084d6f39..8711124391 100644 --- a/firmware/include/file.h +++ b/firmware/include/file.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #define MAX_OPEN_FILES 11 | 37 | #define MAX_OPEN_FILES 11 |
38 | 38 | ||
39 | #if !defined(PLUGIN) && !defined(CODEC) | 39 | #if !defined(PLUGIN) && !defined(CODEC) |
40 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) | 40 | #if (CONFIG_PLATFORM & PLATFORM_SDL) |
41 | #define open(x, ...) sim_open(x, __VA_ARGS__) | 41 | #define open(x, ...) sim_open(x, __VA_ARGS__) |
42 | #define creat(x,m) sim_creat(x,m) | 42 | #define creat(x,m) sim_creat(x,m) |
43 | #define remove(x) sim_remove(x) | 43 | #define remove(x) sim_remove(x) |