|
⇤ ← Revision 1 as of 2010-07-15 20:51:01
Size: 1474
Comment: create page, add content (Wed Mar 10 ver; changeset 4428)
|
Size: 1398
Comment: update content (from Sam)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| Use this function (macro) to *call the close function in an SDL_RWops structure.* | Use this function to close and free an allocated SDL_RWops structure ''-or-'' *call the close function in an SDL_RWops structure*. |
| Line 12: | Line 12: |
| SDL_RWclose(ctx) | int SDL_RWclose(struct SDL_RWops* context) |
| Line 15: | Line 15: |
| <<Color2(green,Should there be anything to indicate a RV at the beginning of the syntax? Should the following be included in the syntax section?)>> (ctx)->close(ctx) |
|
| Line 19: | Line 16: |
| ||'''ctx'''||*a pointer to an SDL_RWops structure*|| | ||'''context'''||a pointer to an SDL_RWops structure|| |
| Line 22: | Line 19: |
| *Returns 0 on success, -1 on error*; call [[SDL_GetError]]() for more information. | Returns 0 if successful or -1 on write error when flushing data; call [[SDL_GetError]]() for more information. |
| Line 47: | Line 44: |
| *,,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.* | *<<BR>>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.<<BR>>* |
| Line 50: | Line 47: |
| .[[SDL_RWFromFile]] *??? .[[SDL_RWread]] (Macro) *??? .[[SDL_RWseek]](Macro) *??? .[[SDL_RWwrite]] (Macro) *??? |
.[[SDL_RWFromFile]] * .[[SDL_RWread]] (Macro) * .[[SDL_RWseek]](Macro) * .[[SDL_RWwrite]] (Macro) * |
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 if successful or -1 on write error when flushing data; call SDL_GetError() for more information.
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
