changed Array_memset(), added file_close()
This commit is contained in:
parent
5fb2db2380
commit
00a1a29d34
@ -33,8 +33,8 @@ static inline Array_ Array_copy(Array_ src){
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define Array_len(AR, T) ((AR)->size / sizeof(T))
|
#define Array_len(A, T) (A.size / sizeof(T))
|
||||||
#define Array_memset(A, VAL) memset((A)->data, VAL, (A)->size)
|
#define Array_memset(A, VAL) memset(A.data, VAL, A.size)
|
||||||
|
|
||||||
#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR))
|
#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR))
|
||||||
|
|
||||||
|
|||||||
@ -58,6 +58,10 @@ str path_basename(str path, bool remove_ext);
|
|||||||
|
|
||||||
Result(FILE*) file_open(cstr file_name, cstr fopen_mode);
|
Result(FILE*) file_open(cstr file_name, cstr fopen_mode);
|
||||||
|
|
||||||
|
static inline void file_close(FILE* f){
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
|
||||||
/// if file exists, opens it with "rb+", else creates it with "wb+"
|
/// if file exists, opens it with "rb+", else creates it with "wb+"
|
||||||
Result(FILE*) file_openOrCreateReadWrite(cstr file_name);
|
Result(FILE*) file_openOrCreateReadWrite(cstr file_name);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user