aboutsummaryrefslogtreecommitdiff
path: root/Source/Swig/typeobj.c
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2007-09-19 23:17:50 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2007-09-19 23:17:50 +0000
commit7199cf2ef0e60ccaef111033c4408bc4bc7b777a (patch)
tree9af26155bed357ae06836ec8625a8ca42f3729d3 /Source/Swig/typeobj.c
parent7a3c9a08a2d4876b0eb8863bcf60fe3005237ead (diff)
downloadswig-7199cf2ef0e60ccaef111033c4408bc4bc7b777a.tar.gz
Ensure the premature garbage collection prevention parameter (pgcpp) is generated for Java wrappers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9943 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source/Swig/typeobj.c')
-rw-r--r--Source/Swig/typeobj.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Swig/typeobj.c b/Source/Swig/typeobj.c
index e5781cc5b..038e87ecc 100644
--- a/Source/Swig/typeobj.c
+++ b/Source/Swig/typeobj.c
@@ -556,6 +556,23 @@ int SwigType_isarray(SwigType *t) {
}
return 0;
}
+/*
+ * SwigType_prefix_is_simple_1D_array
+ *
+ * Determine if the type is a 1D array type that is treated as a pointer within SWIG
+ * eg Foo[], Foo[3] return true, but Foo[3][3], Foo*[], Foo*[3], Foo**[] return false
+ */
+int SwigType_prefix_is_simple_1D_array(SwigType *t) {
+ char *c = Char(t);
+
+ if (c && (strncmp(c, "a(", 2) == 0)) {
+ c = strchr(c, '.');
+ c++;
+ return (*c == 0);
+ }
+ return 0;
+}
+
/* Remove all arrays */
SwigType *SwigType_pop_arrays(SwigType *t) {