Start str8 renaming
This commit is contained in:
+5
-5
@@ -7,7 +7,7 @@
|
||||
#include "../../base/array/array.h"
|
||||
#include "../../base/strings/str8/str8.h"
|
||||
|
||||
WFile *wapp_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) {
|
||||
WFile *wapp_file_open(const Allocator *allocator, WpStr8RO *filepath, FileAccessMode mode) {
|
||||
wpDebugAssert(allocator != NULL && filepath != NULL, "`allocator` and `filepath` should not be NULL");
|
||||
wpDebugAssert(filepath->size < WAPP_PATH_MAX, "`filepath` exceeds max path limit.");
|
||||
return _file_open(allocator, filepath, mode);
|
||||
@@ -56,12 +56,12 @@ i64 wapp_file_write(const void *src_buf, WFile *file, u64 byte_count) {
|
||||
return _file_write(src_buf, file, byte_count);
|
||||
}
|
||||
|
||||
u64 wapp_file_read_str8(Str8 *str, WFile *file) {
|
||||
u64 wapp_file_read_str8(WpStr8 *str, WFile *file) {
|
||||
wpDebugAssert(str != NULL, "`str` should not be NULL.");
|
||||
return wapp_file_read((void *)(str->buf), file, str->size);
|
||||
}
|
||||
|
||||
i64 wapp_file_write_str8(Str8RO *str, WFile *file) {
|
||||
i64 wapp_file_write_str8(WpStr8RO *str, WFile *file) {
|
||||
wpDebugAssert(str != NULL, "`str` should not be NULL.");
|
||||
return wapp_file_write((void *)(str->buf), file, str->size);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ i32 wapp_file_close(WFile *file) {
|
||||
return _file_close(file);
|
||||
}
|
||||
|
||||
i32 wapp_file_rename(Str8RO *old_filepath, Str8RO *new_filepath) {
|
||||
i32 wapp_file_rename(WpStr8RO *old_filepath, WpStr8RO *new_filepath) {
|
||||
wpDebugAssert(old_filepath != NULL && new_filepath != NULL,
|
||||
"`old_filepath` and `new_filepath` should not be NULL");
|
||||
wpDebugAssert(old_filepath->size < WAPP_PATH_MAX, "`old_filepath` exceeds max path limit.");
|
||||
@@ -132,7 +132,7 @@ i32 wapp_file_rename(Str8RO *old_filepath, Str8RO *new_filepath) {
|
||||
return _file_rename(old_filepath, new_filepath);
|
||||
}
|
||||
|
||||
i32 wapp_file_remove(Str8RO *filepath) {
|
||||
i32 wapp_file_remove(WpStr8RO *filepath) {
|
||||
wpDebugAssert(filepath != NULL, "`filepath` should not be NULL");
|
||||
wpDebugAssert(filepath->size < WAPP_PATH_MAX, "`filepath` exceeds max path limit.");
|
||||
return _file_remove(filepath);
|
||||
|
||||
+8
-8
@@ -46,29 +46,29 @@ wp_extern WFile *wapp_file_stdout(void);
|
||||
// wapp_file_stderr to get the standard error stream
|
||||
wp_extern WFile *wapp_file_stderr(void);
|
||||
|
||||
WFile *wapp_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode);
|
||||
WFile *wapp_file_open(const Allocator *allocator, WpStr8RO *filepath, FileAccessMode mode);
|
||||
i64 wapp_file_get_current_position(WFile *file);
|
||||
i64 wapp_file_seek(WFile *file, i64 offset, FileSeekOrigin origin);
|
||||
i64 wapp_file_get_length(WFile *file);
|
||||
u64 wapp_file_read(void *dst_buf, WFile *file, u64 byte_count);
|
||||
i64 wapp_file_write(const void *src_buf, WFile *file, u64 byte_count);
|
||||
u64 wapp_file_read_str8(Str8 *str, WFile *file);
|
||||
i64 wapp_file_write_str8(Str8RO *str, WFile *file);
|
||||
u64 wapp_file_read_str8(WpStr8 *str, WFile *file);
|
||||
i64 wapp_file_write_str8(WpStr8RO *str, WFile *file);
|
||||
u64 wapp_file_read_array(GenericArray dst_buf, WFile *file, u64 item_count);
|
||||
i64 wapp_file_write_array(const GenericArray src_buf, WFile *file, u64 item_count);
|
||||
i32 wapp_file_flush(WFile *file);
|
||||
i32 wapp_file_close(WFile *file);
|
||||
i32 wapp_file_rename(Str8RO *old_filepath, Str8RO *new_filepath);
|
||||
i32 wapp_file_remove(Str8RO *filepath);
|
||||
i32 wapp_file_rename(WpStr8RO *old_filepath, WpStr8RO *new_filepath);
|
||||
i32 wapp_file_remove(WpStr8RO *filepath);
|
||||
|
||||
wp_extern WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode);
|
||||
wp_extern WFile *_file_open(const Allocator *allocator, WpStr8RO *filepath, FileAccessMode mode);
|
||||
wp_extern i64 _file_seek(WFile *file, i64 offset, FileSeekOrigin origin);
|
||||
wp_extern u64 _file_read(void *dst_buf, u64 byte_count, WFile *file, u64 file_length);
|
||||
wp_extern i64 _file_write(const void *src_buf, WFile *file, u64 byte_count);
|
||||
wp_extern i32 _file_flush(WFile *file);
|
||||
wp_extern i32 _file_close(WFile *file);
|
||||
wp_extern i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath);
|
||||
wp_extern i32 _file_remove(Str8RO *filepath);
|
||||
wp_extern i32 _file_rename(WpStr8RO *old_filepath, WpStr8RO *new_filepath);
|
||||
wp_extern i32 _file_remove(WpStr8RO *filepath);
|
||||
|
||||
#ifdef WP_PLATFORM_CPP
|
||||
END_C_LINKAGE
|
||||
|
||||
@@ -64,7 +64,7 @@ WFile *wapp_file_stderr(void) {
|
||||
return &_stderr;
|
||||
}
|
||||
|
||||
WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) {
|
||||
WFile *_file_open(const Allocator *allocator, WpStr8RO *filepath, FileAccessMode mode) {
|
||||
wp_persist c8 tmp[WAPP_PATH_MAX] = {0};
|
||||
memset(tmp, 0, WAPP_PATH_MAX);
|
||||
memcpy(tmp, filepath->buf, filepath->size);
|
||||
@@ -107,7 +107,7 @@ i32 _file_close(WFile *file) {
|
||||
return close(file->fd);
|
||||
}
|
||||
|
||||
i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) {
|
||||
i32 _file_rename(WpStr8RO *old_filepath, WpStr8RO *new_filepath) {
|
||||
wp_persist c8 old_tmp[WAPP_PATH_MAX] = {0};
|
||||
wp_persist c8 new_tmp[WAPP_PATH_MAX] = {0};
|
||||
memset(old_tmp, 0, WAPP_PATH_MAX);
|
||||
@@ -123,7 +123,7 @@ i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) {
|
||||
return link_result;
|
||||
}
|
||||
|
||||
i32 _file_remove(Str8RO *filepath) {
|
||||
i32 _file_remove(WpStr8RO *filepath) {
|
||||
wp_persist c8 tmp[WAPP_PATH_MAX] = {0};
|
||||
memset(tmp, 0, WAPP_PATH_MAX);
|
||||
memcpy(tmp, filepath->buf, filepath->size);
|
||||
|
||||
@@ -72,7 +72,7 @@ WFile *wapp_file_stderr(void) {
|
||||
return &_stderr;
|
||||
}
|
||||
|
||||
WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) {
|
||||
WFile *_file_open(const Allocator *allocator, WpStr8RO *filepath, FileAccessMode mode) {
|
||||
wp_persist c8 tmp[WAPP_PATH_MAX] = {0};
|
||||
memset(tmp, 0, WAPP_PATH_MAX);
|
||||
memcpy(tmp, filepath->buf, filepath->size);
|
||||
@@ -147,7 +147,7 @@ i32 _file_close(WFile *file) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) {
|
||||
i32 _file_rename(WpStr8RO *old_filepath, WpStr8RO *new_filepath) {
|
||||
wp_persist c8 old_tmp[WAPP_PATH_MAX] = {0};
|
||||
wp_persist c8 new_tmp[WAPP_PATH_MAX] = {0};
|
||||
memset(old_tmp, 0, WAPP_PATH_MAX);
|
||||
@@ -162,7 +162,7 @@ i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
i32 _file_remove(Str8RO *filepath) {
|
||||
i32 _file_remove(WpStr8RO *filepath) {
|
||||
wp_persist c8 tmp[WAPP_PATH_MAX] = {0};
|
||||
memset(tmp, 0, WAPP_PATH_MAX);
|
||||
memcpy(tmp, filepath->buf, filepath->size);
|
||||
|
||||
Reference in New Issue
Block a user