Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2011-01-13 02:00:24
Size: 1614
Editor: SheenaSmith
Comment: update content - RWops stream
Revision 6 as of 2013-06-15 16:19:22
Size: 1636
Comment: Changed signature to match SDL_main.h.
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
int main() int main(int argc, char *argv[])

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(int argc, char *argv[])
{
  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