mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-24 08:15:50 +00:00
rwops: Add SDL_GetRWStatus, make the statuses into an enum.
This commit is contained in:
@@ -978,6 +978,7 @@ SDL3_0.0.0 {
|
||||
SDL_ShowOpenFolderDialog;
|
||||
SDL_OpenRW;
|
||||
SDL_CloseRW;
|
||||
SDL_GetRWStatus;
|
||||
# extra symbols go here (don't modify this line)
|
||||
local: *;
|
||||
};
|
||||
|
||||
@@ -1003,3 +1003,4 @@
|
||||
#define SDL_ShowOpenFolderDialog SDL_ShowOpenFolderDialog_REAL
|
||||
#define SDL_OpenRW SDL_OpenRW_REAL
|
||||
#define SDL_CloseRW SDL_CloseRW_REAL
|
||||
#define SDL_GetRWStatus SDL_GetRWStatus_REAL
|
||||
|
||||
@@ -1028,3 +1028,4 @@ SDL_DYNAPI_PROC(void,SDL_ShowSaveFileDialog,(SDL_DialogFileCallback a, void *b,
|
||||
SDL_DYNAPI_PROC(void,SDL_ShowOpenFolderDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const char *d, int e),(a,b,c,d,e),)
|
||||
SDL_DYNAPI_PROC(SDL_RWops*,SDL_OpenRW,(const SDL_RWopsInterface *a, void *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_CloseRW,(SDL_RWops *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_RWopsStatus,SDL_GetRWStatus,(SDL_RWops *a),(a),return)
|
||||
|
||||
@@ -40,7 +40,7 @@ struct SDL_RWops
|
||||
{
|
||||
SDL_RWopsInterface iface;
|
||||
void *userdata;
|
||||
Uint32 status;
|
||||
SDL_RWopsStatus status;
|
||||
SDL_PropertiesID props;
|
||||
};
|
||||
|
||||
@@ -724,6 +724,16 @@ SDL_RWops *SDL_RWFromConstMem(const void *mem, size_t size)
|
||||
return rwops;
|
||||
}
|
||||
|
||||
SDL_RWopsStatus SDL_GetRWStatus(SDL_RWops *context)
|
||||
{
|
||||
if (!context) {
|
||||
SDL_InvalidParamError("context");
|
||||
return SDL_RWOPS_STATUS_ERROR;
|
||||
}
|
||||
return context->status;
|
||||
}
|
||||
|
||||
|
||||
SDL_RWops *SDL_OpenRW(const SDL_RWopsInterface *iface, void *userdata)
|
||||
{
|
||||
if (!iface) {
|
||||
|
||||
Reference in New Issue
Block a user