fixed file_getSize

This commit is contained in:
2025-11-01 19:49:17 +05:00
parent b801719712
commit c4cb696721
3 changed files with 19 additions and 2 deletions

View File

@@ -93,4 +93,4 @@ typedef struct Result_ {
}\
} while(0)
#define try_assert(EXPR) if(!(EXPR)) { Return RESULT_ERROR((#EXPR), false); }
#define try_assert(EXPR) if(!(EXPR)) { Return RESULT_ERROR(("try_assert(" #EXPR ")"), false); }

View File

@@ -62,6 +62,10 @@ Result(FILE*) file_open(cstr file_name, cstr fopen_mode);
Result(FILE*) file_openOrCreateReadWrite(cstr file_name);
bool file_exists(cstr path);
///@return current position in file
Result(i64) file_tellPos(FILE* f);
///@return total size of file
Result(i64) file_getSize(FILE* f);
@@ -71,6 +75,7 @@ typedef enum SeekOrigin {
SeekOrigin_End = SEEK_END,
} SeekOrigin;
/// @brief changes current position in file
Result(void) file_seek(FILE* f, i64 offset, SeekOrigin origin);