2002-04-27 23:31:23 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2008-05-05 10:32:46 +00:00
|
|
|
* Copyright (C) 2007 by Kévin Ferrare
|
2002-04-27 23:31:23 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-04-27 23:31:23 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2007-07-20 17:06:55 +00:00
|
|
|
|
2002-04-27 23:31:23 +00:00
|
|
|
#ifndef _DIR_H_
|
|
|
|
#define _DIR_H_
|
|
|
|
|
2007-07-21 14:21:11 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2008-03-11 19:39:26 +00:00
|
|
|
#ifdef HAVE_MULTIVOLUME
|
|
|
|
|
|
|
|
/* how to name volumes, first char must be outside of legal file names,
|
|
|
|
a number gets appended to enumerate, if applicable */
|
2008-10-31 21:25:04 +00:00
|
|
|
#if (CONFIG_STORAGE & STORAGE_MMC)
|
2008-03-11 19:39:26 +00:00
|
|
|
#define VOL_NAMES "<MMC%d>"
|
|
|
|
#define VOL_ENUM_POS 4 /* position of %d, to avoid runtime calculation */
|
2008-10-31 21:25:04 +00:00
|
|
|
#elif (CONFIG_STORAGE & STORAGE_SD)
|
2008-03-11 19:39:26 +00:00
|
|
|
#define VOL_NAMES "<microSD%d>"
|
|
|
|
#define VOL_ENUM_POS 8 /* position of %d, to avoid runtime calculation */
|
|
|
|
#else
|
|
|
|
#define VOL_NAMES "<HD%d>"
|
|
|
|
#define VOL_ENUM_POS 3
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-09-01 21:29:34 +00:00
|
|
|
#define ATTR_READ_ONLY 0x01
|
|
|
|
#define ATTR_HIDDEN 0x02
|
|
|
|
#define ATTR_SYSTEM 0x04
|
|
|
|
#define ATTR_VOLUME_ID 0x08
|
|
|
|
#define ATTR_DIRECTORY 0x10
|
|
|
|
#define ATTR_ARCHIVE 0x20
|
|
|
|
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
|
2010-12-23 19:02:18 +00:00
|
|
|
#define ATTR_LINK 0x80
|
2010-09-01 21:29:34 +00:00
|
|
|
|
2007-07-20 17:06:55 +00:00
|
|
|
#ifdef HAVE_DIRCACHE
|
|
|
|
# include "dircache.h"
|
|
|
|
# define DIR DIR_CACHED
|
2010-02-16 22:49:11 +00:00
|
|
|
# define dirent dirent_cached
|
2007-07-20 17:06:55 +00:00
|
|
|
# define opendir opendir_cached
|
|
|
|
# define closedir closedir_cached
|
|
|
|
# define readdir readdir_cached
|
|
|
|
# define closedir closedir_cached
|
|
|
|
# define mkdir mkdir_cached
|
|
|
|
# define rmdir rmdir_cached
|
2005-02-22 12:19:12 +00:00
|
|
|
#else
|
2010-12-06 22:26:31 +00:00
|
|
|
# include "dir_uncached.h"
|
2007-07-20 17:06:55 +00:00
|
|
|
# define DIR DIR_UNCACHED
|
|
|
|
# define dirent dirent_uncached
|
2007-07-21 14:21:45 +00:00
|
|
|
# define opendir opendir_uncached
|
2007-07-20 17:06:55 +00:00
|
|
|
# define closedir closedir_uncached
|
|
|
|
# define readdir readdir_uncached
|
|
|
|
# define closedir closedir_uncached
|
|
|
|
# define mkdir mkdir_uncached
|
|
|
|
# define rmdir rmdir_uncached
|
2007-06-30 02:08:27 +00:00
|
|
|
#endif
|
|
|
|
|
2010-12-29 20:10:11 +00:00
|
|
|
|
|
|
|
typedef DIR* (*opendir_func)(const char* name);
|
|
|
|
typedef int (*closedir_func)(DIR* dir);
|
|
|
|
typedef struct dirent* (*readdir_func)(DIR* dir);
|
|
|
|
|
2002-04-27 23:31:23 +00:00
|
|
|
#endif
|