From 5a2b57c3617a2572dd486ff8c18791645f6aa7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 9 Jul 2002 13:57:50 +0000 Subject: [PATCH] Updated to the current version of dirent.h (that somehow didn't make it to here). Notably changes are: C++ safe, struct dirent is now BeOS compatible. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@12 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/kernel/dirent.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/headers/os/kernel/dirent.h b/headers/os/kernel/dirent.h index 33c111ff7d..96ff238a6f 100644 --- a/headers/os/kernel/dirent.h +++ b/headers/os/kernel/dirent.h @@ -6,12 +6,22 @@ #ifndef _DIRENT_H #define _DIRENT_H +// ToDo: should really be +// This file should reside in headers/posix, not here... +// needs ino_t (int64), and dev_t (long) +#include +typedef long dev_t; + typedef struct dirent { - vnode_id d_ino; + dev_t d_dev; + dev_t d_pdev; + ino_t d_ino; + ino_t d_pino; unsigned short d_reclen; char d_name[1]; } dirent_t; +// ToDo: this structure is still incompatible with BeOS typedef struct { int fd; struct dirent *ent; @@ -19,11 +29,15 @@ typedef struct { } DIR; #ifndef MAXNAMLEN -#ifdef NAME_MAX -#define MAXNAMLEN NAME_MAX -#else -#define MAXNAMLEN 256 +# ifdef NAME_MAX +# define MAXNAMLEN NAME_MAX +# else +# define MAXNAMLEN 256 +# endif #endif + +#ifdef _cplusplus +extern "C" { #endif DIR *opendir(const char *dirname); @@ -31,5 +45,9 @@ struct dirent *readdir(DIR *dirp); int closedir(DIR *dirp); void rewinddir(DIR *dirp); +#ifdef _cplusplus +} +#endif + #endif /* _DIRENT_H */