Subversion Repositories Kolibri OS

Rev

Rev 5602 | Blame | Last modification | View Log | RSS feed

  1. /* <dirent.h> includes <sys/dirent.h>, which is this file.  On a
  2.    system which supports <dirent.h>, this file is overridden by
  3.    dirent.h in the libc/sys/.../sys directory.  On a system which does
  4.    not support <dirent.h>, we will get this file which uses #error to force
  5.    an error.  */
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11. #define DT_DIR 16
  12. #define DT_REG 0
  13.  
  14. #include <limits.h>
  15. #include <sys/types.h>  
  16.  
  17. struct dirent{
  18.    ino_t    d_ino;
  19.    unsigned d_type;
  20.    char     d_name[256];
  21. };
  22.  
  23. typedef struct{
  24.     struct dirent* objs;
  25.     ino_t pos;
  26.     ino_t num_objs;  
  27. }DIR;
  28.  
  29. extern int  closedir(DIR *dir);
  30. extern DIR* opendir(const char *path);
  31. extern struct dirent* readdir(DIR *);
  32. extern void rewinddir(DIR *dir);
  33. extern void seekdir(DIR *dir, unsigned pos);
  34. extern unsigned telldir(DIR *dir);
  35.  
  36. extern int scandir(const char *path, struct dirent ***res, int (*sel)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **));
  37. extern int alphasort(const struct dirent **a, const struct dirent **b);
  38.  
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42.