home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / SH164AS.ZIP / INCLUDE / DIRENT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-28  |  2.0 KB  |  73 lines

  1. /* <dirent.h> -- definitions for SVR3 directory access routines */
  2. #ifndef _DIRENT_H
  3. #define _DIRENT_H
  4.  
  5. #include <sys/types.h>
  6. #include <limits.h>
  7. #include <sys/dirent.h>
  8. #include <sys/proto.h>
  9.  
  10. #ifndef NULL
  11. #  ifdef MSDOS
  12. #    if (defined(M_I86SM) || defined(M_I86MM))
  13. #      define NULL    0
  14. #    else
  15. #      if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
  16. #        define NULL    0L
  17. #      endif
  18. #    endif
  19. #  else
  20. #    define NULL    0
  21. #  endif
  22. #endif
  23.  
  24. #define    DIRBUF    8192        /* buffer size for fs-indep. dirs    */
  25.                 /* must in general be larger than the    */
  26.                 /* filesystem buffer size        */
  27.  
  28. #ifndef MSDOS
  29. typedef struct
  30. {
  31.     int        dd_fd;        /* file descriptor            */
  32.     int        dd_loc;        /* offset in block            */
  33.     int        dd_size;    /* amount of valid data            */
  34.     char    *dd_buf;    /* -> directory block            */
  35. } DIR;                /* stream data from opendir()        */
  36.  
  37. #else
  38.  
  39. /* MSDOS versions */
  40.  
  41. struct _dircontents {
  42.     char        *_d_entry;
  43.     struct _dircontents    *_d_next;
  44. };
  45.  
  46. typedef struct _dirdesc {
  47.     int            dd_id;    /* uniquely identify each open directory */
  48.     long        dd_loc;    /* where we are in directory entry is this */
  49.     struct _dircontents    *dd_contents;    /* pointer to contents of dir    */
  50.     struct _dircontents    *dd_cp;        /* pointer to current position    */
  51. } DIR;
  52. #endif
  53.  
  54. /* Functions */
  55.  
  56. extern DIR * _CDECL        opendir        _PROTO ((char *));
  57. extern struct dirent * _CDECL    readdir        _PROTO ((DIR *));
  58. extern void _CDECL        rewinddir    _PROTO ((DIR *));
  59. extern int _CDECL        closedir    _PROTO ((DIR *));
  60. extern void _CDECL        seekdir        _PROTO ((DIR *, off_t));
  61. extern off_t _CDECL        telldir        _PROTO ((DIR *));
  62.  
  63. extern int _CDECL        chdir        _PROTO ((char *));
  64. extern char * _CDECL        getcwd        _PROTO ((char *, int));
  65. #ifdef MSDOS
  66. extern int _CDECL        mkdir        _PROTO ((char *));
  67. #else
  68. extern int _CDECL        mkdir        _PROTO ((char *, mode_t));
  69. #endif
  70. extern int _CDECL        rmdir        _PROTO ((char *));
  71. extern int _CDECL        scandir        _PROTO ((char *, struct dirent ***, int (_CDECL *)(const void *, const void *), int (_CDECL *)(const void *, const void *)));
  72. #endif
  73.