717eabde1f
is d_reclen which points out that this field is not the name length but the one of the whole record (this is also handled incorrectly by the kernel file systems right now). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2109 a95241bf-73f2-0310-859d-f6bbb57e9c96
47 lines
871 B
C
47 lines
871 B
C
#ifndef _DIRENT_H
|
|
#define _DIRENT_H
|
|
/*
|
|
** Distributed under the terms of the OpenBeOS License.
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
typedef struct dirent {
|
|
dev_t d_dev; /* device */
|
|
dev_t d_pdev; /* parent device (only for queries) */
|
|
ino_t d_ino; /* inode number */
|
|
ino_t d_pino; /* parent inode (only for queries) */
|
|
unsigned short d_reclen; /* length of this record, not the name */
|
|
char d_name[1]; /* name of the entry (null byte terminated) */
|
|
} dirent_t;
|
|
|
|
typedef struct {
|
|
int fd;
|
|
struct dirent ent;
|
|
} DIR;
|
|
|
|
#ifndef MAXNAMLEN
|
|
# ifdef NAME_MAX
|
|
# define MAXNAMLEN NAME_MAX
|
|
# else
|
|
# define MAXNAMLEN 256
|
|
# endif
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
DIR *opendir(const char *dirname);
|
|
struct dirent *readdir(DIR *dirp);
|
|
int closedir(DIR *dirp);
|
|
void rewinddir(DIR *dirp);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _DIRENT_H */
|
|
|