diff options
| author | charlown <[email protected]> | 2021-09-02 22:39:34 +0800 |
|---|---|---|
| committer | charlown <[email protected]> | 2021-09-02 22:39:34 +0800 |
| commit | 8abbe89cee0099f3ec727de53baf20f7945434e9 (patch) | |
| tree | a9d8b24c6f6bcb927963757846c21d9926797c43 /components/libc/compilers | |
| parent | 2e74dd8e2d641f581ef733a050392d161d3643d0 (diff) | |
| parent | dca7dcb42a44249abbe6c36ce2a69355e60d1f79 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components/libc/compilers')
| -rw-r--r-- | components/libc/compilers/common/dirent.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/components/libc/compilers/common/dirent.h b/components/libc/compilers/common/dirent.h index bfba586093..a6353fd6f8 100644 --- a/components/libc/compilers/common/dirent.h +++ b/components/libc/compilers/common/dirent.h @@ -6,10 +6,14 @@ * Change Logs: * Date Author Notes */ -#ifndef __RTT_DIRENT_H__ -#define __RTT_DIRENT_H__ +#ifndef __DIRENT_H__ +#define __DIRENT_H__ -#include <rtthread.h> +#include <rtdef.h> + +#ifdef __cplusplus +extern "C" { +#endif /* * dirent.h - format of directory entries @@ -26,27 +30,28 @@ #define DT_REG 0x01 #define DT_DIR 0x02 -#ifdef __cplusplus -extern "C" { -#endif - #ifndef HAVE_DIR_STRUCTURE +#define HAVE_DIR_STRUCTURE typedef struct { int fd; /* directory file */ char buf[512]; int num; int cur; -} DIR; +}DIR; #endif #ifndef HAVE_DIRENT_STRUCTURE +#define HAVE_DIRENT_STRUCTURE + +#define DIRENT_NAME_MAX 256 + 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 */ + char d_name[DIRENT_NAME_MAX]; /* The null-terminated file name */ }; #endif |
