|
Size: 1398
Comment: update content (from Sam)
|
Size: 1471
Comment: update content - standard return value
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 19: | Line 19: |
| Returns 0 if successful or -1 on write error when flushing data; call [[SDL_GetError]]() for more information. | Returns 0 on success or a negative error code on failure; call [[SDL_GetError]]() for more information. <<Color2(purple,If a write error occurs when flushing data it returns -1.)>> |
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*.
Contents
Syntax
int SDL_RWclose(struct SDL_RWops* context)
Function Parameters
context |
a pointer to an SDL_RWops structure |
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
