Wiki Page Content

Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2010-07-15 20:51:01
Size: 1474
Editor: SheenaSmith
Comment: create page, add content (Wed Mar 10 ver; changeset 4428)
Revision 4 as of 2010-10-13 18:16:14
Size: 1468
Editor: SheenaSmith
Comment: update content - pointers, structs
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'''||the SDL_RWops structure to close||
Line 22: Line 19:
*Returns 0 on success, -1 on error*; 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.)>>
Line 47: Line 46:
*,,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 49:
 .[[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*.

Syntax

int SDL_RWclose(struct SDL_RWops* context)

Function Parameters

context

the SDL_RWops structure 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.
*

green


CategoryAPI, CategoryIO

None: SDL_RWclose (last edited 2015-06-20 19:55:24 by PhilippWiesemann)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit