add a missing section header table index conversion
[tangerine.git] / compiler / clib / include / dirent.h
blob97a7ce9dff4019080d48dcba605e91bae1e9c558
1 #ifndef _DIRENT_H_
2 #define _DIRENT_H_
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: header file dirent.h
9 Lang: english
12 #include <sys/_types.h>
13 #include <sys/cdefs.h>
15 #ifndef __AROS_INO_T_DECLARED
16 #define __AROS_INO_T_DECLARED
17 typedef __ino_t ino_t;
18 #endif
20 #ifndef __AROS_OFF_T_DECLARED
21 #define __AROS_OFF_T_DECLARED
22 typedef __off_t off_t;
23 #endif
25 #ifndef NAME_MAX
26 #define NAME_MAX 255
27 #endif
29 #define DT_UNKNOWN 0
30 #define DT_FIFO 1
31 #define DT_CHR 2
32 #define DT_DIR 4
33 #define DT_BLK 6
34 #define DT_REG 8
35 #define DT_LNK 10
36 #define DT_SOCK 12
37 #define DT_WHT 14
39 struct dirent
41 ino_t d_ino;
42 unsigned short int d_reclen;
43 unsigned char d_type;
44 #define MAXNAMLEN NAME_MAX
45 char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
48 /* structure describing an open directory. */
49 typedef struct _dirdesc
51 int fd;
52 struct dirent ent;
53 off_t pos;
54 void *priv;
55 } DIR;
57 __BEGIN_DECLS
59 int closedir(DIR *dir);
60 DIR *opendir(const char *filename);
61 struct dirent *readdir(DIR *dir);
62 void rewinddir(DIR *dir);
63 int dirfd(DIR *dir);
65 #if __POSIX_VISIBLE >= 200112
66 /* NOTIMPL int readdir_r(DIR * restrict dir , struct dirent * restrict entry,
67 struct dirent * restrict result); */
68 #endif
70 #if __XSI_VISIBLE
71 void seekdir(DIR *dir, off_t loc);
72 long telldir(DIR *dir);
73 #endif
75 #if __BSD_VISIBLE
77 #ifndef __AROS_SSIZE_T_DECLARED
78 #define __AROS_SSIZE_T_DECLARED
79 typedef __ssize_t ssize_t;
80 #endif
82 /* NOTIMPL int scandir (const char *dir, struct dirent ***namelist,
83 int (*select)(const struct dirent *),
84 int (*compar)(const struct dirent **, const struct dirent **)); */
86 /* NOTIMPL int alphasort(const struct dirent **a, const struct dirent **b); */
87 /* NOTIMPL ssize_t getdirentries(int fd, char *buf, size_t nbytes, off_t *basep); */
88 #endif
90 __END_DECLS
92 #endif /* !_DIRENT_H_ */