[physfs] PHYSFS_seek is too simple

Tim Čas darkuranium at gmail.com
Tue Dec 4 05:32:56 EST 2012


...sigh...

Now I'm getting annoyed.

For the last time, look at the answer to the question on SO.com that you've
linked:
http://stackoverflow.com/questions/13437422/libvorbis-audio-decode-from-memory-in-c

...the function AR_seekOgg. See how he calculates the position according to
`type`?

On 4 December 2012 03:43, fy <fy0748 at gmail.com> wrote:

> **
> 在 Tue, 04 Dec 2012 02:44:21 +0800,Christoph Nelles <
> evilazrael at evilazrael.de> 写道:
>
>
> Hi,
>
> write your own small wrapper function with the third parameter which
> translates relative positions to absolute positions.   It is not so
> difficult, just a little bit of math (and physfs_tell). The worst is
> probably SEEK_END. If Physfs_uint64 is a problem for you, try a weak &
> dynamic typed language.
>
>
> Well, I made a mistake...
>
> 2882 /**
> 2883 * \brief Move i/o position to a given byte offset from start.
> 2884 *
> 2885 * This method moves the i/o position, so the next read/write will
> 2886 * be of the byte at (offset) offset. Seeks past the end of file should
> 2887 * be treated as an error condition.
> 2888 *
> 2889 * \param io The i/o instance to seek.
> 2890 * \param offset The new byte offset for the i/o position.
> 2891 * \return non-zero on success, zero on error.
> 2892 */
> 2893 int (*seek)(struct PHYSFS_Io *io, PHYSFS_uint64 offset);
>
> The PHYSFS_seek moves i/o position to a given byte offset from START,
> not CURRENET position.
>
>
> --
> 使用Opera的电子邮件客户端:http://www.opera.com/mail/
>
> _______________________________________________
> physfs mailing list
> physfs at icculus.org
> http://icculus.org/mailman/listinfo/physfs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20121204/dd4d7c21/attachment.htm>


More information about the physfs mailing list