| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Partial <sys/stat.h>-lookalike-ish. Note that this is a C header, so that | 5 // Partial <sys/stat.h>-lookalike-ish. Note that this is a C header, so that |
| 6 // crappy (and non-crappy) C programs can use it. | 6 // crappy (and non-crappy) C programs can use it. |
| 7 // | 7 // |
| 8 // In general, functions/types/macros are given "mojio_"/"MOJIO_"/etc. prefixes. | 8 // In general, functions/types/macros are given "mojio_"/"MOJIO_"/etc. prefixes. |
| 9 // There are a handful of exceptions (noted below). | 9 // There are a handful of exceptions (noted below). |
| 10 | 10 |
| 11 #ifndef MOJO_SERVICES_FILES_PUBLIC_C_MOJIO_SYS_STAT_H_ | 11 #ifndef MOJO_SERVICES_FILES_C_MOJIO_SYS_STAT_H_ |
| 12 #define MOJO_SERVICES_FILES_PUBLIC_C_MOJIO_SYS_STAT_H_ | 12 #define MOJO_SERVICES_FILES_C_MOJIO_SYS_STAT_H_ |
| 13 | 13 |
| 14 // Includes -------------------------------------------------------------------- | 14 // Includes -------------------------------------------------------------------- |
| 15 | 15 |
| 16 // <sys/stat.h> is required to define a large number of types defined in | 16 // <sys/stat.h> is required to define a large number of types defined in |
| 17 // <sys/types.h>, so we just include our equivalent of the latter. | 17 // <sys/types.h>, so we just include our equivalent of the latter. |
| 18 #include "files/public/c/mojio_sys_types.h" | 18 #include "files/c/mojio_sys_types.h" |
| 19 | 19 |
| 20 // We need our |struct timespec| equivalent. | 20 // We need our |struct timespec| equivalent. |
| 21 #include "files/public/c/mojio_time.h" | 21 #include "files/c/mojio_time.h" |
| 22 | 22 |
| 23 // Macros ---------------------------------------------------------------------- | 23 // Macros ---------------------------------------------------------------------- |
| 24 | 24 |
| 25 #define MOJIO_S_IRWXU (MOJIO_S_IRUSR | MOJIO_S_IWUSR | MOJIO_S_IXUSR) | 25 #define MOJIO_S_IRWXU (MOJIO_S_IRUSR | MOJIO_S_IWUSR | MOJIO_S_IXUSR) |
| 26 #define MOJIO_S_IRUSR 00400 | 26 #define MOJIO_S_IRUSR 00400 |
| 27 #define MOJIO_S_IWUSR 00200 | 27 #define MOJIO_S_IWUSR 00200 |
| 28 #define MOJIO_S_IXUSR 00100 | 28 #define MOJIO_S_IXUSR 00100 |
| 29 | 29 |
| 30 #define MOJIO_S_IRWXG (MOJIO_S_IRGRP | MOJIO_S_IWGRP | MOJIO_S_IXGRP) | 30 #define MOJIO_S_IRWXG (MOJIO_S_IRGRP | MOJIO_S_IWGRP | MOJIO_S_IXGRP) |
| 31 #define MOJIO_S_IRGRP 00040 | 31 #define MOJIO_S_IRGRP 00040 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // int stat(const char* restrict, struct stat* restrict); | 118 // int stat(const char* restrict, struct stat* restrict); |
| 119 // mode_t umask(mode_t); | 119 // mode_t umask(mode_t); |
| 120 // int utimensat(int, const char*, const struct timespec [2], int); | 120 // int utimensat(int, const char*, const struct timespec [2], int); |
| 121 | 121 |
| 122 int mojio_fstat(int fd, struct mojio_stat* buf); | 122 int mojio_fstat(int fd, struct mojio_stat* buf); |
| 123 | 123 |
| 124 #ifdef __cplusplus | 124 #ifdef __cplusplus |
| 125 } // extern "C" | 125 } // extern "C" |
| 126 #endif | 126 #endif |
| 127 | 127 |
| 128 #endif // MOJO_SERVICES_FILES_PUBLIC_C_MOJIO_SYS_STAT_H_ | 128 #endif // MOJO_SERVICES_FILES_C_MOJIO_SYS_STAT_H_ |
| OLD | NEW |