Debian Codegraph @

share/libc/__fc_define_mode_t.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef __FC_DEFINE_MODE_T
24 #define __FC_DEFINE_MODE_T
25 #include "features.h"
26 __PUSH_FC_STDLIB
27 __BEGIN_DECLS
28
29 #ifndef __mode_t_defined
30 typedef unsigned int mode_t;
31 #define __mode_t_defined
32 #endif
33
34 __END_DECLS
35
36 #define S_IFMT 0170000
37
38 #define S_IFBLK 0060000
39 #define S_IFCHR 0020000
40 #define S_IFIFO 0010000
41 #define S_IFREG 0100000
42 #define S_IFDIR 0040000
43 #define S_IFLNK 0120000
44 #define S_IFSOCK 0140000
45
46 #define S_IRUSR 00400
47 #define S_IWUSR 00200
48 #define S_IXUSR 00100
49 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
50
51 #define S_IRGRP 00040
52 #define S_IWGRP 00020
53 #define S_IXGRP 00010
54 #define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
55
56 #define S_IROTH 00004
57 #define S_IWOTH 00002
58 #define S_IXOTH 00001
59 #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
60
61 #define S_ISUID 0004000
62 #define S_ISGID 0002000
63 #define S_ISVTX 0001000
64
65 #define S_IEXEC S_IXUSR
66 #define S_IWRITE S_IWUSR
67 #define S_IREAD S_IRUSR
68
69 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
70 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
71 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
72 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
73 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
74 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
75 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
76
77 __POP_FC_STDLIB
78 #endif
79