doc: use ASCII in .texi files where UTF-8 isn't needed
[gnulib.git] / lib / file-type.h
index 385ae87..ff99a9d 100644 (file)
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
+/* Return a string describing the type of a file.
 
-#include <sys/types.h>
-#include <sys/stat.h>
+   Copyright (C) 1993-1994, 2001-2002, 2004-2005, 2009-2014 Free Software
+   Foundation, Inc.
 
-char const *file_type (struct stat const *);
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-#if STAT_MACROS_BROKEN
-# undef S_ISBLK
-# undef S_ISCHR
-# undef S_ISDIR
-# undef S_ISDOOR
-# undef S_ISFIFO
-# undef S_ISLNK
-# undef S_ISMPB
-# undef S_ISMPC
-# undef S_ISNWK
-# undef S_ISREG
-# undef S_ISSOCK
-#endif /* STAT_MACROS_BROKEN.  */
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-#ifndef S_IFMT
-# define S_IFMT 0170000
-#endif
-#if !defined(S_ISBLK) && defined(S_IFBLK)
-# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
-#endif
-#if !defined(S_ISCHR) && defined(S_IFCHR)
-# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
-#endif
-#if !defined(S_ISDIR) && defined(S_IFDIR)
-# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-#if !defined(S_ISREG) && defined(S_IFREG)
-# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-#if !defined(S_ISFIFO) && defined(S_IFIFO)
-# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
-#endif
-#if !defined(S_ISLNK) && defined(S_IFLNK)
-# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#endif
-#if !defined(S_ISSOCK) && defined(S_IFSOCK)
-# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
-#endif
-#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
-# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
-# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
-#endif
-#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
-# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
-#endif
-#if !defined(S_ISDOOR) && defined(S_IFDOOR) /* Solaris 2.5 and up */
-# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)
-#endif
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* If any of the following S_* macros are undefined, define them here
-   so each use doesn't have to be guarded with e.g., #ifdef S_ISLNK.  */
-#ifndef S_ISREG
-# define S_ISREG(Mode) 0
-#endif
+/* Written by Paul Eggert and Jim Meyering.  */
 
-#ifndef S_ISDIR
-# define S_ISDIR(Mode) 0
-#endif
+#ifndef FILE_TYPE_H
+# define FILE_TYPE_H 1
 
-#ifndef S_ISLNK
-# define S_ISLNK(Mode) 0
-#endif
+# include <sys/types.h>
+# include <sys/stat.h>
 
-#ifndef S_ISFIFO
-# define S_ISFIFO(Mode) 0
-#endif
+char const *file_type (struct stat const *) _GL_ATTRIBUTE_PURE;
 
-#ifndef S_ISSOCK
-# define S_ISSOCK(Mode) 0
-#endif
-
-#ifndef S_ISCHR
-# define S_ISCHR(Mode) 0
-#endif
-
-#ifndef S_ISBLK
-# define S_ISBLK(Mode) 0
-#endif
-
-#ifndef S_ISDOOR
-# define S_ISDOOR(Mode) 0
-#endif
-
-#ifndef S_TYPEISSEM
-# define S_TYPEISSEM(Stat_buf_p) 0
-#endif
-
-#ifndef S_TYPEISSHM
-# define S_TYPEISSHM(Stat_buf_p) 0
-#endif
-
-#ifndef S_TYPEISMQ
-# define S_TYPEISMQ(Stat_buf_p) 0
-#endif
+#endif /* FILE_TYPE_H */