kolibrios/contrib/sdk/sources/newlib/libc/include/sys/dirent.h
turbocat 2287b1e29b newlibc:
Added new functions:
- dir.h: mkdir, rmdir, chdir
- dirent.h:  alphasort, opendir, closedir, readdir, rewinddir, seekdir, telldir, scandir

git-svn-id: svn://kolibrios.org@8759 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-06-02 00:58:56 +00:00

42 lines
1.1 KiB
C

/* <dirent.h> includes <sys/dirent.h>, which is this file. On a
system which supports <dirent.h>, this file is overridden by
dirent.h in the libc/sys/.../sys directory. On a system which does
not support <dirent.h>, we will get this file which uses #error to force
an error. */
#ifdef __cplusplus
extern "C" {
#endif
#define DT_DIR 16
#define DT_REG 0
#include <limits.h>
#include <sys/types.h>
struct dirent{
ino_t d_ino;
unsigned d_type;
char d_name[256];
};
typedef struct{
struct dirent* objs;
ino_t pos;
ino_t num_objs;
}DIR;
extern int closedir(DIR *dir);
extern DIR* opendir(const char *path);
extern struct dirent* readdir(DIR *);
extern void rewinddir(DIR *dir);
extern void seekdir(DIR *dir, unsigned pos);
extern unsigned telldir(DIR *dir);
extern int scandir(const char *path, struct dirent ***res, int (*sel)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **));
extern int alphasort(const struct dirent **a, const struct dirent **b);
#ifdef __cplusplus
}
#endif