SDL_RWclose
Name
SDL_RWclose -- Macro that calls the close function in an SDL_RWops structure
Synopsis
#include "SDL_rwops.h" #define SDL_RWclose(ctx) (ctx)->close(ctx)
Description
SDL_RWclose calls the close function in an SDL_RWops structure. It only takes one parameter, a pointer to an SDL_RWops structure.
Return Value
Returns 0 on success, -1 on error.
Note: This is not a built-in function. This is a macro that calls whatever close function happens to be pointed to by an SDL_RWops structure.
Example
#include <stdio.h>
#include "SDL_rwops.h"
int main()
{
SDL_RWops *rw=SDL_RWFromFile("test.bin","r");
if(rw==NULL)
{
fprintf(stderr,"Couldn't open test.bin\n");
return(1);
}
fprintf(stderr,"Opened test.bin\n");
SDL_RWclose(rw);
fprintf(stderr,"Closed test.bin\n");
return(0);
}
