RetroArch
fatdir.h
Go to the documentation of this file.
1 /*
2  fatdir.h
3 
4  Functions used by the newlib disc stubs to interface with
5  this library
6 
7  Copyright (c) 2006 Michael "Chishm" Chisholm
8 
9  Redistribution and use in source and binary forms, with or without modification,
10  are permitted provided that the following conditions are met:
11 
12  1. Redistributions of source code must retain the above copyright notice,
13  this list of conditions and the following disclaimer.
14  2. Redistributions in binary form must reproduce the above copyright notice,
15  this list of conditions and the following disclaimer in the documentation and/or
16  other materials provided with the distribution.
17  3. The name of the author may not be used to endorse or promote products derived
18  from this software without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
21  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
23  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 
31 
32 #ifndef _FATDIR_H
33 #define _FATDIR_H
34 
35 #include <sys/reent.h>
36 #include <sys/stat.h>
37 #include <sys/statvfs.h>
38 #include <sys/iosupport.h>
39 #include "common.h"
40 #include "directory.h"
41 
42 typedef struct {
46  bool inUse;
47  bool validEntry;
49 
50 extern int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st);
51 
52 extern int _FAT_link_r (struct _reent *r, const char *existing, const char *newLink);
53 
54 extern int _FAT_unlink_r (struct _reent *r, const char *name);
55 
56 extern int _FAT_chdir_r (struct _reent *r, const char *name);
57 
58 extern int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName);
59 
60 extern int _FAT_mkdir_r (struct _reent *r, const char *path, int mode);
61 
62 extern int _FAT_statvfs_r (struct _reent *r, const char *path, struct statvfs *buf);
63 
64 /*
65 Directory iterator functions
66 */
67 extern DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path);
68 extern int _FAT_dirreset_r (struct _reent *r, DIR_ITER *dirState);
69 extern int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat);
70 extern int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState);
71 
72 
73 #endif // _FATDIR_H
GLuint const GLchar * name
Definition: glext.h:6671
int _FAT_mkdir_r(struct _reent *r, const char *path, int mode)
Definition: fatdir.c:349
PARTITION * partition
Definition: fatdir.h:43
GLenum mode
Definition: glext.h:6857
DIR_ENTRY currentEntry
Definition: fatdir.h:44
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
GLsizei const GLchar ** path
Definition: glext.h:7901
int _FAT_dirreset_r(struct _reent *r, DIR_ITER *dirState)
Definition: fatdir.c:599
int _FAT_chdir_r(struct _reent *r, const char *name)
Definition: fatdir.c:186
uint32_t startCluster
Definition: fatdir.h:45
int _FAT_unlink_r(struct _reent *r, const char *name)
Definition: fatdir.c:93
int _FAT_dirclose_r(struct _reent *r, DIR_ITER *dirState)
Definition: fatdir.c:656
int _FAT_stat_r(struct _reent *r, const char *path, struct stat *st)
Definition: fatdir.c:48
int _FAT_dirnext_r(struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat)
Definition: fatdir.c:621
int _FAT_link_r(struct _reent *r, const char *existing, const char *newLink)
Definition: fatdir.c:87
int _FAT_rename_r(struct _reent *r, const char *oldName, const char *newName)
Definition: fatdir.c:223
bool validEntry
Definition: fatdir.h:47
Definition: partition.h:52
int _FAT_statvfs_r(struct _reent *r, const char *path, struct statvfs *buf)
Definition: fatdir.c:492
bool inUse
Definition: fatdir.h:46
DIR_ITER * _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path)
Definition: fatdir.c:544
Definition: directory.h:71
Definition: fatdir.h:42
unsigned int uint32_t
Definition: stdint.h:126