vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

dirent.h (621B)


      1 #ifndef _DIRENT_H_
      2 #define _DIRENT_H_
      3 
      4 typedef struct DIR DIR;
      5 struct DIR {
      6 	int fd;
      7 };
      8 
      9 #define	MAXNAMLEN	255
     10 
     11 #include <stdint.h>
     12 
     13 struct dirent {
     14 	uint32_t d_fileno;
     15 	uint16_t d_reclen;
     16 	uint8_t d_type;
     17 	uint8_t d_namlen;
     18 	char	d_name[MAXNAMLEN + 1];
     19 };
     20 
     21 #define	DT_UNKNOWN	 0
     22 #define	DT_FIFO		 1
     23 #define	DT_CHR		 2
     24 #define	DT_DIR		 4
     25 #define	DT_BLK		 6
     26 #define	DT_REG		 8
     27 #define	DT_LNK		10
     28 #define	DT_SOCK		12
     29 #define	DT_WHT		14
     30 
     31 
     32 DIR *opendir(const char*);
     33 struct dirent *readdir(DIR*);
     34 long telldir(DIR*);
     35 void seekdir(DIR*, long);
     36 void rewinddir(DIR*);
     37 int closedir(DIR*);
     38 int dirfd(DIR*);
     39 
     40 #endif  // _DIRENT_H_