4 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version. The Blender
10 * Foundation also sells licenses for use in proprietary software under
11 * the Blender License. See http://www.blender.org/BL/ for information
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 * All rights reserved.
26 * The Original Code is: all of this file.
28 * Contributor(s): none yet.
30 * ***** END GPL/BL DUAL LICENSE BLOCK *****
31 * blenloader readfile private function prototypes
41 typedef struct FileData {
42 // linked list of BHeadN's
48 int (*read)(struct FileData *filedata, void *buffer, int size);
50 // variables needed for reading from memory / stream
52 // variables needed for reading from memfile (undo)
53 struct MemFile *memfile;
55 // variables needed for reading from file
59 // now only in use for library appending
60 char filename[FILE_MAXDIR+FILE_MAXFILE];
62 // variables needed for reading from stream
66 // general reading variables
67 struct SDNA *filesdna;
73 struct OldNewMap *datamap;
74 struct OldNewMap *globmap;
75 struct OldNewMap *libmap;
76 struct OldNewMap *imamap;
80 /* ick ick, used to return
81 * data through streamglue.
83 BlendFileData **bfd_r;
84 BlendReadError *error_r;
87 typedef struct BHeadN {
88 struct BHeadN *next, *prev;
93 #define FD_FLAGS_SWITCH_ENDIAN (1<<0)
94 #define FD_FLAGS_FILE_POINTSIZE_IS_4 (1<<1)
95 #define FD_FLAGS_POINTSIZE_DIFFERS (1<<2)
96 #define FD_FLAGS_FILE_OK (1<<3)
97 #define FD_FLAGS_NOT_MY_BUFFER (1<<4)
98 #define FD_FLAGS_NOT_MY_LIBMAP (1<<5)
100 #define SIZEOFBLENDERHEADER 12
104 void blo_join_main(ListBase *mainlist);
105 void blo_split_main(ListBase *mainlist, struct Main *main);
107 BlendFileData *blo_read_file_internal( FileData *fd, BlendReadError *error_r);
109 FileData *blo_openblenderfile( char *name, BlendReadError *error_r);
110 FileData *blo_openblendermemory( void *buffer, int buffersize, BlendReadError *error_r);
111 FileData *blo_openblendermemfile(struct MemFile *memfile, BlendReadError *error_r);
113 void blo_make_image_pointer_map(FileData *fd);
114 void blo_end_image_pointer_map(FileData *fd);
115 void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd);
117 void blo_freefiledata( FileData *fd);
119 BHead *blo_firstbhead(FileData *fd);
120 BHead *blo_nextbhead(FileData *fd, BHead *thisblock);
121 BHead *blo_prevbhead(FileData *fd, BHead *thisblock);