2 ** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
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.
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.
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.
19 /* Some defines that microsoft 'forgot' to implement. */
22 #define S_IRWXU 0000700 /* rwx, owner */
26 #define S_IRUSR 0000400 /* read permission, owner */
30 #define S_IWUSR 0000200 /* write permission, owner */
34 #define S_IXUSR 0000100 /* execute/search permission, owner */
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 */
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 */
50 #define S_ISFIFO(mode) (((mode) & _S_IFMT) == _S_IFIFO)
54 #define S_ISREG(mode) (((mode) & _S_IFREG) == _S_IFREG)
58 ** Don't know if these are still needed.
60 ** #define _IFMT _S_IFMT
61 ** #define _IFREG _S_IFREG