Rev 5602 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5602 | Rev 8759 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | system which supports |
2 | system which supports |
3 | dirent.h in the libc/sys/.../sys directory. On a system which does |
3 | dirent.h in the libc/sys/.../sys directory. On a system which does |
4 | not support |
4 | not support |
5 | an error. */ |
5 | an error. */ |
6 | 6 | ||
7 | #ifdef __cplusplus |
7 | #ifdef __cplusplus |
8 | extern "C" { |
8 | extern "C" { |
9 | #endif |
9 | #endif |
- | 10 | ||
- | 11 | #define DT_DIR 16 |
|
- | 12 | #define DT_REG 0 |
|
- | 13 | ||
- | 14 | #include |
|
- | 15 | #include |
|
10 | 16 | ||
- | 17 | struct dirent{ |
|
11 | struct dirent { |
18 | ino_t d_ino; |
12 | char d_namlen; |
19 | unsigned d_type; |
13 | char d_name[256]; |
20 | char d_name[256]; |
14 | }; |
21 | }; |
15 | 22 | ||
16 | typedef struct |
- | |
17 | { |
- | |
18 | // struct systree_info2 fileinfo; |
23 | typedef struct{ |
19 | struct dirent entry; |
- | |
20 | // __u8 bdfeheader[0x20]; |
24 | struct dirent* objs; |
21 | // struct bdfe_item bdfebase; |
25 | ino_t pos; |
22 | // __u8 bdfename[264]; |
26 | ino_t num_objs; |
23 | } DIR; |
27 | }DIR; |
24 | 28 | ||
25 | int closedir(DIR *dirp); |
29 | extern int closedir(DIR *dir); |
26 | DIR * opendir(const char *_dirname); |
30 | extern DIR* opendir(const char *path); |
- | 31 | extern struct dirent* readdir(DIR *); |
|
- | 32 | extern void rewinddir(DIR *dir); |
|
- | 33 | extern void seekdir(DIR *dir, unsigned pos); |
|
- | 34 | extern unsigned telldir(DIR *dir); |
|
- | 35 | ||
27 | struct dirent * readdir(DIR *_dirp); |
36 | extern int scandir(const char *path, struct dirent ***res, int (*sel)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **)); |
28 | void rewinddir(DIR *_dirp); |
37 | extern int alphasort(const struct dirent **a, const struct dirent **b); |
29 | 38 | ||
30 | #ifdef __cplusplus |
39 | #ifdef __cplusplus |
31 | } |
40 | } |
32 | #endif |
41 | #endif |