summaryrefslogtreecommitdiff
path: root/firmware/include/file_internal.h
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-03-03 07:37:03 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2022-03-03 18:58:07 -0500
commit9daacabd658508d2607a64b288c9bce7a635fb15 (patch)
treece96538ea82a4176f00f8eb9531711db7dea5750 /firmware/include/file_internal.h
parentf88ea12bacf381ad4f39ba2328c806e772c0dda8 (diff)
downloadrockbox-9daacabd658508d2607a64b288c9bce7a635fb15.tar.gz
rockbox-9daacabd658508d2607a64b288c9bce7a635fb15.zip
[RESTORED!] Allow mounting of any directory as the root directory.
Provide definitions for the macros: * RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root. * RB_ROOT_CONTENTS to return a string with the name of the directory to mount in the root. Defaults are in export/rbpaths.h It's a bit much for those that don't need the full functionality. Some conditional define can cut it back a lot to cut out things only needed if alternate root mounts are required. I'm just not bothering yet. The basic concept would be applied to all targets to keep file code from forking too much. Change-Id: I3b5a14c530ff4b10d97f67636237d96875eb8969 Author: Michael Sevakis
Diffstat (limited to 'firmware/include/file_internal.h')
-rw-r--r--firmware/include/file_internal.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/firmware/include/file_internal.h b/firmware/include/file_internal.h
index d62b5a8541..ec0c5d28f0 100644
--- a/firmware/include/file_internal.h
+++ b/firmware/include/file_internal.h
@@ -30,6 +30,7 @@
30#include "fs_attr.h" 30#include "fs_attr.h"
31#include "fs_defines.h" 31#include "fs_defines.h"
32#include "fat.h" 32#include "fat.h"
33#include "dir.h"
33#ifdef HAVE_DIRCACHE 34#ifdef HAVE_DIRCACHE
34#include "dircache.h" 35#include "dircache.h"
35#endif 36#endif
@@ -72,17 +73,20 @@ enum fildes_and_obj_flags
72 /* used in descriptor and common */ 73 /* used in descriptor and common */
73 FDO_BUSY = 0x0001, /* descriptor/object is in use */ 74 FDO_BUSY = 0x0001, /* descriptor/object is in use */
74 /* only used in individual stream descriptor */ 75 /* only used in individual stream descriptor */
75 FD_WRITE = 0x0002, /* descriptor has write mode */ 76 FD_VALID = 0x0002, /* descriptor is valid but not registered */
76 FD_WRONLY = 0x0004, /* descriptor is write mode only */ 77 FD_WRITE = 0x0004, /* descriptor has write mode */
77 FD_APPEND = 0x0008, /* descriptor is append mode */ 78 FD_WRONLY = 0x0008, /* descriptor is write mode only */
79 FD_APPEND = 0x0010, /* descriptor is append mode */
78 FD_NONEXIST = 0x8000, /* closed but not freed (uncombined) */ 80 FD_NONEXIST = 0x8000, /* closed but not freed (uncombined) */
79 /* only used as common flags */ 81 /* only used as common flags */
80 FO_DIRECTORY = 0x0010, /* fileobj is a directory */ 82 FO_DIRECTORY = 0x0020, /* fileobj is a directory */
81 FO_TRUNC = 0x0020, /* fileobj is opened to be truncated */ 83 FO_TRUNC = 0x0040, /* fileobj is opened to be truncated */
82 FO_REMOVED = 0x0040, /* fileobj was deleted while open */ 84 FO_REMOVED = 0x0080, /* fileobj was deleted while open */
83 FO_SINGLE = 0x0080, /* fileobj has only one stream open */ 85 FO_SINGLE = 0x0100, /* fileobj has only one stream open */
84 FDO_MASK = 0x00ff, 86 FO_MOUNTTARGET = 0x0200, /* fileobj kept open as a mount target */
85 FDO_CHG_MASK = FO_TRUNC, /* fileobj permitted external change */ 87 FDO_MASK = 0x03ff,
88 FDO_CHG_MASK = FO_TRUNC,
89 /* fileobj permitted external change */ /* fileobj permitted external change */
86 /* bitflags that instruct various 'open' functions how to behave; 90 /* bitflags that instruct various 'open' functions how to behave;
87 * saved in stream flags (only) but not used by manager */ 91 * saved in stream flags (only) but not used by manager */
88 FF_FILE = 0x00000000, /* expect file; accept file only */ 92 FF_FILE = 0x00000000, /* expect file; accept file only */
@@ -95,7 +99,9 @@ enum fildes_and_obj_flags
95 FF_CACHEONLY = 0x00200000, /* succeed only if in dircache */ 99 FF_CACHEONLY = 0x00200000, /* succeed only if in dircache */
96 FF_INFO = 0x00400000, /* return info on self */ 100 FF_INFO = 0x00400000, /* return info on self */
97 FF_PARENTINFO = 0x00800000, /* return info on parent */ 101 FF_PARENTINFO = 0x00800000, /* return info on parent */
98 FF_MASK = 0x00ff0000, 102 FF_DEVPATH = 0x01000000, /* path is a device path, not root-based */
103 FF_NOFS = 0x02000000, /* no filesystem mounted here */
104 FF_MASK = 0x03ff0000,
99}; 105};
100 106
101/** Common data structures used throughout **/ 107/** Common data structures used throughout **/
@@ -229,10 +235,10 @@ int test_stream_exists_internal(const char *path, unsigned int callflags);
229int open_noiso_internal(const char *path, int oflag); /* file.c */ 235int open_noiso_internal(const char *path, int oflag); /* file.c */
230void force_close_writer_internal(struct filestr_base *stream); /* file.c */ 236void force_close_writer_internal(struct filestr_base *stream); /* file.c */
231 237
232struct dirent; 238struct DIRENT;
233int uncached_readdir_dirent(struct filestr_base *stream, 239int uncached_readdir_dirent(struct filestr_base *stream,
234 struct dirscan_info *scanp, 240 struct dirscan_info *scanp,
235 struct dirent *entry); 241 struct DIRENT *entry);
236void uncached_rewinddir_dirent(struct dirscan_info *scanp); 242void uncached_rewinddir_dirent(struct dirscan_info *scanp);
237 243
238int uncached_readdir_internal(struct filestr_base *stream, 244int uncached_readdir_internal(struct filestr_base *stream,
@@ -333,7 +339,7 @@ static inline struct fat_direntry *get_dir_fatent(void)
333void iso_decode_d_name(char *d_name); 339void iso_decode_d_name(char *d_name);
334 340
335#ifdef HAVE_DIRCACHE 341#ifdef HAVE_DIRCACHE
336void empty_dirent(struct dirent *entry); 342void empty_dirent(struct DIRENT *entry);
337void fill_dirinfo_native(struct dirinfo_native *din); 343void fill_dirinfo_native(struct dirinfo_native *din);
338#endif /* HAVE_DIRCACHE */ 344#endif /* HAVE_DIRCACHE */
339 345