dirent.h
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:1k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. /* file changed to make it VMS compatible. NOT ALL UNIX FEATURES WORK */
  2. /* NOTE: the routines are NOT re-entrant... */
  3. /*
  4.  * Filesystem-independent directory information.
  5.  */
  6. #ifndef __dirent_h
  7. #define __dirent_h
  8. #include <types.h>
  9. #ifndef _POSIX_SOURCE
  10. #define d_ino d_fileno /* compatability */
  11. #ifndef NULL
  12. #define NULL 0
  13. #endif
  14. #endif /* !_POSIX_SOURCE */
  15. /*
  16.  * Definitions for library routines operating on directories.
  17.  */
  18. #include <descrip.h>
  19. typedef struct __dirdesc {
  20. #if 0
  21. int dd_fd; /* file descriptor */
  22. long dd_loc; /* buf offset of entry from last readddir() */
  23. long dd_size; /* amount of valid data in buffer */
  24. long dd_bsize; /* amount of entries read at a time */
  25. long dd_off; /* Current offset in dir (for telldir) */
  26. char *dd_buf; /* directory data buffer */
  27. #endif
  28. long  context; /* context descriptor for LIB$FIND_FILE calls */
  29. char dirname[255+1]; /* keeps the directory name, including *.* */
  30. struct dsc$descriptor_s dirname_desc; /* descriptor of dirname */
  31. } DIR;
  32. extern DIR *opendir(char *dirname);
  33. extern struct dirent *readdir(DIR *dirp);
  34. extern int closedir(DIR *dirp);
  35. #if 0
  36. #ifndef _POSIX_SOURCE
  37. extern void seekdir(/* DIR *dirp, int loc */);
  38. extern long telldir(/* DIR *dirp */);
  39. #endif /* POSIX_SOURCE */
  40. extern void rewinddir(/* DIR *dirp */);
  41. #ifndef lint
  42. #define rewinddir(dirp) seekdir((dirp), (long)0)
  43. #endif
  44. #endif /* not defined for VMS */
  45. #include "sys_dirent.h"
  46. #endif /* !__dirent_h */