Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / nt / inc / sys / stat.h
CommitLineData
87c24bb7
EZ
1/* sys/stat.h supplied with MSVCRT uses too narrow data types for
2 inode and user/group id, so we replace them with our own.
3
4 Copyright (C) 2008 Free Software Foundation, Inc.
5
6This file is part of GNU Emacs.
7
eef0be9e 8GNU Emacs is free software: you can redistribute it and/or modify
87c24bb7 9it under the terms of the GNU General Public License as published by
eef0be9e
GM
10the Free Software Foundation, either version 3 of the License, or
11(at your option) any later version.
87c24bb7
EZ
12
13GNU Emacs is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
eef0be9e 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
40beb147
EZ
20
21#ifndef INC_SYS_STAT_H_
22#define INC_SYS_STAT_H_
23
24#ifdef __MINGW32__
25# include <_mingw.h>
87c24bb7
EZ
26#endif
27
28/* Only MinGW 3.13 and later has __MINGW_NOTHROW. */
29#ifndef __MINGW_NOTHROW
40beb147
EZ
30# define __MINGW_NOTHROW
31#endif
32
33#include <sys/types.h>
34#include <time.h>
35
36#define S_IFMT 0xF000
37
38#define S_IFREG 0x8000
39#define S_IFDIR 0x4000
40#define S_IFBLK 0x3000
41#define S_IFCHR 0x2000
42#define S_IFIFO 0x1000
43
44#define S_IREAD 0x0100
45#define S_IWRITE 0x0080
46#define S_IEXEC 0x0040
47
48#define S_IRUSR S_IREAD
49#define S_IWUSR S_IWRITE
50#define S_IXUSR S_IEXEC
51#define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC)
52
53#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
54#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
55#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
56#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
57#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
58
59struct stat {
60 dev_t st_dev;
61 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
62 unsigned short st_mode;
63 short st_nlink;
64 int st_uid;
65 int st_gid;
66 dev_t st_rdev;
67 off_t st_size;
68 time_t st_atime;
69 time_t st_mtime;
70 time_t st_ctime;
71};
72
73_CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*);
74_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
75_CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*);
76
77#endif /* INC_SYS_STAT_H_ */
80d0c8d9
MB
78
79/* arch-tag: 17d8fc06-f2e5-4d10-a01e-af819918fe42
80 (do not change this comment) */