haiku/headers/posix/dirent.h
Axel Dörfler 9c5c79ad86 * Made DIR definition private, and moved it into the new dirent_private.h
header.
* Added fields necessary to make it possible to retrieve more than one
  dirent from the underlying file system.
* Unless some app creates a DIR on its own to it to feed readdir(), this
  change should be binary compatible. If we find an application misbehaving,
  we can still make it a GCC4 only thing.
* fs_attr/fs_index/fs_query now all use readdir() directly (as that one
  contains the logic to iterate through a number of dirents in userspace).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 11:16:00 +00:00

48 lines
1.0 KiB
C

/*
* Copyright 2002-2008, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DIRENT_H
#define _DIRENT_H
#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 __DIR 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 *dir);
int readdir_r(DIR *dir, struct dirent *entry, struct dirent **_result);
int closedir(DIR *dir);
void rewinddir(DIR *dir);
void seekdir(DIR *dir, long int loc);
long int telldir(DIR *);
#ifdef __cplusplus
}
#endif
#endif /* _DIRENT_H */