| 206 | nullcThrowError("Failed to read from a file."); |
| 207 | } |
| 208 | void FileWriteArr(NULLCArray arr, unsigned offset, unsigned count, File* file) |
| 209 | { |
| 210 | if(!file->handle) |
| 211 | { |
| 212 | nullcThrowError("Cannot write to a closed file."); |
| 213 | return; |
| 214 | } |
| 215 | if((long long)count + offset > arr.len) |
| 216 | { |
| 217 | nullcThrowError("Array doesn't contain %d bytes from the specified offset.", count); |
| 218 | return; |
| 219 | } |
| 220 | if(count != fwrite(arr.ptr + offset, 1, count, file->handle)) |
| 221 | nullcThrowError("Failed to write to a file."); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | #define REGISTER_FUNC(funcPtr, name, index) if(!nullcBindModuleFunction("std.file", (void(*)())NULLCFile::funcPtr, name, index)) return false; |
nothing calls this directly
no test coverage detected