1 /* dirio.h: checked directory operations.
3 Copyright 1992 Karl Berry
4 Copyright 2007 TeX Users Group
5 Copyright 2014 Clerk Ma
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 /* #if DIRENT || _POSIX_VERSION */
28 #if defined(DIRENT) || defined(_POSIX_VERSION) /* 93/Dec/8 */
30 #define NLENGTH(dirent) strlen ((dirent)->d_name)
31 #else /* not (DIRENT or _POSIX_VERSION) */
33 #define NLENGTH(dirent) ((dirent)->d_namlen)
37 #endif /* not SYSNDIR */
45 #endif /* not SYSDIR */
47 #endif /* not (DIRENT or _POSIX_VERSION) */
49 /* Like opendir, closedir, and chdir, but abort if DIRNAME can't be opened. */
50 extern DIR *xopendir P1H(string);
51 extern void xclosedir P1H(DIR *);
52 #endif /* not DIRIO_H */
54 #endif /* not DOS */ /* was: not DIRIO_H, which is wrong - bkph */
56 /* #if !defined(DOS) || defined(PHARLAP) */ /* 1999/Jan/9 */
58 /* Returns true if FN is a directory (or a symlink to a directory). */
59 extern bool dir_p P1H(string fn);
61 /* Returns true if FN is directory with no subdirectories. */
62 extern bool leaf_dir_p P1H(string fn);
64 /* #endif */ /* not DOS, or DOS with PHARLAP */