home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / find-3.8-src.lha / src / amiga / find-3.8 / lib / modetype.h < prev    next >
C/C++ Source or Header  |  1992-02-13  |  2KB  |  70 lines

  1. /* modetype.h -- file type bits definitions for POSIX systems
  2.    Copyright (C) 1990 Free Software Foundation, Inc.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /* POSIX.1 doesn't mention the S_IFMT bits; instead, it uses S_IStype
  19.    test macros.  To make storing file types more convenient, define
  20.    them; the values don't need to correspond to what the kernel uses,
  21.    because of the way we use them. */
  22. #ifndef S_IFMT            /* Doesn't have traditional Unix macros. */
  23. #define S_IFBLK 1
  24. #define S_IFCHR 2
  25. #define S_IFDIR 4
  26. #define S_IFREG 8
  27. #ifdef S_ISLNK
  28. #define S_IFLNK 16
  29. #endif
  30. #ifdef S_ISFIFO
  31. #define S_IFIFO 32
  32. #endif
  33. #ifdef S_ISSOCK
  34. #define S_IFSOCK 64
  35. #endif
  36. #endif /* !S_IFMT */
  37.  
  38. #ifndef S_ISREG            /* Doesn't have POSIX.1 stat stuff. */
  39. #define mode_t unsigned short
  40. #endif
  41.  
  42. #if !defined(S_ISBLK) && defined(S_IFBLK)
  43. #define    S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
  44. #endif
  45. #if !defined(S_ISCHR) && defined(S_IFCHR)
  46. #define    S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
  47. #endif
  48. #if !defined(S_ISDIR) && defined(S_IFDIR)
  49. #define    S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
  50. #endif
  51. #if !defined(S_ISREG) && defined(S_IFREG)
  52. #define    S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
  53. #endif
  54. #if !defined(S_ISFIFO) && defined(S_IFIFO)
  55. #define    S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
  56. #endif
  57. #if !defined(S_ISLNK) && defined(S_IFLNK)
  58. #define    S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  59. #endif
  60. #if !defined(S_ISSOCK) && defined(S_IFSOCK)
  61. #define    S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
  62. #endif
  63. #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
  64. #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
  65. #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
  66. #endif
  67. #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
  68. #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
  69. #endif
  70.