Wiki Page Content

Differences between revisions 6 and 7
Revision 6 as of 2011-01-12 00:11:27
Size: 2272
Editor: SheenaSmith
Comment: update content - RWops stream
Revision 7 as of 2011-12-13 00:08:56
Size: 2248
Editor: SheenaSmith
Comment: some sans-Sam editing (shift green to comment); camelcase
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
#pragma disable-camelcase
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT||
#pragma camelcase off
||<tablewidth="100%"style="color:#FF0000; ;text-align:center">DRAFT ||
Line 6: Line 7:
Use this function to *perform a do-nothing seek to get the current offset in an SDL_RWops ^data^ stream*. Use this function to perform a do-nothing seek to get the current offset in an SDL_RWops data stream.
Line 15: Line 16:
<<Color2(green,Begin comment that requires commas and therefore can't easily be in green:)>><<BR>>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.)<<BR>><<Color2(green,End comment.)>> {{{{#!wiki comment
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 use 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.
}}}}
Line 18: Line 21:
||'''context'''||^a data stream containing the tell function???^|| ||'''context''' ||a data stream containing the tell function ??? ||
Line 21: Line 24:
*Returns the ^current^ offset in the stream.* *Returns the current offset in the stream.*
Line 25: Line 28:
Line 49: Line 53:
{{{#!wiki comment
Line 50: Line 55:
}}}
== Related Functions ==
 . [[SDL_RWclose]] (Macro) *
 . [[SDL_RWFromFile]] *
 . [[SDL_RWread]] (Macro) *
 . [[SDL_RWseek]](Macro) *
 . [[SDL_RWwrite]] (Macro) *
Line 51: Line 63:
== Related Functions ==
 .[[SDL_RWclose]] (Macro) *
 .[[SDL_RWFromFile]] *
 .[[SDL_RWread]] (Macro) *
 .[[SDL_RWseek]](Macro) *
 .[[SDL_RWwrite]] (Macro) *

<<Color2(green,Should the current read and write functions (not macros) be listed?)>>
{{{#!wiki comment
Should the current read and write functions (not macros) be listed? Should macros be identified as macros here?
}}}

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)

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


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