fixed after breaking everything with errno.h and vector.h changes, config still borked
This commit is contained in:
parent
2df9f318a5
commit
cdd6c3976b
18 changed files with 86 additions and 84 deletions
16
src/std/io.c
16
src/std/io.c
|
|
@ -9,7 +9,7 @@ void ARC_IO_ReadFileToUint8t(ARC_String *path, uint8_t **data, uint64_t *length)
|
|||
FILE *file = fopen(path->data, "rb");
|
||||
if(!file){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG(arc_errno, "ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not open file \"%s\"", path->data);
|
||||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not open file \"%s\"", path->data);
|
||||
*length = 0;
|
||||
*data = NULL;
|
||||
return;
|
||||
|
|
@ -23,7 +23,7 @@ void ARC_IO_ReadFileToUint8t(ARC_String *path, uint8_t **data, uint64_t *length)
|
|||
if(*data == NULL){
|
||||
fclose(file);
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_ERR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), file data is NULL");
|
||||
ARC_DEBUG_LOG_ERROR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), file data is NULL");
|
||||
*length = 0;
|
||||
return;
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ void ARC_IO_ReadFileToUint8t(ARC_String *path, uint8_t **data, uint64_t *length)
|
|||
if(1 != fread(*data, *length, 1, file)){
|
||||
fclose(file);
|
||||
arc_errno = ARC_ERRNO_COPY;
|
||||
ARC_DEBUG_ERR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not copy file data");
|
||||
ARC_DEBUG_LOG_ERROR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not copy file data");
|
||||
*length = 0;
|
||||
*data = NULL;
|
||||
return;
|
||||
|
|
@ -44,7 +44,7 @@ void ARC_IO_FileToStr(ARC_String *path, ARC_String **data){
|
|||
FILE *file = fopen(path->data, "rb");
|
||||
if(!file){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG(arc_errno, "ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not open file \"%s\"", path->data);
|
||||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not open file \"%s\"", path->data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ void ARC_IO_FileToStr(ARC_String *path, ARC_String **data){
|
|||
if(fileData == NULL){
|
||||
fclose(file);
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_ERR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), file data is NULL");
|
||||
ARC_DEBUG_LOG_ERROR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), file data is NULL");
|
||||
*data = NULL;
|
||||
return;
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ void ARC_IO_FileToStr(ARC_String *path, ARC_String **data){
|
|||
if(1 != fread(fileData, length, 1, file)){
|
||||
fclose(file);
|
||||
arc_errno = ARC_ERRNO_COPY;
|
||||
ARC_DEBUG_ERR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not copy file data");
|
||||
ARC_DEBUG_LOG_ERROR("ARC_IO_FileToStr(ARC_String *path, ARC_String **data), could not copy file data");
|
||||
*data = NULL;
|
||||
return;
|
||||
}
|
||||
|
|
@ -78,14 +78,14 @@ void ARC_IO_WriteStrToFile(ARC_String *path, ARC_String *data){
|
|||
FILE *file = fopen(path->data, "wb");
|
||||
if(!file){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG(arc_errno, "ARC_IO_WriteStrToFile(ARC_String *path, ARC_String *data), could not open file \"%s\"", path->data);
|
||||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("ARC_IO_WriteStrToFile(ARC_String *path, ARC_String *data), could not open file \"%s\"", path->data);
|
||||
return;
|
||||
}
|
||||
|
||||
if(1 != fwrite(data->data, data->length, 1, file)){
|
||||
fclose(file);
|
||||
arc_errno = ARC_ERRNO_COPY;
|
||||
ARC_DEBUG_ERR("ARC_IO_WriteStrToFile(ARC_String *path, ARC_String **data), could not write file data");
|
||||
ARC_DEBUG_LOG_ERROR("ARC_IO_WriteStrToFile(ARC_String *path, ARC_String **data), could not write file data");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue