Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
dirent.h
Go to the documentation of this file.
1 
4 #ifndef __DIRENT_H__
5 #define __DIRENT_H__
6 
7 #include <stdint.h>
8 #include <sys/limits.h>
9 
10 #include "kconfig.h"
11 
12 /* Return type of the opendir() */
13 typedef struct dirstream {
14  struct inode *inode_dir; /* Directory inode */
15  struct list_head *dentry_list; /* List pointer of the dentry to return */
16 } DIR;
17 
18 /* Return type of the readdir() */
19 struct dirent {
20  char d_name[NAME_MAX]; /* File name */
21  uint32_t d_ino; /* The inode of the file */
22  uint8_t d_type; /* File type */
23 };
24 
32 int opendir(const char *name, DIR *dir);
33 
42 int readdir(DIR *dirp, struct dirent *dirent);
43 
44 #endif
int opendir(const char *name, DIR *dir)
Open a directory stream corresponding to the directory name, and returns a pointer to the directory s...
Definition: file.c:85
int readdir(DIR *dirp, struct dirent *dirent)
Return a pointer to a dirent structure representing the next directory entry in the directory stream ...
Definition: file.c:90
Definition: dirent.h:19
Definition: dirent.h:13
Definition: fs.h:82
Definition: list.h:111