47 if (whence == SEEK_CUR) {
50 else if (whence == SEEK_SET) {
53 else if (whence == SEEK_END) {
54 new_pos = mem->
length + offset;
60 if (new_pos < 0 || new_pos > mem->
length) {
77 mem->
data =
static_cast<const char *
>(
data);
119 if (mmap ==
nullptr) {
File and directory operations.
Wrapper for reading from various sources (e.g. raw files, compressed files, memory....
Read Blender memory allocation and freeing.
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
static void memory_close_mmap(FileReader *reader)
FileReader * BLI_filereader_new_mmap(int filedes) ATTR_WARN_UNUSED_RESULT
size_t BLI_mmap_get_length(const BLI_mmap_file *file) ATTR_WARN_UNUSED_RESULT
BLI_mmap_file * BLI_mmap_open(int fd) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
static void memory_close_raw(FileReader *reader)
void BLI_mmap_free(BLI_mmap_file *file) ATTR_NONNULL(1)
FileReader * BLI_filereader_new_memory(const void *data, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static off64_t memory_seek(FileReader *reader, off64_t offset, int whence)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
BMesh const char void * data
bool BLI_mmap_read(BLI_mmap_file *file, void *dest, size_t offset, size_t length) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static int64_t memory_read_mmap(FileReader *reader, void *buffer, size_t size)
static int64_t memory_read_raw(FileReader *reader, void *buffer, size_t size)