diff options
| author | JasonJiaJie <[email protected]> | 2017-11-09 13:57:01 +0800 |
|---|---|---|
| committer | JasonJiaJie <[email protected]> | 2017-11-09 13:57:01 +0800 |
| commit | 4eb8121bae6b25f7d9cd1cf83f2a609f5ec96a94 (patch) | |
| tree | aeac288bdff66cf62fa10d281e185eabc63b1e9a /components/libc/compilers | |
| parent | 20dbd2dd0aefa5b69c848c78de87e7fa6470b242 (diff) | |
| parent | 024e3ea8f692fd7ecd9c36dad544fd69ea70c4bd (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'components/libc/compilers')
| -rw-r--r-- | components/libc/compilers/armlibc/dirent.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/components/libc/compilers/armlibc/dirent.h b/components/libc/compilers/armlibc/dirent.h new file mode 100644 index 0000000000..1adf952031 --- /dev/null +++ b/components/libc/compilers/armlibc/dirent.h @@ -0,0 +1,54 @@ +#ifndef __RTT_DIRENT_H__ +#define __RTT_DIRENT_H__ + +#include <rtthread.h> +#include <rtlibc.h> + +/* +* dirent.h - format of directory entries + * Ref: http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html + */ + +/* File types */ +#define FT_REGULAR 0 /* regular file */ +#define FT_SOCKET 1 /* socket file */ +#define FT_DIRECTORY 2 /* directory */ +#define FT_USER 3 /* user defined */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef HAVE_DIR_STRUCTURE +typedef struct +{ + int fd; /* directory file */ + char buf[512]; + int num; + int cur; +} DIR; +#endif + +#ifndef HAVE_DIRENT_STRUCTURE +struct dirent +{ + rt_uint8_t d_type; /* The type of the file */ + rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ + rt_uint16_t d_reclen; /* length of this record */ + char d_name[256]; /* The null-terminated file name */ +}; +#endif + +int closedir(DIR *); +DIR *opendir(const char *); +struct dirent *readdir(DIR *); +int readdir_r(DIR *, struct dirent *, struct dirent **); +void rewinddir(DIR *); +void seekdir(DIR *, long int); +long telldir(DIR *); + +#ifdef __cplusplus +} +#endif + +#endif |
