Debian Codegraph @

texk/kpathsea/c-stat.h

raw
1 /* c-stat.h: declarations for using stat(2).
2
3 Copyright 1993, 1996, 2008, 2010 Karl Berry.
4 Copyright 1998, 2000, 2005 Olaf Weber.
5
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.
10
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.
15
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/>. */
18
19 #ifndef KPATHSEA_STAT_H
20 #define KPATHSEA_STAT_H
21
22 #include <kpathsea/systypes.h>
23 #include <sys/stat.h>
24
25 /* POSIX predicates for testing file attributes. */
26
27 #if !defined (S_ISBLK) && defined (S_IFBLK)
28 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
29 #endif
30 #if !defined (S_ISCHR) && defined (S_IFCHR)
31 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
32 #endif
33 #if !defined (S_ISDIR) && defined (S_IFDIR)
34 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
35 #endif
36 #if !defined (S_ISREG) && defined (S_IFREG)
37 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
38 #endif
39 #if !defined (S_ISFIFO) && defined (S_IFIFO)
40 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
41 #endif
42 #if !defined (S_ISLNK) && defined (S_IFLNK)
43 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
44 #endif
45 #if !defined (S_ISSOCK) && defined (S_IFSOCK)
46 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
47 #endif
48 #if !defined (S_ISMPB) && defined (S_IFMPB) /* V7 */
49 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
50 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
51 #endif
52 #if !defined (S_ISNWK) && defined (S_IFNWK) /* HP/UX */
53 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
54 #endif
55
56 #endif /* not KPATHSEA_STAT_H */