ahci: Whitespace and line length cleanup only.
[haiku.git] / headers / posix / dirent.h
blob9622a265ac4bd5921f094714a97fca3bb4e44df5
1 /*
2 * Copyright 2002-2012 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _DIRENT_H
6 #define _DIRENT_H
9 #include <sys/types.h>
12 typedef struct dirent {
13 dev_t d_dev; /* device */
14 dev_t d_pdev; /* parent device (only for queries) */
15 ino_t d_ino; /* inode number */
16 ino_t d_pino; /* parent inode (only for queries) */
17 unsigned short d_reclen; /* length of this record, not the name */
18 char d_name[1]; /* name of the entry (null byte terminated) */
19 } dirent_t;
21 typedef struct __DIR DIR;
23 #ifndef MAXNAMLEN
24 # ifdef NAME_MAX
25 # define MAXNAMLEN NAME_MAX
26 # else
27 # define MAXNAMLEN 256
28 # endif
29 #endif
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 DIR* fdopendir(int fd);
36 DIR* opendir(const char* dirName);
37 struct dirent* readdir(DIR* dir);
38 int readdir_r(DIR* dir, struct dirent* entry,
39 struct dirent** _result);
40 int closedir(DIR* dir);
41 void rewinddir(DIR* dir);
42 void seekdir(DIR* dir, long int position);
43 long int telldir(DIR* dir);
44 int dirfd(DIR* dir);
46 int alphasort(const struct dirent** entry1,
47 const struct dirent** entry2);
48 int scandir(const char* dir, struct dirent*** _entryArray,
49 int (*selectFunc)(const struct dirent*),
50 int (*compareFunc)(const struct dirent** entry1,
51 const struct dirent** entry2));
53 #ifdef __cplusplus
55 #endif
57 #endif /* _DIRENT_H */