checkin of 0.3.0
[pspp-builds.git] / src / stat.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3    Written by Ben Pfaff <blp@gnu.org>.
4
5    This program is free software; you can redistribute it and/or
6    modify it under the terms of the GNU General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    License, or (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    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., 59 Temple Place - Suite 330, Boston, MA
18    02111-1307, USA. */
19
20 #include <sys/stat.h>
21
22 #ifdef STAT_MACROS_BROKEN
23 #undef S_ISBLK
24 #undef S_ISCHR
25 #undef S_ISDIR
26 #undef S_ISFIFO
27 #undef S_ISLNK
28 #undef S_ISMPB
29 #undef S_ISMPC
30 #undef S_ISNWK
31 #undef S_ISREG
32 #undef S_ISSOCK
33 #endif /* STAT_MACROS_BROKEN.  */
34
35 #if !defined(S_ISBLK) && defined(S_IFBLK)
36 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
37 #endif
38 #if !defined(S_ISCHR) && defined(S_IFCHR)
39 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
40 #endif
41 #if !defined(S_ISDIR) && defined(S_IFDIR)
42 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
43 #endif
44 #if !defined(S_ISREG) && defined(S_IFREG)
45 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
46 #endif
47 #if !defined(S_ISFIFO) && defined(S_IFIFO)
48 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
49 #endif
50 #if !defined(S_ISLNK) && defined(S_IFLNK)
51 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
52 #endif
53 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
54 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
55 #endif
56 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
57 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
58 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
59 #endif
60 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
61 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
62 #endif
63 #if !defined(HAVE_MKFIFO)
64 #define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
65 #endif