X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2F_PDCLIB_seek.c;h=5d88a15cb9adb28ad083628eb029052a0f87929d;hp=f8dac3033704b3de365298ecba9f44904301913d;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/functions/stdio/_PDCLIB_seek.c b/functions/stdio/_PDCLIB_seek.c index f8dac30..5d88a15 100644 --- a/functions/stdio/_PDCLIB_seek.c +++ b/functions/stdio/_PDCLIB_seek.c @@ -1,41 +1,41 @@ -/* int64_t _PDCLIB_seek( FILE *, int64_t, int ) - - This file is part of the Public Domain C Library (PDCLib). - Permission is granted to use, modify, and / or redistribute at will. -*/ - -#include -#include -#include -#ifndef REGTEST -#include "_PDCLIB_io.h" - -int_fast64_t _PDCLIB_seek( FILE * stream, - int_fast64_t offset, - int whence ) -{ - int_fast64_t newPos; - if(!stream->ops->seek(stream->handle, offset, whence, &newPos)) { - return EOF; - } - - stream->ungetidx = 0; - stream->bufidx = 0; - stream->bufend = 0; - stream->pos.offset = newPos; - return newPos; -} - -#endif - -#ifdef TEST -#include "_PDCLIB_test.h" - -int main( void ) -{ - /* Testing covered by ftell.c */ - return TEST_RESULTS; -} - -#endif - +/* int64_t _PDCLIB_seek( FILE *, int64_t, int ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#include +#include +#ifndef REGTEST +#include "_PDCLIB_io.h" + +int_fast64_t _PDCLIB_seek( FILE * stream, + int_fast64_t offset, + int whence ) +{ + int_fast64_t newPos; + if(!stream->ops->seek(stream->handle, offset, whence, &newPos)) { + return EOF; + } + + stream->ungetidx = 0; + stream->bufidx = 0; + stream->bufend = 0; + stream->pos.offset = newPos; + return newPos; +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + /* Testing covered by ftell.c */ + return TEST_RESULTS; +} + +#endif +