mirror of
https://git.code.sf.net/p/newrpl/sources
synced 2024-11-16 19:51:25 +01:00
33 lines
695 B
C
33 lines
695 B
C
/*
|
|
* Copyright (c) 2014-2015, Claudio Lapilli and the newRPL Team
|
|
* All rights reserved.
|
|
* This file is released under the 3-clause BSD license.
|
|
* See the file LICENSE.txt that shipped with this distribution.
|
|
*/
|
|
|
|
#include "fsyspriv.h"
|
|
|
|
#ifndef CONFIG_NO_FSYSTEM
|
|
|
|
// ASSUME SEEK_... CONSTANTS ARE DEFINED SOMEWHERE ELSE
|
|
// ACCEPTS SETTING OFFSET BEYOND END-OF-FILE
|
|
|
|
int FSSeek(FS_FILE * file, int Offset, int position)
|
|
{
|
|
int from;
|
|
from = 0;
|
|
if(position == FSSEEK_END)
|
|
from = file->FileSize;
|
|
if(position == FSSEEK_CUR)
|
|
from = file->CurrentOffset;
|
|
|
|
from += Offset;
|
|
|
|
if(from < 0)
|
|
from = 0;
|
|
file->CurrentOffset = from;
|
|
return FS_OK;
|
|
|
|
}
|
|
|
|
#endif
|