Blender  V2.93
BLO_undofile.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2004 Blender Foundation.
17  * All rights reserved.
18  * external writefile function prototypes
19  */
20 
21 #pragma once
22 
27 struct GHash;
28 struct Scene;
29 
30 typedef struct {
31  void *next, *prev;
32  const char *buf;
34  size_t size;
44 } MemFileChunk;
45 
46 typedef struct MemFile {
48  size_t size;
50 
51 typedef struct MemFileWriteData {
54 
57 
61 
62 typedef struct MemFileUndoData {
63  char filename[1024]; /* FILE_MAX */
65  size_t undo_size;
67 
68 /* actually only used writefile.c */
69 
71  MemFile *written_memfile,
72  MemFile *reference_memfile);
74 
75 void BLO_memfile_chunk_add(MemFileWriteData *mem_data, const char *buf, size_t size);
76 
77 /* exports */
78 extern void BLO_memfile_free(MemFile *memfile);
79 extern void BLO_memfile_merge(MemFile *first, MemFile *second);
80 extern void BLO_memfile_clear_future(MemFile *memfile);
81 
82 /* utilities */
83 extern struct Main *BLO_memfile_main_get(struct MemFile *memfile,
84  struct Main *bmain,
85  struct Scene **r_scene);
86 extern bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename);
unsigned int uint
Definition: BLI_sys_types.h:83
void BLO_memfile_chunk_add(MemFileWriteData *mem_data, const char *buf, size_t size)
Definition: undofile.c:157
void BLO_memfile_write_init(MemFileWriteData *mem_data, MemFile *written_memfile, MemFile *reference_memfile)
Definition: undofile.c:116
struct Main * BLO_memfile_main_get(struct MemFile *memfile, struct Main *bmain, struct Scene **r_scene)
Definition: undofile.c:195
struct MemFileWriteData MemFileWriteData
void BLO_memfile_clear_future(MemFile *memfile)
Definition: undofile.c:109
struct MemFileUndoData MemFileUndoData
void BLO_memfile_free(MemFile *memfile)
Definition: undofile.c:58
struct MemFile MemFile
bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename)
Definition: undofile.c:223
void BLO_memfile_merge(MemFile *first, MemFile *second)
Definition: undofile.c:73
void BLO_memfile_write_finalize(MemFileWriteData *mem_data)
Definition: undofile.c:150
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Definition: BKE_main.h:116
bool is_identical_future
Definition: BLO_undofile.h:40
uint id_session_uuid
Definition: BLO_undofile.h:43
bool is_identical
Definition: BLO_undofile.h:36
const char * buf
Definition: BLO_undofile.h:32
char filename[1024]
Definition: BLO_undofile.h:63
MemFile * reference_memfile
Definition: BLO_undofile.h:53
MemFile * written_memfile
Definition: BLO_undofile.h:52
struct GHash * id_session_uuid_mapping
Definition: BLO_undofile.h:59
MemFileChunk * reference_current_chunk
Definition: BLO_undofile.h:56
uint current_id_session_uuid
Definition: BLO_undofile.h:55
ListBase chunks
Definition: BLO_undofile.h:47
size_t size
Definition: BLO_undofile.h:48