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>2012-06-10 17:34:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-10 17:34:59 +0400
commitf6e21881f5d0f86725836391d20949fe0343bd19 (patch)
tree12287d7789e683c69ce8c3157293edf7f0f283d2 /source/blender/makesrna/intern/rna_define.c
parent219eca0f515f9a54953566539520fde37f2ea13b (diff)
change RNA_struct_find_function to accept a type rather then a PointerRNA, add a check duplicate functions are not defined.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 7d73de00b49..02d8cbef4a3 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -29,6 +29,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include <ctype.h>
@@ -38,6 +39,7 @@
#include "DNA_sdna_types.h"
#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
#include "BLI_ghash.h"
#include "RNA_define.h"
@@ -2631,6 +2633,11 @@ FunctionRNA *RNA_def_function(StructRNA *srna, const char *identifier, const cha
FunctionRNA *func;
FunctionDefRNA *dfunc;
+ if (BLI_findstring_ptr(&srna->functions, identifier, offsetof(FunctionRNA, identifier))) {
+ fprintf(stderr, "%s: %s.%s already defined.\n", __func__, srna->identifier, identifier);
+ return NULL;
+ }
+
func = rna_def_function(srna, identifier);
if (!DefRNA.preprocess) {