Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-23 03:18:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-23 03:18:43 +0400
commitcb61a71ff66d2f29a60ac0407d9936c8c99c6a33 (patch)
tree65e9e45ee624eca591fef907af3226e550676ecd /source/blender/makesdna/DNA_genfile.h
parente68f0ff3c0d5f580aaf0e4ec2b278be3c0875ba5 (diff)
DNA genfile - de-duplicate some checks and replace magic type numbers with an enum
Diffstat (limited to 'source/blender/makesdna/DNA_genfile.h')
-rw-r--r--source/blender/makesdna/DNA_genfile.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h
index 4f8b2343a9f..1ca669836ac 100644
--- a/source/blender/makesdna/DNA_genfile.h
+++ b/source/blender/makesdna/DNA_genfile.h
@@ -38,6 +38,19 @@ struct SDNA;
extern unsigned char DNAstr[]; /* DNA.c */
extern int DNAlen;
+typedef enum eSDNA_Type {
+ SDNA_TYPE_CHAR = 0,
+ SDNA_TYPE_UCHAR = 1,
+ SDNA_TYPE_SHORT = 2,
+ SDNA_TYPE_USHORT = 3,
+ SDNA_TYPE_INT = 4,
+ SDNA_TYPE_LONG = 5,
+ SDNA_TYPE_ULONG = 6,
+ SDNA_TYPE_FLOAT = 7,
+ SDNA_TYPE_DOUBLE = 8
+ /* ,SDNA_TYPE_VOID = 9 */ /* nothing uses yet */
+} eSDNA_Type;
+
struct SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap);
void DNA_sdna_free(struct SDNA *sdna);
@@ -49,6 +62,7 @@ void *DNA_struct_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *c
int DNA_elem_array_size(const char *astr, int len);
int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name);
-#endif
+int DNA_elem_type_size(const eSDNA_Type elem_nr);
+#endif