home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / LIBSRC.ZOO / libsrc / local / dirent.h < prev    next >
Text File  |  1992-03-11  |  1KB  |  49 lines

  1. /*
  2.  * dirent.h -- header file for use with opendir(), readdir(),
  3.  * rewinddir(), and closedir() under OS/2 2.0.
  4.  */
  5.  
  6. #ifndef __DIRENT_H__
  7. #define __DIRENT_H__
  8.  
  9. /* XXX temporary hack! */
  10. #ifndef MAXNAMLEN
  11. #define MAXNAMLEN 255
  12. #endif
  13.  
  14. struct dirent {
  15.      unsigned long d_fileno;
  16.      unsigned short d_reclen;
  17.      unsigned short d_namelen;
  18.      char d_name[MAXNAMLEN + 1];
  19. };
  20.  
  21. /*
  22.  * Files that define __DIRENT_PRIVATE__ get the
  23.  * full definition of the DIR type and other internal information.
  24.  */
  25.  
  26. #ifdef __DIRENT_PRIVATE__
  27.  
  28. typedef struct _DIR {
  29.      HDIR dirhandle;
  30.      char reset;
  31.      struct dirent ent;
  32.      char *searchname;
  33. } DIR;
  34.  
  35. /* archive, directory, system, hidden, readonly, and normal */
  36. #define DIRENT_ALLFILES 0x16 
  37.  
  38. #else /* !__DIRENT_PRIVATE__ */
  39. typedef struct _DIR DIR;
  40. #endif /* __DIRENT_PRIVATE__ */
  41.  
  42. DIR *opendir(const char *);
  43. struct dirent *readdir(DIR *);
  44. int closedir(DIR *);
  45. void rewinddir(DIR *);
  46.  
  47. /* DO NOT ADD ANYTHING AFTER THIS #endif! */
  48. #endif /* __DIRENT_H__ */
  49.