very minor code police. also fix a possible but unlikely missed cpu_boost(false)
[Rockbox.git] / firmware / include / dir_uncached.h
blobe198833c84b35105971dd20d8062a468bbcf5da4
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: dir.h 13741 2007-06-30 02:08:27Z jethead71 $
10 * Copyright (C) 2002 by Björn Stenberg
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 ****************************************************************************/
21 #ifndef _DIR_UNCACHED_H_
22 #define _DIR_UNCACHED_H_
24 #include <stdbool.h>
25 #include "file.h"
27 #define ATTR_READ_ONLY 0x01
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 */
35 #ifdef SIMULATOR
36 #define dirent_uncached sim_dirent
37 #define DIR_UNCACHED SIM_DIR
38 #define opendir_uncached sim_opendir
39 #define readdir_uncached sim_readdir
40 #define closedir_uncached sim_closedir
41 #define mkdir_uncached sim_mkdir
42 #define rmdir_uncached sim_rmdir
43 #endif
45 #ifndef DIRENT_DEFINED
47 struct dirent_uncached {
48 unsigned char d_name[MAX_PATH];
49 int attribute;
50 long size;
51 long startcluster;
52 unsigned short wrtdate; /* Last write date */
53 unsigned short wrttime; /* Last write time */
55 #endif
57 #include "fat.h"
59 typedef struct {
60 #ifndef SIMULATOR
61 bool busy;
62 long startcluster;
63 struct fat_dir fatdir;
64 struct fat_dir parent_dir;
65 struct dirent_uncached theent;
66 #ifdef HAVE_MULTIVOLUME
67 int volumecounter; /* running counter for faked volume entries */
68 #endif
69 #else
70 /* simulator: */
71 void *dir; /* actually a DIR* dir */
72 char *name;
73 #endif
74 } DIR_UNCACHED;
76 #ifdef HAVE_HOTSWAP
77 char *get_volume_name(int volume);
78 #endif
80 #ifdef HAVE_MULTIVOLUME
81 int strip_volume(const char*, char*);
82 #endif
84 #ifndef DIRFUNCTIONS_DEFINED
86 extern DIR_UNCACHED* opendir_uncached(const char* name);
87 extern int closedir_uncached(DIR_UNCACHED* dir);
88 extern int mkdir_uncached(const char* name);
89 extern int rmdir_uncached(const char* name);
91 extern struct dirent_uncached* readdir_uncached(DIR_UNCACHED* dir);
93 extern int release_dirs(int volume);
95 #endif /* DIRFUNCTIONS_DEFINED */
97 #endif