Wiki Page Content

Differences between revisions 2 and 3
Revision 2 as of 2010-08-22 20:17:14
Size: 1398
Editor: SheenaSmith
Comment: update content (from Sam)
Revision 3 as of 2010-09-22 22:43:29
Size: 1471
Editor: SheenaSmith
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*.

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

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