home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / git-4.3 / git-4 / git-4.3.11 / src / stat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.6 KB  |  139 lines

  1. /* stat.h -- Safely defined stat constants.  */
  2.  
  3. /* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
  4.  
  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 2, or (at your option)
  8.    any later version.
  9.  
  10.    This program is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.    GNU 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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. /* Written by Tudor Hulubei and Andrei Pitis.  */
  20.  
  21.  
  22. #ifndef _GIT_STAT_H
  23. #define _GIT_STAT_H
  24.  
  25.  
  26. #include <fcntl.h>
  27. #include <sys/stat.h>
  28.  
  29.  
  30. /* Ugly ... */
  31.  
  32. /*
  33.  * If the macros defined in sys/stat.h do not work properly, undefine them.
  34.  * We will define them later ...
  35.  * - Tektronix UTekV
  36.  * - Amdahl UTS
  37.  * - Motorola System V/88
  38.  */
  39.  
  40. #ifndef S_IFMT
  41. #define S_IFMT          00170000
  42. #endif
  43.  
  44. #ifndef S_IFSOCK
  45. #define S_IFSOCK        0140000
  46. #endif
  47.  
  48. #ifndef S_IFLNK
  49. #define S_IFLNK         0120000
  50. #endif
  51.  
  52. #ifndef S_IFREG
  53. #define S_IFREG         0100000
  54. #endif
  55.  
  56. #ifndef S_IFBLK
  57. #define S_IFBLK         0060000
  58. #endif
  59.  
  60. #ifndef S_IFDIR
  61. #define S_IFDIR         0040000
  62. #endif
  63.  
  64. #ifndef S_IFCHR
  65. #define S_IFCHR         0020000
  66. #endif
  67.  
  68. #ifndef S_IFIFO
  69. #define S_IFIFO         0010000
  70. #endif
  71.  
  72. #ifndef S_ISUID
  73. #define S_ISUID         0004000
  74. #endif
  75.  
  76. #ifndef S_ISGID
  77. #define S_ISGID         0002000
  78. #endif
  79.  
  80. #ifndef S_ISVTX
  81. #define S_ISVTX         0001000
  82. #endif
  83.  
  84.  
  85. #ifdef STAT_MACROS_BROKEN
  86. #undef S_ISBLK
  87. #undef S_ISCHR
  88. #undef S_ISDIR
  89. #undef S_ISFIFO
  90. #undef S_ISLNK
  91. #undef S_ISMPB
  92. #undef S_ISMPC
  93. #undef S_ISNWK
  94. #undef S_ISREG
  95. #undef S_ISSOCK
  96. #endif /* STAT_MACROS_BROKEN */
  97.  
  98.  
  99. #ifndef S_ISLNK
  100. #define S_ISLNK(m)      (((m) & S_IFMT) == S_IFLNK)
  101. #endif
  102.  
  103. #ifndef S_ISREG
  104. #define S_ISREG(m)      (((m) & S_IFMT) == S_IFREG)
  105. #endif
  106.  
  107. #ifndef S_ISDIR
  108. #define S_ISDIR(m)      (((m) & S_IFMT) == S_IFDIR)
  109. #endif
  110.  
  111. #ifndef S_ISCHR
  112. #define S_ISCHR(m)      (((m) & S_IFMT) == S_IFCHR)
  113. #endif
  114.  
  115. #ifndef S_ISBLK
  116. #define S_ISBLK(m)      (((m) & S_IFMT) == S_IFBLK)
  117. #endif
  118.  
  119. #ifndef S_ISFIFO
  120. #define S_ISFIFO(m)     (((m) & S_IFMT) == S_IFIFO)
  121. #endif
  122.  
  123. #ifndef S_ISSOCK
  124. #define S_ISSOCK(m)     (((m) & S_IFMT) == S_IFSOCK)
  125. #endif
  126.  
  127. #ifndef S_IRWXU
  128. #define S_IRWXU         0000700
  129. #endif
  130.  
  131. #ifndef S_IRWXG
  132. #define S_IRWXG         0000070
  133. #endif
  134.  
  135. /* Finally ... :-( */
  136.  
  137.  
  138. #endif  /* _GIT_STAT_H */
  139.