瀏覽代碼

Make SaveFile* callbacks return a boolean (#1697)

pull/1707/head
Rob Loach 3 年之前
committed by GitHub
父節點
當前提交
d58b7b509e
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 4 行新增6 行删除
  1. +2
    -2
      src/raylib.h
  2. +2
    -4
      src/utils.c

+ 2
- 2
src/raylib.h 查看文件

@ -880,9 +880,9 @@ typedef enum {
// WARNING: This callbacks are intended for advance users
typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages
typedef unsigned char* (*LoadFileDataCallback)(const char* fileName, unsigned int* bytesRead); // FileIO: Load binary data
typedef void (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data
typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data
typedef char *(*LoadFileTextCallback)(const char* fileName); // FileIO: Load text data
typedef void (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
#if defined(__cplusplus)

+ 2
- 4
src/utils.c 查看文件

@ -245,8 +245,7 @@ bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite)
{
if (saveFileData)
{
saveFileData(fileName, data, bytesToWrite);
return success;
return saveFileData(fileName, data, bytesToWrite);
}
#if defined(SUPPORT_STANDARD_FILEIO)
FILE *file = fopen(fileName, "wb");
@ -340,8 +339,7 @@ bool SaveFileText(const char *fileName, char *text)
{
if (saveFileText)
{
saveFileText(fileName, text);
return success;
return saveFileText(fileName, text);
}
#if defined(SUPPORT_STANDARD_FILEIO)
FILE *file = fopen(fileName, "wt");

Loading…
取消
儲存