annotate nt/inc/sys/stat.h @ 104708:2362371c57c2

(get-free-disk-space): Fix paren-typo in last change.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 29 Aug 2009 15:33:27 +0000
parents 06ca3efb355b
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94010
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
1 /* sys/stat.h supplied with MSVCRT uses too narrow data types for
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
2 inode and user/group id, so we replace them with our own.
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
3
100954
aeceb2460b39 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 94812
diff changeset
4 Copyright (C) 2008, 2009 Free Software Foundation, Inc.
94010
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
5
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
6 This file is part of GNU Emacs.
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
7
94793
a9cdaa557fee Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94010
diff changeset
8 GNU Emacs is free software: you can redistribute it and/or modify
94010
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
9 it under the terms of the GNU General Public License as published by
94793
a9cdaa557fee Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94010
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
a9cdaa557fee Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94010
diff changeset
11 (at your option) any later version.
94010
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
12
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
13 GNU Emacs is distributed in the hope that it will be useful,
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
16 GNU General Public License for more details.
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
17
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
18 You should have received a copy of the GNU General Public License
94793
a9cdaa557fee Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94010
diff changeset
19 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
93691
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
20
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
21 #ifndef INC_SYS_STAT_H_
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
22 #define INC_SYS_STAT_H_
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
23
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
24 #ifdef __MINGW32__
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
25 # include <_mingw.h>
94010
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
26 #endif
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
27
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
28 /* Only MinGW 3.13 and later has __MINGW_NOTHROW. */
eb51ce38e226 (__MINGW_NOTHROW): If not defined, define to nothing.
Eli Zaretskii <eliz@gnu.org>
parents: 93729
diff changeset
29 #ifndef __MINGW_NOTHROW
93691
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
30 # define __MINGW_NOTHROW
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
31 #endif
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
32
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
33 #include <sys/types.h>
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
34 #include <time.h>
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
35
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
36 #define S_IFMT 0xF000
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
37
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
38 #define S_IFREG 0x8000
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
39 #define S_IFDIR 0x4000
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
40 #define S_IFBLK 0x3000
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
41 #define S_IFCHR 0x2000
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
42 #define S_IFIFO 0x1000
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
43
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
44 #define S_IREAD 0x0100
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
45 #define S_IWRITE 0x0080
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
46 #define S_IEXEC 0x0040
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
47
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
48 #define S_IRUSR S_IREAD
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
49 #define S_IWUSR S_IWRITE
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
50 #define S_IXUSR S_IEXEC
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
51 #define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC)
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
52
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
53 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
54 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
55 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
56 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
57 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
58
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
59 struct stat {
94812
dadc38b34319 (struct stat): Move st_dev after st_ino, for better alignment.
Eli Zaretskii <eliz@gnu.org>
parents: 94793
diff changeset
60 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
93691
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
61 dev_t st_dev;
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
62 unsigned short st_mode;
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
63 short st_nlink;
102670
06ca3efb355b inc/sys/stat.h (struct stat): Change the types of st_uid and st_gid to unsigned.
Eli Zaretskii <eliz@gnu.org>
parents: 100954
diff changeset
64 unsigned st_uid; /* Vista's TrustedInstaller has a very large RID */
06ca3efb355b inc/sys/stat.h (struct stat): Change the types of st_uid and st_gid to unsigned.
Eli Zaretskii <eliz@gnu.org>
parents: 100954
diff changeset
65 unsigned st_gid;
94812
dadc38b34319 (struct stat): Move st_dev after st_ino, for better alignment.
Eli Zaretskii <eliz@gnu.org>
parents: 94793
diff changeset
66 unsigned __int64 st_size;
93691
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
67 dev_t st_rdev;
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
68 time_t st_atime;
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
69 time_t st_mtime;
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
70 time_t st_ctime;
94812
dadc38b34319 (struct stat): Move st_dev after st_ino, for better alignment.
Eli Zaretskii <eliz@gnu.org>
parents: 94793
diff changeset
71 char st_uname[260];
dadc38b34319 (struct stat): Move st_dev after st_ino, for better alignment.
Eli Zaretskii <eliz@gnu.org>
parents: 94793
diff changeset
72 char st_gname[260];
93691
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
73 };
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
74
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
75 _CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*);
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
76 _CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
77 _CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*);
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
78
427c85059fb8 New file.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
79 #endif /* INC_SYS_STAT_H_ */
93729
8dc921bd7171 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 93691
diff changeset
80
8dc921bd7171 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 93691
diff changeset
81 /* arch-tag: 17d8fc06-f2e5-4d10-a01e-af819918fe42
8dc921bd7171 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 93691
diff changeset
82 (do not change this comment) */