This commit is contained in:
twinaphex 2017-12-17 02:29:51 +01:00
parent 36d33b2334
commit c11a85405c
2 changed files with 0 additions and 28 deletions

View File

@ -112,29 +112,3 @@ int file_seek(struct MDFNFILE *file, int64_t offset, int whence)
return 0;
}
char *file_fgets(struct MDFNFILE *file, char *s, int len)
{
int pos = 0;
if (!len)
return(NULL);
if (file->location >= len)
return(NULL);
while(pos < (len - 1) && file->location < len)
{
int v = file->data[file->location];
s[pos] = v;
file->location++;
pos++;
if (v == '\n')
break;
}
if (len)
s[pos] = 0;
return s;
}

View File

@ -27,8 +27,6 @@ uint64_t file_read(struct MDFNFILE *file, void *ptr,
int file_seek(struct MDFNFILE *file, int64_t offset, int whence);
char *file_fgets(struct MDFNFILE *file, char *s, int buffer_size);
#ifdef __cplusplus
}
#endif