home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Mecomp Multimedia 2
/
MECOMP-CD-II.iso
/
amiga
/
programmieren
/
c
/
vbcc
/
machines
/
amiga68k
/
libsrc
/
stdio
/
fseek.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1997-12-30
|
389 b
|
18 lines
#include <stdio.h>
#include <proto/dos.h>
int fseek(FILE *f,long offset,int origin)
{
if(!f) return(1);
if(origin==SEEK_CUR){
if(f->flags&_READ) offset-=f->count;
/* if(f->flags&_WRITE) offset+=f->count;*/
}
if(f->flags&_WRITE) _flushbuf(f);
f->flags&=~(_READ|_WRITE|_EOF);
f->count=0;
Seek((BPTR)f->filehandle,offset,origin);
return(0);
}