1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Kévin Ferrare
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 #ifdef HAVE_MULTIVOLUME
29 /* how to name volumes, first char must be outside of legal file names,
30 a number gets appended to enumerate, if applicable */
31 #if (CONFIG_STORAGE & STORAGE_MMC)
32 #define VOL_NAMES "<MMC%d>"
33 #define VOL_ENUM_POS 4 /* position of %d, to avoid runtime calculation */
34 #elif (CONFIG_STORAGE & STORAGE_SD)
35 #define VOL_NAMES "<microSD%d>"
36 #define VOL_ENUM_POS 8 /* position of %d, to avoid runtime calculation */
38 #define VOL_NAMES "<HD%d>"
39 #define VOL_ENUM_POS 3
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 #define ATTR_LINK 0x80
54 # include "dircache.h"
55 # define DIR DIR_CACHED
56 # define dirent dirent_cached
57 # define opendir opendir_cached
58 # define closedir closedir_cached
59 # define readdir readdir_cached
60 # define closedir closedir_cached
61 # define mkdir mkdir_cached
62 # define rmdir rmdir_cached
64 # include "dir_uncached.h"
65 # define DIR DIR_UNCACHED
66 # define dirent dirent_uncached
67 # define opendir opendir_uncached
68 # define closedir closedir_uncached
69 # define readdir readdir_uncached
70 # define closedir closedir_uncached
71 # define mkdir mkdir_uncached
72 # define rmdir rmdir_uncached
76 typedef DIR* (*opendir_func
)(const char* name
);
77 typedef int (*closedir_func
)(DIR* dir
);
78 typedef struct dirent
* (*readdir_func
)(DIR* dir
);