#include <linux/stat.h>
#include <linux/time.h>
-#if defined(CONFIG_CMD_FAT)
-
/* Supported filesystems */
static const struct filesystem filesystems[] = {
{ file_fat_detectfs, file_fat_ls, file_fat_read, "FAT" },
const char *
file_getfsname(int idx)
{
- if (idx < 0 || idx >= NUM_FILESYS) return NULL;
+ if (idx < 0 || idx >= NUM_FILESYS)
+ return NULL;
return filesystems[idx].name;
}
-
static void
pathcpy(char *dest, const char *src)
{
return;
}
++dest;
- if (ISDIRDELIM(*src)) {
+
+ if (ISDIRDELIM(*src))
while (ISDIRDELIM(*src)) src++;
- } else {
+ else
src++;
- }
} while (1);
}
-
int
file_cd(const char *path)
{
return 0;
}
-
int
file_detectfs(void)
{
return current_filesystem;
}
-
int
file_ls(const char *dir)
{
return filesystems[current_filesystem].ls(arg);
}
-
long
file_read(const char *filename, void *buffer, unsigned long maxsize)
{
return filesystems[current_filesystem].read(arg, buffer, maxsize);
}
-
-#endif