Skip to content

Commit d23277f

Browse files
committed
Updates
1 parent 6a5818f commit d23277f

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

include/streams/interface_stream.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ void intfstream_rewind(intfstream_internal_t *intf);
9292

9393
int64_t intfstream_tell(intfstream_internal_t *intf);
9494

95+
int intfstream_eof(intfstream_internal_t *intf);
96+
9597
void intfstream_putc(intfstream_internal_t *intf, int c);
9698

9799
int intfstream_close(intfstream_internal_t *intf);
@@ -106,7 +108,7 @@ uint32_t intfstream_get_frame_size(intfstream_internal_t *intf);
106108

107109
bool intfstream_is_compressed(intfstream_internal_t *intf);
108110

109-
intfstream_t* intfstream_open_file(const char *path,
111+
intfstream_t *intfstream_open_file(const char *path,
110112
unsigned mode, unsigned hints);
111113

112114
intfstream_t *intfstream_open_memory(void *data,
@@ -118,7 +120,7 @@ intfstream_t *intfstream_open_writable_memory(void *data,
118120
intfstream_t *intfstream_open_chd_track(const char *path,
119121
unsigned mode, unsigned hints, int32_t track);
120122

121-
intfstream_t* intfstream_open_rzip_file(const char *path,
123+
intfstream_t *intfstream_open_rzip_file(const char *path,
122124
unsigned mode);
123125

124126
RETRO_END_DECLS

streams/interface_stream.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,34 @@ int64_t intfstream_tell(intfstream_internal_t *intf)
490490
return -1;
491491
}
492492

493+
int intfstream_eof(intfstream_internal_t *intf)
494+
{
495+
if (!intf)
496+
return -1;
497+
498+
switch (intf->type)
499+
{
500+
case INTFSTREAM_FILE:
501+
return filestream_eof(intf->file.fp);
502+
case INTFSTREAM_MEMORY:
503+
/* TODO: Add this functionality to
504+
* memory_stream interface */
505+
break;
506+
case INTFSTREAM_CHD:
507+
/* TODO: Add this functionality to
508+
* chd_stream interface */
509+
break;
510+
case INTFSTREAM_RZIP:
511+
#if defined(HAVE_ZLIB)
512+
return rzipstream_eof(intf->rzip.fp);
513+
#else
514+
break;
515+
#endif
516+
}
517+
518+
return -1;
519+
}
520+
493521
void intfstream_rewind(intfstream_internal_t *intf)
494522
{
495523
switch (intf->type)

0 commit comments

Comments
 (0)