GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
statdefs.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2015 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_statdefs_h)
24 #define octave_statdefs_h 1
25 
26 #include <sys/types.h>
27 
28 #ifdef HAVE_SYS_STAT_H
29 #include <sys/stat.h>
30 #endif
31 
32 #ifndef S_ISREG /* Doesn't have POSIX.1 stat stuff. */
33 #ifndef mode_t
34 #define mode_t unsigned short
35 #endif
36 #endif
37 #if !defined(S_ISBLK) && defined(S_IFBLK)
38 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
39 #endif
40 #if !defined(S_ISCHR) && defined(S_IFCHR)
41 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
42 #endif
43 #if !defined(S_ISDIR) && defined(S_IFDIR)
44 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
45 #endif
46 #if !defined(S_ISREG) && defined(S_IFREG)
47 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
48 #endif
49 #if !defined(S_ISFIFO) && defined(S_IFIFO)
50 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
51 #endif
52 #if !defined(S_ISLNK) && defined(S_IFLNK)
53 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
54 #endif
55 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
56 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
57 #endif
58 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
59 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
60 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
61 #endif
62 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
63 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
64 #endif
65 
66 #ifndef S_ISLNK
67 #undef HAVE_LSTAT
68 #endif
69 
70 #endif