Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (C) KolibriOS team 2024. All rights reserved.
  3.  * Distributed under terms of the GNU General Public License
  4. */
  5.  
  6. #ifndef _DIRENT_H_
  7. #define _DIRENT_H_
  8.  
  9. #include <sys/types.h>
  10. #include <sys/cdefs.h>
  11. #include <sys/ksys.h>
  12.  
  13. _BEGIN_STD_C
  14.  
  15. #define DT_UNKNOWN      0
  16. #define DT_DIR          4
  17. #define DT_REG          8
  18.  
  19. struct dirent {
  20.     ino_t    d_ino;
  21.     unsigned d_type;
  22.     char     d_name[KSYS_FNAME_UTF8_SIZE];
  23. };
  24.  
  25. typedef struct {
  26.     char*           path;
  27.     uint32_t        pos;
  28.     struct dirent   last_entry;
  29. } DIR;
  30.  
  31. DIR* _DEFUN(opendir, (name), const char *name);
  32. int  _DEFUN(closedir, (dirp), register DIR *dirp);
  33. void _DEFUN(seekdir, (dirp, loc), DIR *dirp _AND long loc);
  34. void _DEFUN(rewinddir, (dirp), DIR *dirp);
  35. long _DEFUN(telldir, (dirp), DIR *dirp);
  36.  
  37. struct dirent *_DEFUN(readdir, (dirp), register DIR *dirp);
  38.  
  39. _END_STD_C
  40.  
  41. #endif /* _DIRENT_H_ */
  42.