Subversion Repositories Kolibri OS

Rev

Rev 9810 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
  2.  
  3. #ifndef _DIRENT_H_
  4. #define _DIRENT_H_
  5.  
  6. #include <limits.h>
  7. #include <stddef.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. extern int _FUNC(closedir)(DIR* dir);
  27. extern DIR* _FUNC(opendir)(const char* path);
  28. extern struct dirent* _FUNC(readdir)(DIR*);
  29. extern void _FUNC(rewinddir)(DIR* dir);
  30. extern void _FUNC(seekdir)(DIR* dir, unsigned pos);
  31. extern unsigned _FUNC(telldir)(DIR* dir);
  32.  
  33. #endif // _DIRENT_H_
  34.