Wiki Page Content

Differences between revisions 3 and 5 (spanning 2 versions)
Revision 3 as of 2010-09-22 22:43:29
Size: 1471
Editor: SheenaSmith
Comment: update content - standard return value
Revision 5 as of 2011-01-13 02:00:24
Size: 1614
Editor: SheenaSmith
Comment: update content - RWops stream
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
Use this function to close and free an allocated SDL_RWops structure ''-or-'' *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*.  <<Color2(green,Should the wording here be changed to reflect the data stream concept as with other references to SDL_RWops?)>>
Line 16: Line 16:
||'''context'''||a pointer to an SDL_RWops structure|| ||'''context'''||the ,,SDL_RWops structure,, ^data stream^ to close||

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

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.
*

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