OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkOSFile.h" | 8 #include "SkOSFile.h" |
9 | 9 #include "SkString.h" |
10 #include "SkTFitsIn.h" | 10 #include "SkTFitsIn.h" |
| 11 #include "SkTemplates.h" |
11 #include "SkTypes.h" | 12 #include "SkTypes.h" |
12 | 13 |
13 #include <dirent.h> | 14 #include <dirent.h> |
14 #include <stdio.h> | 15 #include <stdio.h> |
| 16 #include <string.h> |
15 #include <sys/mman.h> | 17 #include <sys/mman.h> |
16 #include <sys/stat.h> | 18 #include <sys/stat.h> |
17 #include <sys/types.h> | 19 #include <sys/types.h> |
18 #include <unistd.h> | 20 #include <unistd.h> |
19 | 21 |
20 bool sk_exists(const char *path, SkFILE_Flags flags) { | 22 bool sk_exists(const char *path, SkFILE_Flags flags) { |
21 int mode = F_OK; | 23 int mode = F_OK; |
22 if (flags & kRead_SkFILE_Flag) { | 24 if (flags & kRead_SkFILE_Flag) { |
23 mode |= R_OK; | 25 mode |= R_OK; |
24 } | 26 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 174 } |
173 if (entry) { // we broke out with a file | 175 if (entry) { // we broke out with a file |
174 if (name) { | 176 if (name) { |
175 name->set(entry->d_name); | 177 name->set(entry->d_name); |
176 } | 178 } |
177 return true; | 179 return true; |
178 } | 180 } |
179 } | 181 } |
180 return false; | 182 return false; |
181 } | 183 } |
OLD | NEW |