DRAFT |
SDL_RWclose
Use this function to close and free an allocated SDL_RWops structure -or- *call the close function in an SDL_RWops structure*. green
Contents
Syntax
int SDL_RWclose(struct SDL_RWops* context)
Function Parameters
context |
the SDL_RWops structure data stream to close |
Return Value
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
purple
Code Examples
*
#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);
}
*
Remarks
*
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.
*
Related Functions
SDL_RWread (Macro) *
SDL_RWseek(Macro) *
SDL_RWwrite (Macro) *
green
