libc: Implement fseeko() and ftello()
This commit is contained in:
parent
759c8a8cab
commit
a4eed362b6
@ -63,12 +63,18 @@ extern "C"
|
|||||||
/* Moves stream's read/write offset by offset, depending on whence. */
|
/* Moves stream's read/write offset by offset, depending on whence. */
|
||||||
int fseek(FILE* stream, long offset, int whence);
|
int fseek(FILE* stream, long offset, int whence);
|
||||||
|
|
||||||
|
/* Moves stream's read/write offset by offset, depending on whence. */
|
||||||
|
int fseeko(FILE* stream, off_t offset, int whence);
|
||||||
|
|
||||||
/* Moves stream's read/write offset to the offset stored in the pos structure. */
|
/* Moves stream's read/write offset to the offset stored in the pos structure. */
|
||||||
int fsetpos(FILE* stream, const fpos_t* pos);
|
int fsetpos(FILE* stream, const fpos_t* pos);
|
||||||
|
|
||||||
/* Returns the current offset for stream. */
|
/* Returns the current offset for stream. */
|
||||||
long ftell(FILE* stream);
|
long ftell(FILE* stream);
|
||||||
|
|
||||||
|
/* Returns the current offset for stream. */
|
||||||
|
off_t ftello(FILE* stream);
|
||||||
|
|
||||||
/* Stores the current offset for stream in the pos structure. */
|
/* Stores the current offset for stream in the pos structure. */
|
||||||
int fgetpos(FILE* stream, fpos_t* pos);
|
int fgetpos(FILE* stream, fpos_t* pos);
|
||||||
|
|
||||||
|
@ -192,6 +192,11 @@ extern "C"
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int fseeko(FILE* stream, off_t offset, int whence)
|
||||||
|
{
|
||||||
|
return fseek(stream, offset, whence);
|
||||||
|
}
|
||||||
|
|
||||||
int fsetpos(FILE* stream, const fpos_t* pos)
|
int fsetpos(FILE* stream, const fpos_t* pos)
|
||||||
{
|
{
|
||||||
return fseek(stream, *pos, SEEK_SET);
|
return fseek(stream, *pos, SEEK_SET);
|
||||||
@ -204,6 +209,11 @@ extern "C"
|
|||||||
// maybe? We'd have to update this value in fread() and fwrite() as well...
|
// maybe? We'd have to update this value in fread() and fwrite() as well...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
off_t ftello(FILE* stream)
|
||||||
|
{
|
||||||
|
return ftell(stream);
|
||||||
|
}
|
||||||
|
|
||||||
int fgetpos(FILE* stream, fpos_t* pos)
|
int fgetpos(FILE* stream, fpos_t* pos)
|
||||||
{
|
{
|
||||||
long result = ftell(stream);
|
long result = ftell(stream);
|
||||||
|
Loading…
Reference in New Issue
Block a user