Path: blob/master/waterbox/libc/functions/stdio/_PDCLIB_seek.c
2 views
/* int64_t _PDCLIB_seek( FILE *, int64_t, int )12This file is part of the Public Domain C Library (PDCLib).3Permission is granted to use, modify, and / or redistribute at will.4*/56#include <stdio.h>7#include <stdint.h>8#include <errno.h>9#ifndef REGTEST10#include "_PDCLIB_io.h"1112int_fast64_t _PDCLIB_seek( FILE * stream,13int_fast64_t offset,14int whence )15{16int_fast64_t newPos;17if(!stream->ops->seek(stream->handle, offset, whence, &newPos)) {18return EOF;19}2021stream->ungetidx = 0;22stream->bufidx = 0;23stream->bufend = 0;24stream->pos.offset = newPos;25return newPos;26}2728#endif2930#ifdef TEST31#include "_PDCLIB_test.h"3233int main( void )34{35/* Testing covered by ftell.c */36return TEST_RESULTS;37}3839#endif40414243