63 if (sc->is_identical) {
71 if (!fc->is_identical) {
76 fc->is_identical =
true;
92 chunk->is_identical_future =
false;
109 if (reference_memfile !=
NULL) {
115 current_session_uuid = mem_chunk->id_session_uuid;
154 if (*compchunk_step !=
NULL) {
156 if (compchunk->
size == curchunk->
size) {
157 if (memcmp(compchunk->
buf, buf,
size) == 0) {
158 curchunk->
buf = compchunk->
buf;
163 *compchunk_step = compchunk->
next;
169 memcpy(buf_new, buf,
size);
170 curchunk->
buf = buf_new;
177 struct Scene **r_scene)
187 bmain_undo = bfd->
main;
216 # warning "Symbolic links will be followed on undo save, possibly causing CVE-2008-1103"
223 "Unable to save '%s': %s\n",
225 errno ? strerror(errno) :
"Unknown error opening file");
244 "Unable to save '%s': %s\n",
246 errno ? strerror(errno) :
"Unknown error writing file");
259 size_t chunkoffset, readsize, totread;
294 printf(
"illegal read, chunk zero\n");
298 chunkoffset = seek -
offset;
299 readsize =
size - totread;
304 if (chunkoffset + readsize > chunk->
size) {
305 readsize = chunk->
size - chunkoffset;
319 }
while (totread <
size);
#define MAIN_ID_SESSION_UUID_UNSET
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
#define BLI_assert_unreachable()
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
unsigned int BLI_ghashutil_ptrhash(const void *key)
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghashutil_inthash_p_simple(const void *ptr)
bool BLI_ghashutil_intcmp(const void *a, const void *b)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
bool BLI_ghashutil_ptrcmp(const void *a, const void *b)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
#define POINTER_FROM_UINT(i)
#define POINTER_OFFSET(v, ofs)
external readfile function prototypes.
BlendFileData * BLO_read_from_memfile(struct Main *oldmain, const char *filepath, struct MemFile *memfile, const struct BlendFileReadParams *params, struct ReportList *reports)
These structs are the foundation for all linked lists in the library system.
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMFlagLayer * oflags
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
ccl_global float * buffer
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
MemFile * reference_memfile
MemFile * written_memfile
struct GHash * id_session_uuid_mapping
MemFileChunk * reference_current_chunk
uint current_id_session_uuid
static ssize_t undo_read(FileReader *reader, void *buffer, size_t size)
static void undo_close(FileReader *reader)
FileReader * BLO_memfile_new_filereader(MemFile *memfile, int undo_direction)
void BLO_memfile_chunk_add(MemFileWriteData *mem_data, const char *buf, size_t size)
void BLO_memfile_write_init(MemFileWriteData *mem_data, MemFile *written_memfile, MemFile *reference_memfile)
bool BLO_memfile_write_file(struct MemFile *memfile, const char *filepath)
struct Main * BLO_memfile_main_get(struct MemFile *memfile, struct Main *bmain, struct Scene **r_scene)
void BLO_memfile_clear_future(MemFile *memfile)
void BLO_memfile_free(MemFile *memfile)
void BLO_memfile_merge(MemFile *first, MemFile *second)
void BLO_memfile_write_finalize(MemFileWriteData *mem_data)