Blender V2.61 - r43446

DNA_genfile.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #ifndef DNA_GENFILE_H
00034 #define DNA_GENFILE_H
00035 
00036 struct SDNA;
00037 
00038 extern unsigned char DNAstr[];  /* DNA.c */
00039 extern int DNAlen;
00040 
00041 typedef enum eSDNA_Type {
00042     SDNA_TYPE_CHAR     = 0,
00043     SDNA_TYPE_UCHAR    = 1,
00044     SDNA_TYPE_SHORT    = 2,
00045     SDNA_TYPE_USHORT   = 3,
00046     SDNA_TYPE_INT      = 4,
00047     SDNA_TYPE_LONG     = 5,
00048     SDNA_TYPE_ULONG    = 6,
00049     SDNA_TYPE_FLOAT    = 7,
00050     SDNA_TYPE_DOUBLE   = 8,
00051     SDNA_TYPE_INT64    = 9,
00052     SDNA_TYPE_UINT64   = 10
00053     /* ,SDNA_TYPE_VOID     = 11 */ /* nothing uses yet */
00054 } eSDNA_Type;
00055 
00056 /* define so switch statements don't complain */
00057 #define SDNA_TYPE_VOID 11
00058 
00059 struct SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap);
00060 void DNA_sdna_free(struct SDNA *sdna);
00061 
00062 int DNA_struct_find_nr(struct SDNA *sdna, const char *str);
00063 void DNA_struct_switch_endian(struct SDNA *oldsdna, int oldSDNAnr, char *data);
00064 char *DNA_struct_get_compareflags(struct SDNA *sdna, struct SDNA *newsdna);
00065 void *DNA_struct_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflags, int oldSDNAnr, int blocks, void *data);
00066 
00067 int DNA_elem_array_size(const char *astr, int len);
00068 int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name);
00069 
00070 
00071 int DNA_elem_type_size(const eSDNA_Type elem_nr);
00072 
00073 #endif