mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-06 19:46:06 +00:00
Create filestream_eof
This commit is contained in:
parent
d40eade52c
commit
a503db016e
@ -69,6 +69,8 @@ char *filestream_getline(RFILE *stream);
|
||||
|
||||
int filestream_getc(RFILE *stream);
|
||||
|
||||
int filestream_eof(RFILE *stream);
|
||||
|
||||
bool filestream_write_file(const char *path, const void *data, ssize_t size);
|
||||
|
||||
int filestream_putc(RFILE *stream, int c);
|
||||
|
@ -361,6 +361,18 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int filestream_eof(RFILE *stream)
|
||||
{
|
||||
ssize_t current_position = filestream_tell(stream);
|
||||
ssize_t end_position = filestream_seek(stream, 0, SEEK_END);
|
||||
|
||||
filestream_seek(stream, current_position, SEEK_SET);
|
||||
|
||||
if (current_position >= end_position)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t filestream_tell(RFILE *stream)
|
||||
{
|
||||
if (!stream)
|
||||
|
Loading…
x
Reference in New Issue
Block a user