Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2010-10-13 19:38:44
Size: 2274
Editor: SheenaSmith
Comment: update content - pointers, structs
Revision 6 as of 2011-01-12 00:11:27
Size: 2272
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 *perform a do-nothing seek to get the current offset in an SDL_RWops stream*. Use this function to *perform a do-nothing seek to get the current offset in an SDL_RWops ^data^ stream*.
Line 18: Line 18:
||'''context'''||an SDL_RWops structure ^containing the tell function???^|| ||'''context'''||^a data stream containing the tell function???^||

DRAFT

SDL_RWtell

Use this function to *perform a do-nothing seek to get the current offset in an SDL_RWops data stream*.

Syntax

long SDL_RWtell(struct SDL_RWops* context)

green


The old wiki says this has only 1 param - ctx - but both the old wiki and header also list the following (ctx)->seek(ctx, 0, RW_SEEK_CUR) which appears to specify 3 params. Does the SDL_RWtell macro call the seek function of the SDL_RWops struct then uses the given context + an offset of 0 + whence of RW_SEEK_CUR as the settings to find the current location in the data? I don't know how to properly represent that here. See purple below for my attempt.)
green

Function Parameters

context

a data stream containing the tell function???

Return Value

*Returns the current offset in the stream.*

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);
  }

  SDL_RWseek(rw,0,RW_SEEK_END);
  fprintf(stderr,"Final position in test.bin: %d\n",SDL_RWtell(rw));
  SDL_RWclose(rw);
  return(0);
}

*

Remarks

*
This is not a built-in function. This is a macro that calls whatever seek function that happens to be pointed to in an SDL_RWops structure.
*

purple

purple

purple

green


CategoryAPI, CategoryIO

None: SDL_RWtell (last edited 2015-06-20 19:57:52 by PhilippWiesemann)

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