This commit is contained in:
+13
-13
@@ -10,17 +10,17 @@
|
||||
WpFile *wpFileOpen(const WpAllocator *allocator, WpStr8RO *filepath, WpFileAccessMode mode) {
|
||||
wpDebugAssert(allocator != NULL && filepath != NULL, "`allocator` and `filepath` should not be NULL");
|
||||
wpDebugAssert(filepath->size < WP_PATH_MAX, "`filepath` exceeds max path limit.");
|
||||
return _fileOpen(allocator, filepath, mode);
|
||||
return fileOpen(allocator, filepath, mode);
|
||||
}
|
||||
|
||||
i64 wpFileGetCurrentPosition(WpFile *file) {
|
||||
wpDebugAssert(file != NULL, "`file` should not be NULL.");
|
||||
return _fileSeek(file, 0, WP_SEEK_CURRENT);
|
||||
return fileSeek(file, 0, WP_SEEK_CURRENT);
|
||||
}
|
||||
|
||||
i64 wpFileSeek(WpFile *file, i64 offset, WpFileSeekOrigin origin) {
|
||||
wpDebugAssert(file != NULL, "`file` should not be NULL.");
|
||||
return _fileSeek(file, offset, origin);
|
||||
return fileSeek(file, offset, origin);
|
||||
}
|
||||
|
||||
i64 wpFileGetLength(WpFile *file) {
|
||||
@@ -28,12 +28,12 @@ i64 wpFileGetLength(WpFile *file) {
|
||||
|
||||
i64 current = wpFileGetCurrentPosition(file);
|
||||
|
||||
_fileSeek(file, 0, WP_SEEK_END);
|
||||
fileSeek(file, 0, WP_SEEK_END);
|
||||
|
||||
i64 output = wpFileGetCurrentPosition(file);
|
||||
|
||||
// Restore position
|
||||
_fileSeek(file, current, WP_SEEK_START);
|
||||
fileSeek(file, current, WP_SEEK_START);
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -47,13 +47,13 @@ u64 wpFileRead(void *dst_buf, WpFile *file, u64 byte_count) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return _fileRead(dst_buf, byte_count, file, file_length);
|
||||
return fileRead(dst_buf, byte_count, file, file_length);
|
||||
}
|
||||
|
||||
i64 wpFileWrite(const void *src_buf, WpFile *file, u64 byte_count) {
|
||||
wpDebugAssert(src_buf != NULL && file != NULL,
|
||||
"`src_buf` and `file` should not be NULL.");
|
||||
return _fileWrite(src_buf, file, byte_count);
|
||||
return fileWrite(src_buf, file, byte_count);
|
||||
}
|
||||
|
||||
u64 wpFileReadStr8(WpStr8 *str, WpFile *file) {
|
||||
@@ -87,7 +87,7 @@ u64 wpFileReadArray(WpArray dst_buf, WpFile *file, u64 item_count) {
|
||||
copy_byte_count = file_length <= dst_byte_capacity ? file_length : dst_byte_capacity;
|
||||
}
|
||||
|
||||
u64 byte_count = _fileRead(dst_buf, copy_byte_count, file, file_length);
|
||||
u64 byte_count = fileRead(dst_buf, copy_byte_count, file, file_length);
|
||||
if (byte_count == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ i64 wpFileWriteArray(const WpArray src_buf, WpFile *file, u64 item_count) {
|
||||
u64 req_byte_count = item_count * item_size;
|
||||
u64 to_copy = req_byte_count <= src_byte_count ? req_byte_count : src_byte_count;
|
||||
|
||||
i64 bytes_written = _fileWrite(src_buf, file, to_copy);
|
||||
i64 bytes_written = fileWrite(src_buf, file, to_copy);
|
||||
if (bytes_written < 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -116,12 +116,12 @@ i64 wpFileWriteArray(const WpArray src_buf, WpFile *file, u64 item_count) {
|
||||
|
||||
i32 wpFileFlush(WpFile *file) {
|
||||
wpDebugAssert(file != NULL, "`file` should not be NULL.");
|
||||
return _fileFlush(file);
|
||||
return fileFlush(file);
|
||||
}
|
||||
|
||||
i32 wpFileClose(WpFile *file) {
|
||||
wpDebugAssert(file != NULL, "`file` should not be NULL.");
|
||||
return _fileClose(file);
|
||||
return fileClose(file);
|
||||
}
|
||||
|
||||
i32 wpFileRename(WpStr8RO *old_filepath, WpStr8RO *new_filepath) {
|
||||
@@ -129,11 +129,11 @@ i32 wpFileRename(WpStr8RO *old_filepath, WpStr8RO *new_filepath) {
|
||||
"`old_filepath` and `new_filepath` should not be NULL");
|
||||
wpDebugAssert(old_filepath->size < WP_PATH_MAX, "`old_filepath` exceeds max path limit.");
|
||||
wpDebugAssert(new_filepath->size < WP_PATH_MAX, "`new_filepath` exceeds max path limit.");
|
||||
return _fileRename(old_filepath, new_filepath);
|
||||
return fileRename(old_filepath, new_filepath);
|
||||
}
|
||||
|
||||
i32 wpFileRemove(WpStr8RO *filepath) {
|
||||
wpDebugAssert(filepath != NULL, "`filepath` should not be NULL");
|
||||
wpDebugAssert(filepath->size < WP_PATH_MAX, "`filepath` exceeds max path limit.");
|
||||
return _fileRemove(filepath);
|
||||
return fileRemove(filepath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user