|
Size: 1543
Comment: update content
|
Size: 2249
Comment: update content (from Sam)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| Use this function ^(macro)^ 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 stream*. |
| Line 12: | Line 12: |
| SDL_RWtell(ctx) | long SDL_RWtell(struct SDL_RWops* context) |
| Line 15: | Line 15: |
| <<Color2(green,Should there be anything to indicate a RV at the beginning of the syntax? Should the following be included in the syntax section?)>> {{{(ctx)->seek(ctx, 0, RW_SEEK_CUR)}}} |
<<Color2(green,Begin comment that requires commas and therefore can't easily be in 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.)<<BR>><<Color2(green,End comment.)>> |
| Line 20: | Line 19: |
| ||'''ctx'''||*a pointer to an SDL_RWops structure*|| | ||'''context'''||a pointer to an SDL_RWops structure|| |
| Line 49: | Line 48: |
| ,,Note: ,,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. | *<<BR>>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.<<BR>>* <<Color2(purple,[[SDL_RWtell]] calls the seek function in the SDL_RWops struct which uses the specified '''context''' pointer)>><<Color2(purple, ,, an '''offset''' of 0)>><<Color2(purple,, , and a '''whence''' of RW_SEEK_CUR to find the current location in the data.)>> |
| Line 52: | Line 53: |
| .[[SDL_RWclose]] (Macro) *??? .[[SDL_RWFromFile]] *??? .[[SDL_RWread]] (Macro) *??? .[[SDL_RWseek]](Macro) *??? .[[SDL_RWwrite]] (Macro) *??? |
.[[SDL_RWclose]] (Macro) * .[[SDL_RWFromFile]] * .[[SDL_RWread]] (Macro) * .[[SDL_RWseek]](Macro) * .[[SDL_RWwrite]] (Macro) * |
DRAFT |
SDL_RWtell
Use this function to *perform a do-nothing seek to get the current offset in an SDL_RWops 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 pointer to an SDL_RWops structure |
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
Related Functions
SDL_RWclose (Macro) *
SDL_RWread (Macro) *
SDL_RWseek(Macro) *
SDL_RWwrite (Macro) *
green
