8 #define OS_DIRENT(ID, STR) [ID] = (STR),
17 return kDirentNames[type];
20 static const char *
const kAccessNames[] = {
21 [eOsAccessNone] =
"none",
22 [eOsAccessRead] =
"read",
23 [eOsAccessWrite] =
"write",
24 [eOsAccessRead | eOsAccessWrite] =
"read/write",
25 [eOsAccessTruncate] =
"truncate",
26 [eOsAccessRead | eOsAccessTruncate] =
"read (truncate)",
27 [eOsAccessWrite | eOsAccessTruncate] =
"write (truncate)",
28 [eOsAccessRead | eOsAccessWrite | eOsAccessTruncate] =
"read/write (truncate)",
35 return kAccessNames[access];
38 static const char *
const kProtectNames[] = {
39 [eOsProtectNone] =
"none",
40 [eOsProtectRead] =
"read",
41 [eOsProtectWrite] =
"write",
42 [eOsProtectExecute] =
"execute",
43 [eOsProtectRead | eOsProtectWrite] =
"read/write",
44 [eOsProtectRead | eOsProtectExecute] =
"read/execute",
45 [eOsProtectWrite | eOsProtectExecute] =
"write/execute",
46 [eOsProtectRead | eOsProtectWrite | eOsProtectExecute] =
"read/write/execute",
53 return kProtectNames[protect];
os_dirent_t
directory entry type
os_protect_t
file mapping memory protection
os_access_t
file access mode
#define STA_DECL
sal2 annotation on function implementations to copy annotations from the declaration
#define CT_ASSERT_RANGE(value, min, max)
assert that a value is in a range inclusive bounds check
#define CTASSERTF(expr,...)
assert a condition with a message and optional format arguments
STA_DECL const char * os_access_string(os_access_t access)
get the string representation of a file access mode
STA_DECL const char * os_protect_string(os_protect_t protect)
get the string representation of a file mapping memory protection
STA_DECL const char * os_dirent_string(os_dirent_t type)
get the string representation of a directory entry type