1 /* c-stat.h: declarations for using stat(2).
3 Copyright 1993, 1996, 2008 Karl Berry.
4 Copyright 1998, 2000, 2005 Olaf Weber.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with this library; if not, see <http://www.gnu.org/licenses/>. */
19 #ifndef KPATHSEA_STAT_H
20 #define KPATHSEA_STAT_H
22 #include <kpathsea/systypes.h>
29 /* POSIX predicates for testing file attributes. */
31 #if !defined (S_ISBLK) && defined (S_IFBLK)
32 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
34 #if !defined (S_ISCHR) && defined (S_IFCHR)
35 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
37 #if !defined (S_ISDIR) && defined (S_IFDIR)
38 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
40 #if !defined (S_ISREG) && defined (S_IFREG)
41 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
43 #if !defined (S_ISFIFO) && defined (S_IFIFO)
44 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
46 #if !defined (S_ISLNK) && defined (S_IFLNK)
47 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
49 #if !defined (S_ISSOCK) && defined (S_IFSOCK)
50 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
52 #if !defined (S_ISMPB) && defined (S_IFMPB) /* V7 */
53 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
54 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
56 #if !defined (S_ISNWK) && defined (S_IFNWK) /* HP/UX */
57 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
60 #endif /* not KPATHSEA_STAT_H */