home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dmake40.zip / msdos / dirent.h < prev    next >
C/C++ Source or Header  |  1994-10-23  |  908b  |  33 lines

  1. /* DIRLIB.H by M. J. Weinstein   Released to public domain 1-Jan-89 */
  2.  
  3. #ifndef _DIRLIB_h_
  4. #define _DIRLIB_h_
  5.  
  6. #include <stdio.h>
  7. #include "stdmacs.h"
  8. #include "dosdta.h"
  9.  
  10. #define MAXNAMLEN   15
  11.  
  12. struct dirent {
  13.    long              d_ino;
  14.    unsigned short    d_reclen;
  15.    unsigned short    d_namlen;
  16.    char              d_name[MAXNAMLEN+1];
  17. };
  18.  
  19. typedef struct {
  20.    DTA    dd_dta;       /* disk transfer area for this dir.        */
  21.    short  dd_stat;      /* status return from last lookup          */
  22.    char   dd_name[1];   /* full name of file -- struct is extended */
  23. } DIR;
  24.  
  25. extern DIR           *opendir   ANSI((char *));
  26. extern struct dirent *readdir   ANSI((DIR *));
  27. extern long          telldir    ANSI((DIR *));
  28. extern void          seekdir    ANSI((DIR *, long));
  29. extern void          closedir   ANSI((DIR *));
  30.  
  31. #define rewinddir(dirp)   seekdir(dirp,0L)
  32. #endif
  33.