OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 |
10 #include <errno.h> | 10 #include <errno.h> |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <sys/stat.h> | 12 #include <sys/stat.h> |
13 #include <sys/types.h> | |
14 | 13 |
15 #ifdef _WIN32 | 14 #ifdef _WIN32 |
16 #include <direct.h> | 15 #include <direct.h> |
17 #include <io.h> | 16 #include <io.h> |
18 #endif | 17 #endif |
19 | 18 |
| 19 #include "SkTypes.h" |
| 20 |
20 SkFILE* sk_fopen(const char path[], SkFILE_Flags flags) { | 21 SkFILE* sk_fopen(const char path[], SkFILE_Flags flags) { |
21 char perm[4]; | 22 char perm[4]; |
22 char* p = perm; | 23 char* p = perm; |
23 | 24 |
24 if (flags & kRead_SkFILE_Flag) { | 25 if (flags & kRead_SkFILE_Flag) { |
25 *p++ = 'r'; | 26 *p++ = 'r'; |
26 } | 27 } |
27 if (flags & kWrite_SkFILE_Flag) { | 28 if (flags & kWrite_SkFILE_Flag) { |
28 *p++ = 'w'; | 29 *p++ = 'w'; |
29 } | 30 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 #else | 147 #else |
147 retval = mkdir(path, 0777); | 148 retval = mkdir(path, 0777); |
148 #endif | 149 #endif |
149 if (0 == retval) { | 150 if (0 == retval) { |
150 return true; | 151 return true; |
151 } else { | 152 } else { |
152 fprintf(stderr, "sk_mkdir: error %d creating dir '%s'\n", errno, path); | 153 fprintf(stderr, "sk_mkdir: error %d creating dir '%s'\n", errno, path); |
153 return false; | 154 return false; |
154 } | 155 } |
155 } | 156 } |
OLD | NEW |