| 46 |
theseven |
1 |
/***************************************************************************
|
|
|
2 |
* __________ __ ___.
|
|
|
3 |
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
4 |
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
5 |
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
6 |
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
7 |
* \/ \/ \/ \/ \/
|
|
|
8 |
* $Id: dir.h 13741 2007-06-30 02:08:27Z jethead71 $
|
|
|
9 |
*
|
|
|
10 |
* Copyright (C) 2002 by Björn Stenberg
|
|
|
11 |
*
|
|
|
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.
|
|
|
16 |
*
|
|
|
17 |
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
18 |
* KIND, either express or implied.
|
|
|
19 |
*
|
|
|
20 |
****************************************************************************/
|
|
|
21 |
#ifndef __DIR_H__
|
|
|
22 |
#define __DIR_H__
|
|
|
23 |
|
| 57 |
theseven |
24 |
#include "global.h"
|
| 58 |
theseven |
25 |
#include "thread.h"
|
| 46 |
theseven |
26 |
#include "file.h"
|
|
|
27 |
|
|
|
28 |
#define ATTR_READ_ONLY 0x01
|
|
|
29 |
#define ATTR_HIDDEN 0x02
|
|
|
30 |
#define ATTR_SYSTEM 0x04
|
|
|
31 |
#define ATTR_VOLUME_ID 0x08
|
|
|
32 |
#define ATTR_DIRECTORY 0x10
|
|
|
33 |
#define ATTR_ARCHIVE 0x20
|
|
|
34 |
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
|
|
|
35 |
|
|
|
36 |
struct dirent {
|
|
|
37 |
unsigned char d_name[MAX_PATH];
|
|
|
38 |
int attribute;
|
|
|
39 |
long size;
|
|
|
40 |
long startcluster;
|
|
|
41 |
unsigned short wrtdate; /* Last write date */
|
|
|
42 |
unsigned short wrttime; /* Last write time */
|
|
|
43 |
};
|
|
|
44 |
|
| 298 |
theseven |
45 |
#ifdef IN_APPLICATION_CODE
|
|
|
46 |
#define DIR void
|
|
|
47 |
#else
|
| 46 |
theseven |
48 |
#include "fat.h"
|
|
|
49 |
|
|
|
50 |
typedef struct {
|
|
|
51 |
bool busy;
|
|
|
52 |
long startcluster;
|
|
|
53 |
struct fat_dir fatdir;
|
| 53 |
theseven |
54 |
struct dirent theent;
|
| 58 |
theseven |
55 |
struct scheduler_thread* process;
|
| 46 |
theseven |
56 |
#ifdef HAVE_MULTIVOLUME
|
|
|
57 |
int volumecounter; /* running counter for faked volume entries */
|
|
|
58 |
#endif
|
|
|
59 |
} DIR;
|
| 298 |
theseven |
60 |
#endif
|
| 46 |
theseven |
61 |
|
|
|
62 |
#ifdef HAVE_HOTSWAP
|
|
|
63 |
char *get_volume_name(int volume);
|
|
|
64 |
#endif
|
|
|
65 |
|
|
|
66 |
#ifdef HAVE_MULTIVOLUME
|
|
|
67 |
int strip_volume(const char*, char*);
|
|
|
68 |
#endif
|
|
|
69 |
|
|
|
70 |
extern DIR* opendir(const char* name);
|
|
|
71 |
extern int closedir(DIR* dir);
|
| 58 |
theseven |
72 |
extern int closedir_all_of_process(struct scheduler_thread* process);
|
| 46 |
theseven |
73 |
extern int mkdir(const char* name);
|
|
|
74 |
extern int rmdir(const char* name);
|
|
|
75 |
|
|
|
76 |
extern struct dirent* readdir(DIR* dir);
|
|
|
77 |
|
|
|
78 |
extern int release_dirs(int volume);
|
|
|
79 |
|
| 53 |
theseven |
80 |
#endif
|