Files
MontaukOS/programs/include/libc/dirent.h
T

42 lines
859 B
C

#ifndef _LIBC_DIRENT_H
#define _LIBC_DIRENT_H
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#define NAME_MAX 255
#define DT_UNKNOWN 0
#define DT_FIFO 1
#define DT_CHR 2
#define DT_DIR 4
#define DT_BLK 6
#define DT_REG 8
#define DT_LNK 10
#define DT_SOCK 12
struct dirent {
unsigned char d_type;
char d_name[NAME_MAX + 1];
};
typedef struct _DIR DIR;
DIR *opendir(const char *name);
struct dirent *readdir(DIR *dirp);
int closedir(DIR *dirp);
void rewinddir(DIR *dirp);
int scandir(const char *dirp, struct dirent ***namelist,
int (*filter)(const struct dirent *),
int (*compar)(const struct dirent **, const struct dirent **));
int alphasort(const struct dirent **a, const struct dirent **b);
#ifdef __cplusplus
}
#endif
#endif /* _LIBC_DIRENT_H */