home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc1 / Src / lib / old-h / dirio < prev    next >
Encoding:
Text File  |  1993-01-01  |  1.5 KB  |  54 lines

  1. /* dirio.h: checked directory operations.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef DIRIO_H
  20. #define DIRIO_H
  21.  
  22. #if DIRENT || _POSIX_VERSION
  23. #include <dirent.h>
  24. #define NLENGTH(dirent) strlen ((dirent)->d_name)
  25. #else /* not (DIRENT or _POSIX_VERSION) */
  26. #define dirent direct
  27. #define NLENGTH(dirent) ((dirent)->d_namlen)
  28.  
  29. #ifdef SYSNDIR
  30. #include <sys/ndir.h>
  31. #endif
  32.  
  33. #ifdef NDIR
  34. #include <ndir.h>
  35. #endif
  36.  
  37. #ifdef SYSDIR
  38. #include <sys/dir.h>
  39. #endif
  40.  
  41. #endif /* not (DIRENT or _POSIX_VERSION) */
  42.  
  43. /* Like opendir, closedir, and chdir, but abort if DIRNAME can't be opened.  */
  44. extern DIR *xopendir P1H(string dirname);
  45. extern void xclosedir P1H(DIR *);
  46.  
  47. /* Returns true if FN is a directory (or a symlink to a directory).  */
  48. extern boolean dir_p P1H(string fn);
  49.  
  50. /* Returns true if FN is directory with no subdirectories.  */
  51. extern boolean leaf_dir_p P1H(string fn);
  52.  
  53. #endif /* not DIRIO_H */
  54.