home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / ARC521-2.ZIP / DIR.H < prev    next >
C/C++ Source or Header  |  1989-12-12  |  1KB  |  39 lines

  1. /*
  2.  * @(#)msd_dir.h 1.4 87/11/06    Public Domain.
  3.  *
  4.  *  A public domain implementation of BSD directory routines for
  5.  *  MS-DOS.  Written by Michael Rendell ({uunet,utai}michael@garfield),
  6.  *  August 1897
  7.  *  Ported to OS/2 by Kai Uwe Rommel
  8.  *  December 1989
  9.  */
  10.  
  11. #define    rewinddir(dirp)    seekdir(dirp, 0L)
  12.  
  13. #define    MAXNAMLEN    12
  14.  
  15. struct direct {
  16.     ino_t    d_ino;            /* a bit of a farce */
  17.     int    d_reclen;        /* more farce */
  18.     int    d_namlen;        /* length of d_name */
  19.         char    d_name[MAXNAMLEN + 1];  /* garentee null termination */
  20. };
  21.  
  22. struct _dircontents {
  23.     char    *_d_entry;
  24.     struct _dircontents    *_d_next;
  25. };
  26.  
  27. typedef struct _dirdesc {
  28.     int        dd_id;    /* uniquely identify each open directory */
  29.     long        dd_loc;    /* where we are in directory entry is this */
  30.     struct _dircontents    *dd_contents;    /* pointer to contents of dir */
  31.     struct _dircontents    *dd_cp;    /* pointer to current position */
  32. } DIR;
  33.  
  34. extern  DIR             *opendir(char *);
  35. extern  struct direct   *readdir(DIR *);
  36. extern  void            seekdir(DIR *, long);
  37. extern  long            telldir(DIR *);
  38. extern  void            closedir(DIR *);
  39.