Hid the name and is_reference attributes of types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@626 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2597863a14
commit
7f24ebca9a
14 changed files with 248 additions and 220 deletions
|
|
@ -394,10 +394,10 @@ throw_unhandled_guile_type_error (DataType *d)
|
|||
fflush (stdout);
|
||||
Printf (stderr, "ERROR: Unhandled GUILE type error.\n");
|
||||
Printf (stderr, " type %d\n", DataType_type(d));
|
||||
Printf (stderr, " name %s\n", d->name);
|
||||
Printf (stderr, " name %s\n", DataType_Getname(d));
|
||||
Printf (stderr, " is_pointer %d\n", d->is_pointer);
|
||||
Printf (stderr, "implicit_ptr %d\n", d->implicit_ptr);
|
||||
Printf (stderr, "is_reference %d\n", d->is_reference);
|
||||
Printf (stderr, "is_reference %d\n", DataType_is_reference(d));
|
||||
Printf (stderr, " status %d\n", d->status);
|
||||
/* Printf (stderr, " qualifier %s\n", (d->qualifier ? d->qualifier : ""));
|
||||
Printf (stderr, " arraystr %s\n", (d->arraystr ? d->arraystr : ""));*/
|
||||
|
|
@ -830,7 +830,7 @@ GUILE::usage_func (char *iname, DataType *d, ParmList *l, DOHString *usage)
|
|||
if (DataType_type(pt) != T_VOID) {
|
||||
|
||||
// Print the type.
|
||||
Printv(usage, " <", pt->name, 0);
|
||||
Printv(usage, " <", DataType_Getname(pt), 0);
|
||||
if (pt->is_pointer) {
|
||||
for (int j = 0; j < (pt->is_pointer - pt->implicit_ptr); j++) {
|
||||
Putc('*', usage);
|
||||
|
|
@ -880,7 +880,7 @@ GUILE::usage_returns (char *iname, DataType *d, ParmList *l, DOHString *usage)
|
|||
++have_param;
|
||||
|
||||
// Print the type.
|
||||
Printv(param," $", pt->name, 0);
|
||||
Printv(param," $", DataType_Getname(pt), 0);
|
||||
if (pt->is_pointer) {
|
||||
for (j = 0; j < (pt->is_pointer - pt->implicit_ptr - 1); j++) {
|
||||
Putc('*', param);
|
||||
|
|
|
|||
|
|
@ -130,8 +130,8 @@ char *JAVA::SwigTcToJavaType(DataType *t, int ret, int inShadow) {
|
|||
case T_SCHAR: return (char*)"byte []";
|
||||
case T_BOOL: return (char*)"boolean []";
|
||||
case T_VOID:
|
||||
case T_USER: if(inShadow && Getattr(shadow_classes,t->name))
|
||||
return GetChar(shadow_classes,t->name);
|
||||
case T_USER: if(inShadow && Getattr(shadow_classes,DataType_Getname(t)))
|
||||
return GetChar(shadow_classes,DataType_Getname(t));
|
||||
else return (char*)"long";
|
||||
}
|
||||
} else if(t->is_pointer > 1) {
|
||||
|
|
@ -202,8 +202,8 @@ char *JAVA::JavaMethodSignature(DataType *t, int ret, int inShadow) {
|
|||
case T_SCHAR: return (char*)"[B";
|
||||
case T_BOOL: return (char*)"[Z";
|
||||
case T_VOID:
|
||||
case T_USER: if(inShadow && Getattr(shadow_classes,t->name))
|
||||
return GetChar(shadow_classes,t->name);
|
||||
case T_USER: if(inShadow && Getattr(shadow_classes,DataType_Getname(t)))
|
||||
return GetChar(shadow_classes,DataType_Getname(t));
|
||||
else return (char*)"J";
|
||||
}
|
||||
} else if(t->is_pointer > 1) {
|
||||
|
|
@ -953,11 +953,11 @@ void JAVA::add_typedef(DataType *t, char *name) {
|
|||
|
||||
// Now look up the datatype in our shadow class hash table
|
||||
|
||||
if (Getattr(shadow_classes,t->name)) {
|
||||
if (Getattr(shadow_classes,DataType_Getname(t))) {
|
||||
|
||||
// Yep. This datatype is in the hash
|
||||
// Put this types 'new' name into the hash
|
||||
Setattr(shadow_classes,name,GetChar(shadow_classes,t->name));
|
||||
Setattr(shadow_classes,name,GetChar(shadow_classes,DataType_Getname(t)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1060,7 +1060,7 @@ void JAVA::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
if(!javarettype) javarettype = SwigTcToJavaType(t, 1, 0);
|
||||
char *shadowrettype = JavaTypeFromTypemap((char*)"jstype", typemap_lang, t, iname);
|
||||
if(!shadowrettype && (DataType_Gettypecode(t) == T_USER) && t->is_pointer <= 1) {
|
||||
shadowrettype = GetChar(shadow_classes,t->name);
|
||||
shadowrettype = GetChar(shadow_classes,DataType_Getname(t));
|
||||
}
|
||||
|
||||
Printf(f_shadow, " public %s %s(", (shadowrettype) ? shadowrettype : javarettype, iname);
|
||||
|
|
@ -1087,7 +1087,7 @@ void JAVA::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
sprintf(arg,"arg%d",i);
|
||||
}
|
||||
|
||||
if((DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1 && Getattr(shadow_classes,pt->name)) {
|
||||
if((DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1 && Getattr(shadow_classes,DataType_Getname(pt))) {
|
||||
Printv(nativecall, ", ", arg, "._self", 0);
|
||||
} else Printv(nativecall, ", ", arg, 0);
|
||||
|
||||
|
|
@ -1096,7 +1096,7 @@ void JAVA::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
|
||||
char *jstype = JavaTypeFromTypemap((char*)"jstype", typemap_lang, pt, pn);
|
||||
if(!jstype && (DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1) {
|
||||
jstype = GetChar(shadow_classes,pt->name);
|
||||
jstype = GetChar(shadow_classes,DataType_Getname(pt));
|
||||
}
|
||||
|
||||
// Add to java function header
|
||||
|
|
@ -1132,7 +1132,7 @@ void JAVA::cpp_static_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
if(!javarettype) javarettype = SwigTcToJavaType(t, 1, 0);
|
||||
char *shadowrettype = JavaTypeFromTypemap((char*)"jstype", typemap_lang, t, iname);
|
||||
if(!shadowrettype && (DataType_Gettypecode(t) == T_USER) && t->is_pointer <= 1) {
|
||||
shadowrettype = GetChar(shadow_classes,t->name);
|
||||
shadowrettype = GetChar(shadow_classes,DataType_Getname(t));
|
||||
}
|
||||
|
||||
Printf(f_shadow, " public static %s %s(", (shadowrettype) ? shadowrettype : javarettype, iname);
|
||||
|
|
@ -1162,7 +1162,7 @@ void JAVA::cpp_static_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
|
||||
if(gencomma) Printf(nativecall,", ");
|
||||
|
||||
if((DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1 && Getattr(shadow_classes,pt->name)) {
|
||||
if((DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1 && Getattr(shadow_classes,DataType_Getname(pt))) {
|
||||
Printv(nativecall, arg, "._self", 0);
|
||||
} else Printv(nativecall,arg,0);
|
||||
|
||||
|
|
@ -1173,7 +1173,7 @@ void JAVA::cpp_static_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
|
||||
char *jstype = JavaTypeFromTypemap((char*)"jstype", typemap_lang, pt, pn);
|
||||
if(!jstype && (DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1) {
|
||||
jstype = GetChar(shadow_classes, pt->name);
|
||||
jstype = GetChar(shadow_classes, DataType_Getname(pt));
|
||||
}
|
||||
|
||||
// Add to java function header
|
||||
|
|
@ -1233,13 +1233,13 @@ void JAVA::cpp_constructor(char *name, char *iname, ParmList *l) {
|
|||
|
||||
char *jstype = JavaTypeFromTypemap((char*)"jstype", typemap_lang, pt, pn);
|
||||
if(!jstype && (DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1) {
|
||||
jstype = GetChar(shadow_classes, pt->name);
|
||||
jstype = GetChar(shadow_classes, DataType_Getname(pt));
|
||||
}
|
||||
|
||||
// Add to java function header
|
||||
Printf(f_shadow, "%s %s", (jstype) ? jstype : jtype, arg);
|
||||
|
||||
if((DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1 && Getattr(shadow_classes,pt->name)) {
|
||||
if((DataType_Gettypecode(pt) == T_USER) && pt->is_pointer <= 1 && Getattr(shadow_classes,DataType_Getname(pt))) {
|
||||
Printv(nativecall,arg, "._self", 0);
|
||||
} else Printv(nativecall, arg, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -259,10 +259,10 @@ throw_unhandled_mzscheme_type_error (DataType *d)
|
|||
fflush (stdout);
|
||||
Printf (stderr, "ERROR: Unhandled MZSCHEME type error.\n");
|
||||
Printf (stderr, " type %d\n", DataType_Gettypecode(d));
|
||||
Printf (stderr, " name %s\n", d->name);
|
||||
Printf (stderr, " name %s\n", DataType_Getname(d));
|
||||
Printf (stderr, " is_pointer %d\n", d->is_pointer);
|
||||
Printf (stderr, "implicit_ptr %d\n", d->implicit_ptr);
|
||||
Printf (stderr, "is_reference %d\n", d->is_reference);
|
||||
Printf (stderr, "is_reference %d\n", DataType_is_reference(d));
|
||||
Printf (stderr, " status %d\n", d->status);
|
||||
/* Printf (stderr, " qualifier %s\n", (d->qualifier ? d->qualifier : ""));
|
||||
Printf (stderr, " arraystr %s\n", (d->arraystr ? d->arraystr : "")); */
|
||||
|
|
@ -701,7 +701,7 @@ MZSCHEME::usage_func (char *iname, DataType *d, ParmList *l, DOHString *usage)
|
|||
if (DataType_type(pt) != T_VOID) {
|
||||
|
||||
// Print the type.
|
||||
Printv(usage," <", pt->name, 0);
|
||||
Printv(usage," <", DataType_Getname(pt), 0);
|
||||
if (pt->is_pointer) {
|
||||
for (int j = 0; j < (pt->is_pointer - pt->implicit_ptr); j++) {
|
||||
Putc('*', usage);
|
||||
|
|
@ -752,7 +752,7 @@ MZSCHEME::usage_returns (char *iname, DataType *d, ParmList *l, DOHString *usage
|
|||
++have_param;
|
||||
|
||||
// Print the type.
|
||||
Printv(param," $",pt->name, 0);
|
||||
Printv(param," $",DataType_Getname(pt), 0);
|
||||
if (pt->is_pointer) {
|
||||
for (j = 0; j < (pt->is_pointer - pt->implicit_ptr - 1); j++) {
|
||||
Putc('*',param);
|
||||
|
|
|
|||
|
|
@ -156,18 +156,17 @@ type_mangle(DataType *t) {
|
|||
|
||||
// Check to see if we've blessed this datatype
|
||||
|
||||
if ((Getattr(classes,t->name)) && (t->is_pointer <= 1)) {
|
||||
if ((Getattr(classes,DataType_Getname(t))) && (t->is_pointer <= 1)) {
|
||||
|
||||
// This is a blessed class. Return just the type-name
|
||||
strcpy(result, GetChar(classes,t->name));
|
||||
strcpy(result, GetChar(classes,DataType_Getname(t)));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
r = result;
|
||||
c = t->name;
|
||||
|
||||
for ( c = t->name; *c; c++,r++) {
|
||||
for ( c = DataType_Getname(t); *c; c++,r++) {
|
||||
*r = *c;
|
||||
}
|
||||
for (i = 0; i < (t->is_pointer-t->implicit_ptr); i++, r++) {
|
||||
|
|
@ -1048,7 +1047,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
|
||||
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",pt,(char*)"",sourceNtarget,sourceNtarget))) {
|
||||
Printf(func,"%s\n", tm);
|
||||
} else if ((Getattr(classes,pt->name)) && (pt->is_pointer <= 1)) {
|
||||
} else if ((Getattr(classes,DataType_Getname(pt))) && (pt->is_pointer <= 1)) {
|
||||
if (i >= (pcount - numopt))
|
||||
Printf(func," if (scalar(@args) >= %d) {\n ", i);
|
||||
Printf(func," $args[%d] = tied(%%{$args[%d]});\n", i, i);
|
||||
|
|
@ -1076,7 +1075,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
"}\n",
|
||||
0);
|
||||
|
||||
} else if ((Getattr(classes,d->name)) && (d->is_pointer <=1)) {
|
||||
} else if ((Getattr(classes,DataType_Getname(d))) && (d->is_pointer <=1)) {
|
||||
|
||||
Printv(func, tab4, "return undef if (!defined($result));\n", 0);
|
||||
|
||||
|
|
@ -1084,7 +1083,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
// into our local hash table
|
||||
|
||||
if ((d->is_pointer == 0) || ((d->is_pointer == 1) && NewObject)) {
|
||||
char *name = GetChar(classes,d->name);
|
||||
char *name = GetChar(classes,DataType_Getname(d));
|
||||
if (hidden)
|
||||
Printv(func, tab4, "$", realpackage, "::", name, "::OWNER{$result} = 1;\n", 0);
|
||||
else
|
||||
|
|
@ -1312,13 +1311,13 @@ void PERL5::link_variable(char *name, char *iname, DataType *t)
|
|||
// 2. Otherwise, just hack Perl's symbol table
|
||||
|
||||
if (blessed) {
|
||||
if ((Getattr(classes,t->name)) && (t->is_pointer <= 1)) {
|
||||
if ((Getattr(classes,DataType_Getname(t))) && (t->is_pointer <= 1)) {
|
||||
Printv(var_stubs,
|
||||
"\nmy %__", iname, "_hash;\n",
|
||||
"tie %__", iname, "_hash,\"", GetChar(classes,t->name), "\", $",
|
||||
"tie %__", iname, "_hash,\"", GetChar(classes,DataType_Getname(t)), "\", $",
|
||||
package, "::", iname, ";\n",
|
||||
"$", iname, "= \\%__", iname, "_hash;\n",
|
||||
"bless $", iname, ", ", GetChar(classes,t->name), ";\n",
|
||||
"bless $", iname, ", ", GetChar(classes,DataType_Getname(t)), ";\n",
|
||||
0);
|
||||
} else {
|
||||
Printv(var_stubs, "*", iname, " = *", package, "::", iname, ";\n", 0);
|
||||
|
|
@ -1455,13 +1454,13 @@ PERL5::declare_const(char *name, char *, DataType *type, char *value)
|
|||
}
|
||||
|
||||
if (blessed) {
|
||||
if ((Getattr(classes,type->name)) && (type->is_pointer <= 1)) {
|
||||
if ((Getattr(classes,DataType_Getname(type))) && (type->is_pointer <= 1)) {
|
||||
Printv(var_stubs,
|
||||
"\nmy %__", name, "_hash;\n",
|
||||
"tie %__", name, "_hash,\"", GetChar(classes,type->name), "\", $",
|
||||
"tie %__", name, "_hash,\"", GetChar(classes,DataType_Getname(type)), "\", $",
|
||||
package, "::", name, ";\n",
|
||||
"$", name, "= \\%__", name, "_hash;\n",
|
||||
"bless $", name, ", ", GetChar(classes,type->name), ";\n",
|
||||
"bless $", name, ", ", GetChar(classes,DataType_Getname(type)), ";\n",
|
||||
0);
|
||||
} else {
|
||||
Printv(var_stubs, "*",name," = *", package, "::", name, ";\n", 0);
|
||||
|
|
@ -1877,7 +1876,7 @@ void PERL5::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
Printf(func,"%s\n",tm);
|
||||
}
|
||||
// Look up the datatype name here
|
||||
else if ((Getattr(classes,pt->name)) && (pt->is_pointer <= 1)) {
|
||||
else if ((Getattr(classes,DataType_Getname(pt))) && (pt->is_pointer <= 1)) {
|
||||
// Yep. This smells alot like an object, patch up the arguments
|
||||
|
||||
if (i >= (pcount - numopt))
|
||||
|
|
@ -1911,7 +1910,7 @@ void PERL5::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
"}\n",
|
||||
0);
|
||||
|
||||
} else if ((Getattr(classes,t->name)) && (t->is_pointer <=1)) {
|
||||
} else if ((Getattr(classes,DataType_Getname(t))) && (t->is_pointer <=1)) {
|
||||
|
||||
Printv(func,tab4, "return undef if (!defined($result));\n", 0);
|
||||
|
||||
|
|
@ -1919,7 +1918,7 @@ void PERL5::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
// into our local hash table
|
||||
|
||||
if ((t->is_pointer == 0) || ((t->is_pointer == 1) && NewObject)) {
|
||||
char *name = GetChar(classes,t->name);
|
||||
char *name = GetChar(classes,DataType_Getname(t));
|
||||
if (hidden)
|
||||
Printv(func, tab4, "$", realpackage, "::", name, "::OWNER{$result} = 1;\n", 0);
|
||||
else
|
||||
|
|
@ -1996,12 +1995,12 @@ void PERL5::cpp_variable(char *name, char *iname, DataType *t) {
|
|||
|
||||
// Now we need to generate a little Perl code for this
|
||||
|
||||
if ((Getattr(classes,t->name)) && (t->is_pointer <= 1)) {
|
||||
if ((Getattr(classes,DataType_Getname(t))) && (t->is_pointer <= 1)) {
|
||||
|
||||
// This is a Perl object that we have already seen. Add an
|
||||
// entry to the members list
|
||||
Printv(blessedmembers,
|
||||
tab4, realname, " => '", (hidden ? realpackage : ""), (hidden ? "::" : ""), GetChar(classes,t->name), "',\n",
|
||||
tab4, realname, " => '", (hidden ? realpackage : ""), (hidden ? "::" : ""), GetChar(classes,DataType_Getname(t)), "',\n",
|
||||
0);
|
||||
|
||||
}
|
||||
|
|
@ -2075,7 +2074,7 @@ void PERL5::cpp_constructor(char *name, char *iname, ParmList *l) {
|
|||
DataType *pt = Gettype(p);
|
||||
// Look up the datatype name here
|
||||
|
||||
if ((Getattr(classes,pt->name)) && (pt->is_pointer <= 1)) {
|
||||
if ((Getattr(classes,DataType_Getname(pt))) && (pt->is_pointer <= 1)) {
|
||||
|
||||
// Yep. This smells alot like an object, patch up the arguments
|
||||
Printf(pcode, " $args[%d] = tied(%%{$args[%d]});\n", i, i);
|
||||
|
|
@ -2274,13 +2273,13 @@ void PERL5::add_typedef(DataType *t, char *name) {
|
|||
|
||||
// Now look up the datatype in our shadow class hash table
|
||||
|
||||
if (Getattr(classes,t->name)) {
|
||||
if (Getattr(classes,DataType_Getname(t))) {
|
||||
|
||||
// Yep. This datatype is in the hash
|
||||
|
||||
// Put this types 'new' name into the hash
|
||||
|
||||
Setattr(classes,name,GetChar(classes,t->name));
|
||||
Setattr(classes,name,GetChar(classes,DataType_Getname(t)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -982,7 +982,7 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
|
||||
|
||||
// Check return code for modification
|
||||
if ((Getattr(hash,d->name)) && (d->is_pointer <=1)) {
|
||||
if ((Getattr(hash,DataType_Getname(d))) && (d->is_pointer <=1)) {
|
||||
need_wrapper = 1;
|
||||
munge_return = 1;
|
||||
}
|
||||
|
|
@ -1007,9 +1007,9 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
// unchanged. Otherwise, emit some shadow class conversion code.
|
||||
|
||||
if (!have_output) {
|
||||
Printv(func, tab4, "if val: val = ", GetChar(hash,d->name), "Ptr(val)", 0);
|
||||
if (((Getattr(hash,d->name)) && (d->is_pointer < 1)) ||
|
||||
((Getattr(hash,d->name)) && (d->is_pointer == 1) && NewObject))
|
||||
Printv(func, tab4, "if val: val = ", GetChar(hash,DataType_Getname(d)), "Ptr(val)", 0);
|
||||
if (((Getattr(hash,DataType_Getname(d))) && (d->is_pointer < 1)) ||
|
||||
((Getattr(hash,DataType_Getname(d))) && (d->is_pointer == 1) && NewObject))
|
||||
Printf(func, "; val.thisown = 1\n");
|
||||
else
|
||||
Printf(func,"\n");
|
||||
|
|
@ -1261,9 +1261,9 @@ void PYTHON::link_variable(char *name, char *iname, DataType *t) {
|
|||
// Output a shadow variable. (If applicable and possible)
|
||||
// ----------------------------------------------------------
|
||||
if ((shadow) && (!(shadow & PYSHADOW_MEMBER))) {
|
||||
if ((Getattr(hash,t->name)) && (t->is_pointer <= 1)) {
|
||||
if ((Getattr(hash,DataType_Getname(t))) && (t->is_pointer <= 1)) {
|
||||
Printv(vars,
|
||||
iname, " = ", GetChar(hash,t->name), "Ptr(", module, ".", global_name,
|
||||
iname, " = ", GetChar(hash,DataType_Getname(t)), "Ptr(", module, ".", global_name,
|
||||
".", iname, ")\n",
|
||||
0);
|
||||
}
|
||||
|
|
@ -1694,7 +1694,7 @@ void PYTHON::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l)
|
|||
if (strcmp(realname,"__repr__") == 0)
|
||||
have_repr = 1;
|
||||
|
||||
if (!((Getattr(hash,t->name)) && (t->is_pointer <=1)) && !noopt) {
|
||||
if (!((Getattr(hash,DataType_Getname(t))) && (t->is_pointer <=1)) && !noopt) {
|
||||
Printv(imethod,
|
||||
class_name, ".", realname, " = new.instancemethod(", module, ".", Swig_name_member(class_name,realname), ", None, ", class_name, ")\n",
|
||||
0);
|
||||
|
|
@ -1714,12 +1714,12 @@ void PYTHON::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l)
|
|||
Printv(pyclass, tab8, "val = apply(", module, ".", Swig_name_member(class_name,realname), ",args)\n",0);
|
||||
|
||||
// Check to see if the return type is an object
|
||||
if ((Getattr(hash,t->name)) && (t->is_pointer <= 1)) {
|
||||
if ((Getattr(hash,DataType_Getname(t))) && (t->is_pointer <= 1)) {
|
||||
if (!typemap_check((char*)"out",typemap_lang,t,Swig_name_member(class_name,realname))) {
|
||||
if (!have_output) {
|
||||
Printv(pyclass, tab8, "if val: val = ", GetChar(hash,t->name), "Ptr(val) ", 0);
|
||||
if (((Getattr(hash,t->name)) && (t->is_pointer < 1)) ||
|
||||
((Getattr(hash,t->name)) && (t->is_pointer == 1) && NewObject))
|
||||
Printv(pyclass, tab8, "if val: val = ", GetChar(hash,DataType_Getname(t)), "Ptr(val) ", 0);
|
||||
if (((Getattr(hash,DataType_Getname(t))) && (t->is_pointer < 1)) ||
|
||||
((Getattr(hash,DataType_Getname(t))) && (t->is_pointer == 1) && NewObject))
|
||||
Printf(pyclass, "; val.thisown = 1\n");
|
||||
else
|
||||
Printf(pyclass,"\n");
|
||||
|
|
@ -1982,7 +1982,7 @@ void PYTHON::cpp_variable(char *name, char *iname, DataType *t) {
|
|||
|
||||
// Figure out if we've seen this datatype before
|
||||
|
||||
if ((Getattr(hash,t->name)) && (t->is_pointer <= 1)) inhash = 1;
|
||||
if ((Getattr(hash,DataType_Getname(t))) && (t->is_pointer <= 1)) inhash = 1;
|
||||
|
||||
// Now write some code to set the variable
|
||||
if (Status & STAT_READONLY) {
|
||||
|
|
@ -1992,7 +1992,7 @@ void PYTHON::cpp_variable(char *name, char *iname, DataType *t) {
|
|||
}
|
||||
// Write some code to get the variable
|
||||
if (inhash) {
|
||||
Printv(cgetattr, tab8, "\"", realname, "\" : lambda x : ", GetChar(hash,t->name), "Ptr(", module, ".", Swig_name_get(Swig_name_member(class_name,realname)), "(x)),\n", 0);
|
||||
Printv(cgetattr, tab8, "\"", realname, "\" : lambda x : ", GetChar(hash,DataType_Getname(t)), "Ptr(", module, ".", Swig_name_get(Swig_name_member(class_name,realname)), "(x)),\n", 0);
|
||||
|
||||
} else {
|
||||
Printv(cgetattr, tab8, "\"", realname, "\" : ", module, ".", Swig_name_get(Swig_name_member(class_name,realname)),",\n", 0);
|
||||
|
|
@ -2058,12 +2058,12 @@ void PYTHON::add_typedef(DataType *t, char *name) {
|
|||
|
||||
// Now look up the datatype in our shadow class hash table
|
||||
|
||||
if (Getattr(hash,t->name)) {
|
||||
if (Getattr(hash,DataType_Getname(t))) {
|
||||
|
||||
// Yep. This datatype is in the hash
|
||||
|
||||
// Put this types 'new' name into the hash
|
||||
|
||||
Setattr(hash,name, GetChar(hash,t->name));
|
||||
Setattr(hash,name, GetChar(hash,DataType_Getname(t)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ void RUBY::parse() {
|
|||
|
||||
// typedef void *VALUE
|
||||
DataType *value = NewDataType(T_VOID);
|
||||
strcpy(value->name, "void");
|
||||
DataType_Setname(value,"void");
|
||||
value->is_pointer = 1;
|
||||
value->implicit_ptr = 0;
|
||||
DataType_typedef_add(value,(char*)"VALUE",0);
|
||||
|
|
@ -867,13 +867,13 @@ char *RUBY::ruby_typemap_lookup(char *op, DataType *type, char *pname, char *sou
|
|||
DOHString *target_replace = NewString(target);
|
||||
target = Char(target_replace);
|
||||
|
||||
RClass *cls = RCLASS(classes, type->name);
|
||||
RClass *cls = RCLASS(classes, DataType_Getname(type));
|
||||
|
||||
if (!s) s = NewString("");
|
||||
Clear(s);
|
||||
|
||||
if ((strcmp("out", op) == 0 || strcmp("in", op) == 0)
|
||||
&& strcmp(type->name, "VALUE") == 0) {
|
||||
&& strcmp(DataType_Getname(type), "VALUE") == 0) {
|
||||
Printf(s,"$target = $source;");
|
||||
} else if (strcmp("out", op) == 0 && (DataType_Gettypecode(type) == T_USER) &&
|
||||
type->is_pointer == 1 && cls) {
|
||||
|
|
|
|||
|
|
@ -1025,7 +1025,7 @@ void TCL8::declare_const(char *name, char *, DataType *type, char *value) {
|
|||
break;
|
||||
case T_FLOAT:
|
||||
DataType_Settypecode(type,T_DOUBLE);
|
||||
strcpy(type->name,"double");
|
||||
DataType_Setname(type,"double");
|
||||
Printf(f_header,"static %s %s = (%s) (%s);\n", DataType_lstr(type,0), var_name, DataType_lstr(type,0), value);
|
||||
link_variable(var_name,name,type);
|
||||
break;
|
||||
|
|
@ -1254,9 +1254,10 @@ void TCL8::cpp_close_class() {
|
|||
|
||||
this->Language::cpp_close_class();
|
||||
if (shadow) {
|
||||
|
||||
char temp[256];
|
||||
t = NewDataType(T_USER);
|
||||
sprintf(t->name,"%s%s", class_type, real_classname);
|
||||
sprintf(temp,"%s%s", class_type, real_classname);
|
||||
DataType_Setname(t,temp);
|
||||
t->is_pointer = 1;
|
||||
|
||||
if (have_destructor) {
|
||||
|
|
@ -1405,11 +1406,11 @@ void TCL8::add_typedef(DataType *t, char *name) {
|
|||
|
||||
// Now look up the datatype in our shadow class hash table
|
||||
|
||||
if (Getattr(hash,t->name)) {
|
||||
if (Getattr(hash,DataType_Getname(t))) {
|
||||
|
||||
// Yep. This datatype is in the hash
|
||||
// Put this types 'new' name into the hash
|
||||
Setattr(hash,name,GetChar(hash,t->name));
|
||||
Setattr(hash,name,GetChar(hash,DataType_Getname(t)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue