| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_FILE_H_ | 5 #ifndef BIN_FILE_H_ |
| 6 #define BIN_FILE_H_ | 6 #define BIN_FILE_H_ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // These match the constants in FileStat in file_impl.dart. | 79 // These match the constants in FileStat in file_impl.dart. |
| 80 kLockMin = 0, | 80 kLockMin = 0, |
| 81 kLockUnlock = 0, | 81 kLockUnlock = 0, |
| 82 kLockShared = 1, | 82 kLockShared = 1, |
| 83 kLockExclusive = 2, | 83 kLockExclusive = 2, |
| 84 kLockMax = 2 | 84 kLockMax = 2 |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 intptr_t GetFD(); | 87 intptr_t GetFD(); |
| 88 | 88 |
| 89 void* MapExecutable(intptr_t* num_bytes); |
| 90 |
| 89 // Read/Write attempt to transfer num_bytes to/from buffer. It returns | 91 // Read/Write attempt to transfer num_bytes to/from buffer. It returns |
| 90 // the number of bytes read/written. | 92 // the number of bytes read/written. |
| 91 int64_t Read(void* buffer, int64_t num_bytes); | 93 int64_t Read(void* buffer, int64_t num_bytes); |
| 92 int64_t Write(const void* buffer, int64_t num_bytes); | 94 int64_t Write(const void* buffer, int64_t num_bytes); |
| 93 | 95 |
| 94 // ReadFully and WriteFully do attempt to transfer num_bytes to/from | 96 // ReadFully and WriteFully do attempt to transfer num_bytes to/from |
| 95 // the buffer. In the event of short accesses they will loop internally until | 97 // the buffer. In the event of short accesses they will loop internally until |
| 96 // the whole buffer has been transferred or an error occurs. If an error | 98 // the whole buffer has been transferred or an error occurs. If an error |
| 97 // occurred the result will be set to false. | 99 // occurred the result will be set to false. |
| 98 bool ReadFully(void* buffer, int64_t num_bytes); | 100 bool ReadFully(void* buffer, int64_t num_bytes); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 Dart_WeakPersistentHandle weak_handle_; | 232 Dart_WeakPersistentHandle weak_handle_; |
| 231 | 233 |
| 232 friend class ReferenceCounted<File>; | 234 friend class ReferenceCounted<File>; |
| 233 DISALLOW_COPY_AND_ASSIGN(File); | 235 DISALLOW_COPY_AND_ASSIGN(File); |
| 234 }; | 236 }; |
| 235 | 237 |
| 236 } // namespace bin | 238 } // namespace bin |
| 237 } // namespace dart | 239 } // namespace dart |
| 238 | 240 |
| 239 #endif // BIN_FILE_H_ | 241 #endif // BIN_FILE_H_ |
| OLD | NEW |