Blender V5.3
BLI_mmap.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2020 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11#include "BLI_compiler_attrs.hh"
12#include "BLI_utildefines.hh"
13
14namespace blender {
15
16/* Memory-mapped file IO that implements all the OS-specific details and error handling. */
17
18struct BLI_mmap_file;
19
20/* Prepares an opened file for memory-mapped IO.
21 * May return NULL if the operation fails.
22 * Note that this seeks to the end of the file to determine its length. */
24
25/* Reads length bytes from file at the given offset into dest.
26 * Returns whether the operation was successful (may fail when reading beyond the file
27 * end or when IO errors occur). */
28bool BLI_mmap_read(BLI_mmap_file *file, void *dest, size_t offset, size_t length)
30
34
36
37} // namespace blender
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
Definition btVector3.h:257
BMesh Iterators.
size_t BLI_mmap_get_length(const BLI_mmap_file *file) ATTR_WARN_UNUSED_RESULT
Definition BLI_mmap.cc:484
BLI_mmap_file * BLI_mmap_open(int fd) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
Definition BLI_mmap.cc:369
void BLI_mmap_free(BLI_mmap_file *file) ATTR_NONNULL(1)
Definition BLI_mmap.cc:494
bool BLI_mmap_any_io_error(const BLI_mmap_file *file) ATTR_WARN_UNUSED_RESULT
Definition BLI_mmap.cc:489
bool BLI_mmap_read(BLI_mmap_file *file, void *dest, size_t offset, size_t length) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition BLI_mmap.cc:466
void * BLI_mmap_get_pointer(BLI_mmap_file *file) ATTR_WARN_UNUSED_RESULT
Definition BLI_mmap.cc:479
bool ATTR_WARN_UNUSED_RESULT
void ATTR_NONNULL(1, 2)
char ATTR_MALLOC
Definition BLI_string.hh:79