Subversion Repositories freemyipod

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
 
24
#include <stdbool.h>
25
#include "file.h"
26
 
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 */
34
 
35
struct dirent {
36
    unsigned char d_name[MAX_PATH];
37
    int attribute;
38
    long size;
39
    long startcluster;
40
    unsigned short wrtdate; /*  Last write date */ 
41
    unsigned short wrttime; /*  Last write time */
42
};
43
#endif
44
 
45
#include "fat.h"
46
 
47
typedef struct {
48
    bool busy;
49
    long startcluster;
50
    struct fat_dir fatdir;
51
    struct dirent_uncached theent;
52
#ifdef HAVE_MULTIVOLUME
53
    int volumecounter; /* running counter for faked volume entries */
54
#endif
55
} DIR;
56
 
57
#ifdef HAVE_HOTSWAP
58
char *get_volume_name(int volume);
59
#endif
60
 
61
#ifdef HAVE_MULTIVOLUME
62
    int strip_volume(const char*, char*);
63
#endif
64
 
65
extern DIR* opendir(const char* name);
66
extern int closedir(DIR* dir);
67
extern int mkdir(const char* name);
68
extern int rmdir(const char* name);
69
 
70
extern struct dirent* readdir(DIR* dir);
71
 
72
extern int release_dirs(int volume);
73
 
74
#endif /* DIRFUNCTIONS_DEFINED */
75
 
76
#endif