TacOS  0.2
 Tout Structures de données Fichiers Fonctions Variables Définitions de type Énumérations Macros
dirent.h
Aller à la documentation de ce fichier.
1 
29 #ifndef _DIRENT_H_
30 #define _DIRENT_H_
31 
32 #include <sys/cdefs.h>
33 
34 __BEGIN_DECLS
35 
36 #include <sys/types.h>
37 #include <sys/stat.h>
38 
39 #define NAME_MAX 256
44 typedef struct _DIR {
45  int fd;
46  size_t allocation;
47  size_t size;
48  size_t offset;
50  off_t filepos;
52  char data[1];
53 } DIR;
54 
58 struct dirent {
59  uint32_t d_ino;
61  uint8_t d_type;
62  char d_name[NAME_MAX];
63 };
64 
68 enum {
69  DT_UNKNOWN = 0,
70  DT_FIFO = 1,
71  DT_CHR = 2,
72  DT_DIR = 4,
73  DT_BLK = 6,
74  DT_REG = 8,
75  DT_LNK = 10,
76  DT_SOCK = 12,
77  DT_WHT = 14
78 };
79 
88 int mkdir(const char *pathname, mode_t mode);
89 
97 DIR* opendir(const char* dirname);
98 
106 struct dirent* readdir(DIR* dirp);
107 
115 int closedir(DIR* dirp);
116 
117 __END_DECLS
118 
119 #endif
#define NAME_MAX
Definition: dirent.h:39
struct _DIR DIR
int fd
Definition: dirent.h:45
uint32_t d_ino
Definition: kdirent.h:42
size_t size
Definition: dirent.h:47
uint16_t d_reclen
Definition: kdirent.h:43
size_t allocation
Definition: dirent.h:46
size_t offset
Definition: dirent.h:48
Definition: kdirent.h:41
Definition: dirent.h:44
DIR * opendir(const char *dirname)
Definition: dirent.c:52
unsigned short int uint16_t
Definition: types.h:35
int closedir(DIR *dirp)
Definition: dirent.c:84
unsigned char uint8_t
Definition: types.h:34
struct dirent * readdir(DIR *dirp)
Definition: dirent.c:68
uint32_t mode_t
Definition: kstat.h:63
uint8_t d_type
Definition: kdirent.h:44
unsigned long int uint32_t
Definition: types.h:36
Definition: vga_modes.h:37
int mkdir(const char *pathname, mode_t mode)
Definition: dirent.c:38
char d_name[NAME_MAX]
Definition: kdirent.h:45
off_t filepos
Definition: dirent.h:50