| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 | /* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date           Author       Notes */#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 __cplusplusextern "C" {#endif#ifndef HAVE_DIR_STRUCTUREtypedef struct {	int fd;							/* directory file */	char buf[512];	int num;	int cur;} DIR;#endif#ifndef HAVE_DIRENT_STRUCTUREstruct 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 */};#endifint            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
 |