Alexandre Lision | 7c6f4a6 | 2013-09-05 13:27:01 -0400 | [diff] [blame] | 1 | /* |
| 2 | ** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com> |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or modify |
| 5 | ** it under the terms of the GNU Lesser General Public License as published by |
| 6 | ** the Free Software Foundation; either version 2.1 of the License, or |
| 7 | ** (at your option) 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 Lesser General Public License for more details. |
| 13 | ** |
| 14 | ** You should have received a copy of the GNU Lesser General Public License |
| 15 | ** along with this program; if not, write to the Free Software |
| 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | /* Some defines that microsoft 'forgot' to implement. */ |
| 20 | |
| 21 | #ifndef S_IRWXU |
| 22 | #define S_IRWXU 0000700 /* rwx, owner */ |
| 23 | #endif |
| 24 | |
| 25 | #ifndef S_IRUSR |
| 26 | #define S_IRUSR 0000400 /* read permission, owner */ |
| 27 | #endif |
| 28 | |
| 29 | #ifndef S_IWUSR |
| 30 | #define S_IWUSR 0000200 /* write permission, owner */ |
| 31 | #endif |
| 32 | |
| 33 | #ifndef S_IXUSR |
| 34 | #define S_IXUSR 0000100 /* execute/search permission, owner */ |
| 35 | #endif |
| 36 | |
| 37 | /* Windows doesn't have group permissions so set all these to zero. */ |
| 38 | #define S_IRWXG 0 /* rwx, group */ |
| 39 | #define S_IRGRP 0 /* read permission, group */ |
| 40 | #define S_IWGRP 0 /* write permission, grougroup */ |
| 41 | #define S_IXGRP 0 /* execute/search permission, group */ |
| 42 | |
| 43 | /* Windows doesn't have others permissions so set all these to zero. */ |
| 44 | #define S_IRWXO 0 /* rwx, other */ |
| 45 | #define S_IROTH 0 /* read permission, other */ |
| 46 | #define S_IWOTH 0 /* write permission, other */ |
| 47 | #define S_IXOTH 0 /* execute/search permission, other */ |
| 48 | |
| 49 | #ifndef S_ISFIFO |
| 50 | #define S_ISFIFO(mode) (((mode) & _S_IFMT) == _S_IFIFO) |
| 51 | #endif |
| 52 | |
| 53 | #ifndef S_ISREG |
| 54 | #define S_ISREG(mode) (((mode) & _S_IFREG) == _S_IFREG) |
| 55 | #endif |
| 56 | |
| 57 | /* |
| 58 | ** Don't know if these are still needed. |
| 59 | ** |
| 60 | ** #define _IFMT _S_IFMT |
| 61 | ** #define _IFREG _S_IFREG |
| 62 | */ |
| 63 | |