home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
FSETPOS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
447b
|
39 lines
/* from Dale Schumacher's dLibs */
#include <stdio.h>
#define ERROR -1
int fgetpos(fp, pos)
FILE *fp;
fpos_t *pos;
{
register long rv;
rv = ftell(fp);
if((rv >= 0) && pos)
{
*pos = rv;
return(0);
}
return(ERROR);
}
int fsetpos(fp, pos)
FILE *fp;
fpos_t *pos;
{
register long rv;
if(pos)
{
rv = fseek(fp, *pos, SEEK_SET);
if(rv >= 0)
{
fp->_flag &= ~(_IOEOF|_IOERR);
return(0);
}
}
return(ERROR);
}