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
 
57 theseven 24
#include "global.h"
46 theseven 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
 
44
#include "fat.h"
45
 
46
typedef struct {
47
    bool busy;
48
    long startcluster;
49
    struct fat_dir fatdir;
53 theseven 50
    struct dirent theent;
46 theseven 51
#ifdef HAVE_MULTIVOLUME
52
    int volumecounter; /* running counter for faked volume entries */
53
#endif
54
} DIR;
55
 
56
#ifdef HAVE_HOTSWAP
57
char *get_volume_name(int volume);
58
#endif
59
 
60
#ifdef HAVE_MULTIVOLUME
61
    int strip_volume(const char*, char*);
62
#endif
63
 
64
extern DIR* opendir(const char* name);
65
extern int closedir(DIR* dir);
66
extern int mkdir(const char* name);
67
extern int rmdir(const char* name);
68
 
69
extern struct dirent* readdir(DIR* dir);
70
 
71
extern int release_dirs(int volume);
72
 
53 theseven 73
#endif