home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / perl / msdos / dir.h < prev    next >
C/C++ Source or Header  |  1992-04-11  |  1KB  |  62 lines

  1. /* $RCSfile: dir.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:22:10 $
  2.  *
  3.  *    (C) Copyright 1987, 1990 Diomidis Spinellis.
  4.  *
  5.  *    You may distribute under the terms of either the GNU General Public
  6.  *    License or the Artistic License, as specified in the README file.
  7.  *
  8.  * $Log:    dir.h,v $
  9.  * Revision 4.0.1.1  91/06/07  11:22:10  lwall
  10.  * patch4: new copyright notice
  11.  * 
  12.  * Revision 4.0  91/03/20  01:34:20  lwall
  13.  * 4.0 baseline.
  14.  * 
  15.  * Revision 3.0.1.1  90/03/27  16:07:08  lwall
  16.  * patch16: MSDOS support
  17.  * 
  18.  * Revision 1.1  90/03/18  20:32:29  dds
  19.  * Initial revision
  20.  *
  21.  *
  22.  */
  23.  
  24. /*
  25.  * defines the type returned by the directory(3) functions
  26.  */
  27.  
  28. #ifndef __DIR_INCLUDED
  29. #define __DIR_INCLUDED
  30.  
  31. /*Directory entry size */
  32. #ifdef DIRSIZ
  33. #undef DIRSIZ
  34. #endif
  35. #define DIRSIZ(rp)    (sizeof(struct direct))
  36.  
  37. /*
  38.  * Structure of a directory entry
  39.  */
  40. struct direct    {
  41.     ino_t    d_ino;            /* inode number (not used by MS-DOS) */
  42.     int    d_namlen;        /* Name length */
  43.     char    d_name[13];        /* file name */
  44. };
  45.  
  46. struct _dir_struc {            /* Structure used by dir operations */
  47.     char *start;            /* Starting position */
  48.     char *curr;            /* Current position */
  49.     struct direct dirstr;        /* Directory structure to return */
  50. };
  51.  
  52. typedef struct _dir_struc DIR;        /* Type returned by dir operations */
  53.  
  54. DIR *cdecl opendir(char *filename);
  55. struct direct *readdir(DIR *dirp);
  56. long telldir(DIR *dirp);
  57. void seekdir(DIR *dirp,long loc);
  58. void rewinddir(DIR *dirp);
  59. void closedir(DIR *dirp);
  60.  
  61. #endif /* __DIR_INCLUDED */
  62.