xp_comm_proj/rd_dicom/Papyrus3/PapyFileSystemUnix3.c
/********************************************************************************/
/*									 	*/
/*	Papy3FSeek : Papyrus own build file pointer positioning function.	*/
/*	return : standard error message						*/
/*										*/
/********************************************************************************/
Papy3FSeek : Papyrus own build file pointer positioning function.
return : standard error message
Papy3FSeek : Papyrus own build file pointer positioning function . return : standard error message
int
Papy3FSeek (PAPY_FILE inFp, int inPosMode, PapyLong inOffset)
{
  PapyLong startPos, fileLimit;
  long     err;
  if (inOffset > 100000L) 
  {
    startPos = (PapyLong) ftell (inFp);
    err = fseek (inFp, 0L, (int) SEEK_END);
    fileLimit = (PapyLong) ftell (inFp);
    if (inOffset > fileLimit) return -1;  
    err = fseek (inFp, (long) startPos, (int) SEEK_SET);
  }
  err = fseek (inFp, (long) inOffset, inPosMode);
  return err;
}
int Papy3FSeek ( PAPY_FILE inFp , int inPosMode , PapyLong inOffset ) { PapyLong startPos , fileLimit ; long err ; if ( inOffset > 100000L ) { startPos = ( PapyLong ) ftell ( inFp ) ; err = fseek ( inFp , 0L , ( int ) SEEK_END ) ; fileLimit = ( PapyLong ) ftell ( inFp ) ; if ( inOffset > fileLimit ) return -1 ; err = fseek ( inFp , ( long ) startPos , ( int ) SEEK_SET ) ; } err = fseek ( inFp , ( long ) inOffset , inPosMode ) ; return err ; }
Papy3FSeek : Papyrus own build file pointer positioning function.
Papy3FSeek : Papyrus own build file pointer positioning function .
/* get the end of file */