statdefs.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1993-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_statdefs_h)
00024 #define octave_statdefs_h 1
00025 
00026 #include <sys/types.h>
00027 
00028 #ifdef HAVE_SYS_STAT_H
00029 #include <sys/stat.h>
00030 #endif
00031 
00032 #ifndef S_ISREG                 /* Doesn't have POSIX.1 stat stuff. */
00033 #ifndef mode_t
00034 #define mode_t unsigned short
00035 #endif
00036 #endif
00037 #if !defined(S_ISBLK) && defined(S_IFBLK)
00038 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
00039 #endif
00040 #if !defined(S_ISCHR) && defined(S_IFCHR)
00041 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
00042 #endif
00043 #if !defined(S_ISDIR) && defined(S_IFDIR)
00044 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
00045 #endif
00046 #if !defined(S_ISREG) && defined(S_IFREG)
00047 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
00048 #endif
00049 #if !defined(S_ISFIFO) && defined(S_IFIFO)
00050 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
00051 #endif
00052 #if !defined(S_ISLNK) && defined(S_IFLNK)
00053 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
00054 #endif
00055 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
00056 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
00057 #endif
00058 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
00059 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
00060 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
00061 #endif
00062 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
00063 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
00064 #endif
00065 
00066 #ifndef S_ISLNK
00067 #undef HAVE_LSTAT
00068 #endif
00069 
00070 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines