2002-07-09 16:24:59 +04:00
|
|
|
/**
|
|
|
|
* @file dirent.h
|
|
|
|
* @brief File Control functions and definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DIRENT_H
|
|
|
|
#define _DIRENT_H
|
|
|
|
|
2002-07-09 17:57:50 +04:00
|
|
|
// ToDo: should really be <sys/types>
|
|
|
|
// This file should reside in headers/posix, not here...
|
|
|
|
// needs ino_t (int64), and dev_t (long)
|
|
|
|
#include <ktypes.h>
|
|
|
|
typedef long dev_t;
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
typedef struct dirent {
|
2002-07-09 17:57:50 +04:00
|
|
|
dev_t d_dev;
|
|
|
|
dev_t d_pdev;
|
|
|
|
ino_t d_ino;
|
|
|
|
ino_t d_pino;
|
2002-07-09 16:24:59 +04:00
|
|
|
unsigned short d_reclen;
|
|
|
|
char d_name[1];
|
|
|
|
} dirent_t;
|
|
|
|
|
2002-07-09 17:57:50 +04:00
|
|
|
// ToDo: this structure is still incompatible with BeOS
|
2002-07-09 16:24:59 +04:00
|
|
|
typedef struct {
|
|
|
|
int fd;
|
|
|
|
struct dirent *ent;
|
|
|
|
struct dirent me;
|
|
|
|
} DIR;
|
|
|
|
|
|
|
|
#ifndef MAXNAMLEN
|
2002-07-09 17:57:50 +04:00
|
|
|
# ifdef NAME_MAX
|
|
|
|
# define MAXNAMLEN NAME_MAX
|
|
|
|
# else
|
|
|
|
# define MAXNAMLEN 256
|
|
|
|
# endif
|
2002-07-09 16:24:59 +04:00
|
|
|
#endif
|
2002-07-09 17:57:50 +04:00
|
|
|
|
|
|
|
#ifdef _cplusplus
|
|
|
|
extern "C" {
|
2002-07-09 16:24:59 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
DIR *opendir(const char *dirname);
|
|
|
|
struct dirent *readdir(DIR *dirp);
|
|
|
|
int closedir(DIR *dirp);
|
|
|
|
void rewinddir(DIR *dirp);
|
|
|
|
|
2002-07-09 17:57:50 +04:00
|
|
|
#ifdef _cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#endif /* _DIRENT_H */
|
|
|
|
|