Rename retro_fmemcpy_alloc to retro_read_file
This commit is contained in:
parent
3564532564
commit
32ddeb3f96
|
@ -701,7 +701,7 @@ int read_compressed_file(const char * path, void **buf,
|
||||||
* @length : Number of items read, -1 on error.
|
* @length : Number of items read, -1 on error.
|
||||||
*
|
*
|
||||||
* Read the contents of a file into @buf. Will call read_compressed_file
|
* Read the contents of a file into @buf. Will call read_compressed_file
|
||||||
* if path contains a compressed file, otherwise will call retro_fmemcpy_alloc.
|
* if path contains a compressed file, otherwise will call retro_read_file().
|
||||||
*
|
*
|
||||||
* Returns: 1 if file read, 0 on error.
|
* Returns: 1 if file read, 0 on error.
|
||||||
*/
|
*/
|
||||||
|
@ -714,7 +714,7 @@ int read_file(const char *path, void **buf, ssize_t *length)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return retro_fmemcpy_alloc(path, buf, length);
|
return retro_read_file(path, buf, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct string_list *compressed_file_list_new(const char *path,
|
struct string_list *compressed_file_list_new(const char *path,
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
/* File backends. Can be fleshed out later, but keep it simple for now.
|
/* File backends. Can be fleshed out later, but keep it simple for now.
|
||||||
* The file is mapped to memory directly (via mmap() or just
|
* The file is mapped to memory directly (via mmap() or just
|
||||||
* plain retro_fmemcpy_alloc()).
|
* plain retro_read_file()).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct zlib_file_backend
|
struct zlib_file_backend
|
||||||
|
@ -181,7 +181,7 @@ static void *zlib_file_open(const char *path)
|
||||||
if (!data)
|
if (!data)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
read_from_file = retro_fmemcpy_alloc(path, &data->data, &ret);
|
read_from_file = retro_read_file(path, &data->data, &ret);
|
||||||
|
|
||||||
if (!read_from_file || ret < 0)
|
if (!read_from_file || ret < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,7 +256,7 @@ bool retro_fmemcpy(const char *path, char *s, size_t len, ssize_t *bytes_written
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* retro_fmemcpy_alloc:
|
* retro_read_file:
|
||||||
* @path : path to file.
|
* @path : path to file.
|
||||||
* @buf : buffer to allocate and read the contents of the
|
* @buf : buffer to allocate and read the contents of the
|
||||||
* file into. Needs to be freed manually.
|
* file into. Needs to be freed manually.
|
||||||
|
@ -265,7 +265,7 @@ bool retro_fmemcpy(const char *path, char *s, size_t len, ssize_t *bytes_written
|
||||||
*
|
*
|
||||||
* Returns: number of items read, -1 on error.
|
* Returns: number of items read, -1 on error.
|
||||||
*/
|
*/
|
||||||
int retro_fmemcpy_alloc(const char *path, void **buf, ssize_t *len)
|
int retro_read_file(const char *path, void **buf, ssize_t *len)
|
||||||
{
|
{
|
||||||
ssize_t ret = 0;
|
ssize_t ret = 0;
|
||||||
ssize_t content_buf_size = 0;
|
ssize_t content_buf_size = 0;
|
||||||
|
|
|
@ -59,7 +59,7 @@ int retro_fclose(RFILE *stream);
|
||||||
|
|
||||||
bool retro_fmemcpy(const char *path, char *s, size_t len, ssize_t *bytes_written);
|
bool retro_fmemcpy(const char *path, char *s, size_t len, ssize_t *bytes_written);
|
||||||
|
|
||||||
int retro_fmemcpy_alloc(const char *path, void **buf, ssize_t *len);
|
int retro_read_file(const char *path, void **buf, ssize_t *len);
|
||||||
|
|
||||||
bool retro_write_file(const char *path, const void *data, ssize_t size);
|
bool retro_write_file(const char *path, const void *data, ssize_t size);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue