home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
ramfs102.zip
/
src
/
chgfilep.c
< prev
next >
Wrap
C/C++ Source or Header
|
2002-09-28
|
1KB
|
56 lines
#include "includes.h"
APIRET EXPENTRY FS_CHGFILEPTR (
struct sffsi *psffsi,
struct sffsd *psffsd, /* not used in retail */
LONG offset,
USHORT type,
USHORT IOflag ) /* not used */
{
int rc;
UtilEnterRamfs();
DEBUG_PRINTF3 ("FS_CHGFILEPTR sfn=%d, offset=%ld, type=%d",
psffsi->sfi_selfsfn, offset, type);
#ifdef DEBUG
{
FBLOCK fblkFile;
VMRead (&fblkFile, psffsd->pOpenfile->flatEntry + FIELDOFFSET(DIRENTRY,fblkFile), sizeof(FBLOCK));
if (fblkFile.fSize != psffsi->sfi_size)
{
debugging = TRUE;
DEBUG_PRINTF2 ("\r\n!!! fblkFile.cbSize = %lu, sfi_size = %lu\r\n",
fblkFile.fSize, psffsi->sfi_size);
INT3;
}
}
#endif
switch (type)
{
case 0: /* relative to beginning of file */
psffsi->sfi_position = offset;
break;
case 1: /* relative to current position */
psffsi->sfi_position += offset;
break;
case 2: /* relative to end of file */
psffsi->sfi_position = psffsi->sfi_size + offset;
break;
}
rc = NO_ERROR;
DEBUG_PRINTF1 (" => %d\r\n", rc);
UtilExitRamfs();
return rc;
}