home *** CD-ROM | disk | FTP | other *** search
- /* <dirent.h> -- definitions for SVR3 directory access routines */
- #ifndef _DIRENT_H
- #define _DIRENT_H
-
- #include <sys/types.h>
- #include <limits.h>
- #include <sys/dirent.h>
- #include <sys/proto.h>
-
- #ifndef NULL
- # ifdef MSDOS
- # if (defined(M_I86SM) || defined(M_I86MM))
- # define NULL 0
- # else
- # if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
- # define NULL 0L
- # endif
- # endif
- # else
- # define NULL 0
- # endif
- #endif
-
- #define DIRBUF 8192 /* buffer size for fs-indep. dirs */
- /* must in general be larger than the */
- /* filesystem buffer size */
-
- #ifndef MSDOS
- typedef struct
- {
- int dd_fd; /* file descriptor */
- int dd_loc; /* offset in block */
- int dd_size; /* amount of valid data */
- char *dd_buf; /* -> directory block */
- } DIR; /* stream data from opendir() */
-
- #else
-
- /* MSDOS versions */
-
- struct _dircontents {
- char *_d_entry;
- struct _dircontents *_d_next;
- };
-
- typedef struct _dirdesc {
- int dd_id; /* uniquely identify each open directory */
- long dd_loc; /* where we are in directory entry is this */
- struct _dircontents *dd_contents; /* pointer to contents of dir */
- struct _dircontents *dd_cp; /* pointer to current position */
- } DIR;
- #endif
-
- /* Functions */
-
- extern DIR * _CDECL opendir _PROTO ((char *));
- extern struct dirent * _CDECL readdir _PROTO ((DIR *));
- extern void _CDECL rewinddir _PROTO ((DIR *));
- extern int _CDECL closedir _PROTO ((DIR *));
- extern void _CDECL seekdir _PROTO ((DIR *, off_t));
- extern off_t _CDECL telldir _PROTO ((DIR *));
-
- extern int _CDECL chdir _PROTO ((char *));
- extern char * _CDECL getcwd _PROTO ((char *, int));
- #ifdef MSDOS
- extern int _CDECL mkdir _PROTO ((char *));
- #else
- extern int _CDECL mkdir _PROTO ((char *, mode_t));
- #endif
- extern int _CDECL rmdir _PROTO ((char *));
- extern int _CDECL scandir _PROTO ((char *, struct dirent ***, int (_CDECL *)(const void *, const void *), int (_CDECL *)(const void *, const void *)));
- #endif
-