breaking changes in type system

This commit is contained in:
2023-02-13 00:34:32 +06:00
parent 305854e721
commit 95fec8d166
48 changed files with 704 additions and 608 deletions

View File

@@ -2,7 +2,7 @@
#include "../String/StringBuilder.h"
#include "io_includes.h"
ktid_define(File);
kt_define(File, (freeMembers_t)file_close, NULL)
bool file_exists(const char* path){
if(path[0]=='.'){
@@ -61,10 +61,10 @@ Maybe file_close(File* file){
return MaybeNull;
}
#define ioWriteCheck()\
if(rezult==EOF)\
safethrow(ERR_IO_EOF,;);\
if(rezult!=0)\
#define ioWriteCheck() \
if(rezult==EOF) \
safethrow(ERR_IO_EOF,;); \
if(rezult!=0) \
safethrow(ERR_IO,;);
Maybe file_writeChar(File* file, char byte){

View File

@@ -9,14 +9,14 @@ extern "C" {
#include "../String/string.h"
typedef FILE File;
ktid_declare(File);
kt_declare(File);
bool file_exists(const char* path);
///@return Maybe<void>
Maybe file_delete(const char* path, bool recursive);
PACK_ENUM(FileOpenMode,
PACKED_ENUM(FileOpenMode,
// open a file for reading
FileOpenMode_Read=1,
// (re)create a file for writing