home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / LATTIC_3.ZIP / HEADERS / DIRENT.H < prev    next >
C/C++ Source or Header  |  1990-07-10  |  989b  |  49 lines

  1. /*
  2.  * dirent.h -  POSIX directory functions
  3.  *
  4.  * Copyright (c) 1990 HiSoft
  5.  */
  6.  
  7. #ifndef _DIRENT_H
  8. #define _DIRENT_H
  9.  
  10. #ifndef _TIME_T
  11. #define _TIME_T
  12. typedef long time_t;
  13. #endif
  14.  
  15. #ifndef _SIZE_T
  16. #define _SIZE_T
  17. typedef unsigned long size_t;
  18. #endif
  19.  
  20. /* structure pointed to by readdir() */
  21. struct dirent
  22. {
  23.     int d_attr;            /* file attribute */
  24.     time_t d_time;        /* time */
  25.     size_t d_size;        /* file size */
  26.     char d_name[13];    /* directory entry name */
  27. };
  28.  
  29. typedef struct
  30. {
  31.     long d_length;            /* number of directory entries */
  32.     long d_pos;                /* current position */
  33.     struct dirent *d_names;    /* list of directory entries */
  34. } DIR;
  35.  
  36. DIR *opendir(const char *filename);
  37. struct dirent *readdir(DIR *);
  38. void closedir(DIR *);
  39. void rewinddir(DIR *);
  40. void seekdir(DIR *,size_t);
  41. long telldir(DIR *);
  42.  
  43. #ifndef __NO_DIRENT_DEFINES
  44. #define rewinddir(d)    ((d)->d_pos=0)
  45. #define seekdir(d,loc)    ((d)->d_pos=(loc))
  46. #define telldir(d)        ((d)->d_pos)
  47. #endif
  48. #endif
  49.