Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
  2.  
  3. #ifndef _DIRENT_H_
  4. #define _DIRENT_H_
  5.  
  6. #include <stddef.h>
  7. #include <limits.h>
  8.  
  9. #define IS_FOLDER 16
  10. #define IS_FILE 0
  11.  
  12. typedef unsigned ino_t;
  13.  
  14. struct dirent{
  15.    ino_t    d_ino;   //File serial number.
  16.    char     d_name[PATH_MAX];   // Name of entry.
  17.    unsigned d_type;
  18. };
  19.  
  20. typedef struct{
  21.     struct dirent* objs;
  22.     ino_t pos;
  23.     ino_t num_objs;  
  24. }DIR;
  25.  
  26.  
  27. int  _FUNC(closedir)(DIR *dir);
  28. DIR* _FUNC(opendir)(const char *path);
  29. struct dirent* _FUNC(readdir)(DIR *);
  30. void _FUNC(rewinddir)(DIR *dir);
  31. void _FUNC(seekdir)(DIR *dir, unsigned pos);
  32. unsigned _FUNC(telldir)(DIR *dir);
  33.  
  34. #endif // _DIRENT_H_