Removed the undocumented build typemap
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@537 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bfab30a055
commit
966c359b2a
3 changed files with 2 additions and 87 deletions
|
|
@ -676,10 +676,9 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
WrapperFunction f;
|
WrapperFunction f;
|
||||||
char source[256],target[256],temp[256], argnum[32];
|
char source[256],target[256],temp[256], argnum[32];
|
||||||
char *tm;
|
char *tm;
|
||||||
String cleanup,outarg,build;
|
String cleanup,outarg;
|
||||||
int numopt = 0;
|
int numopt = 0;
|
||||||
int need_save, num_saved = 0; // Number of saved arguments.
|
int need_save, num_saved = 0; // Number of saved arguments.
|
||||||
int have_build = 0;
|
|
||||||
|
|
||||||
// Make a wrapper name for this
|
// Make a wrapper name for this
|
||||||
|
|
||||||
|
|
@ -813,12 +812,6 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
} else {
|
} else {
|
||||||
temp[0] = 0;
|
temp[0] = 0;
|
||||||
}
|
}
|
||||||
// Check to see if there is any sort of "build" typemap (highly complicated)
|
|
||||||
|
|
||||||
if ((tm = typemap_lookup((char*)"build",(char*)"perl5",p->t,p->name,source,target))) {
|
|
||||||
build << tm << "\n";
|
|
||||||
have_build = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if there is any constraint code
|
// Check if there is any constraint code
|
||||||
if ((tm = typemap_lookup((char*)"check",(char*)"perl5",p->t,p->name,source,target))) {
|
if ((tm = typemap_lookup((char*)"check",(char*)"perl5",p->t,p->name,source,target))) {
|
||||||
|
|
@ -858,28 +851,6 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
f.add_local((char*)"SV *",temp);
|
f.add_local((char*)"SV *",temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there was a "build" typemap, we need to go in and perform a serious hack
|
|
||||||
|
|
||||||
if (have_build) {
|
|
||||||
char temp1[32];
|
|
||||||
char temp2[256];
|
|
||||||
l->sub_parmnames(build); // Replace all parameter names
|
|
||||||
j = 1;
|
|
||||||
for (i = 0; i < l->nparms; i++) {
|
|
||||||
p = l->get(i);
|
|
||||||
if (strlen(p->name) > 0) {
|
|
||||||
sprintf(temp1,"_in_%s", p->name);
|
|
||||||
} else {
|
|
||||||
sprintf(temp1,"_in_arg%d", i);
|
|
||||||
}
|
|
||||||
sprintf(temp2,"argv[%d]",j);
|
|
||||||
build.replaceid(temp1,temp2);
|
|
||||||
if (!p->ignore)
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
f.code << build;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now write code to make the function call
|
// Now write code to make the function call
|
||||||
|
|
||||||
emit_func_call(name,d,l,f);
|
emit_func_call(name,d,l,f);
|
||||||
|
|
|
||||||
|
|
@ -582,10 +582,8 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
String get_pointers;
|
String get_pointers;
|
||||||
String cleanup, outarg;
|
String cleanup, outarg;
|
||||||
String check;
|
String check;
|
||||||
String build;
|
|
||||||
String kwargs;
|
String kwargs;
|
||||||
|
|
||||||
int have_build = 0;
|
|
||||||
char *tm;
|
char *tm;
|
||||||
int numopt = 0;
|
int numopt = 0;
|
||||||
|
|
||||||
|
|
@ -787,10 +785,6 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
outarg.replace("$arg",source);
|
outarg.replace("$arg",source);
|
||||||
have_output++;
|
have_output++;
|
||||||
}
|
}
|
||||||
if ((tm = typemap_lookup((char*)"build",(char*)"python",p->t,p->name,source,target))) {
|
|
||||||
build << tm << "\n";
|
|
||||||
have_build = 1;
|
|
||||||
}
|
|
||||||
p = l->get_next();
|
p = l->get_next();
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
@ -810,26 +804,6 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
f.code << parse_args << get_pointers << check;
|
f.code << parse_args << get_pointers << check;
|
||||||
|
|
||||||
|
|
||||||
// Special handling for build values
|
|
||||||
|
|
||||||
if (have_build) {
|
|
||||||
char temp1[256];
|
|
||||||
char temp2[256];
|
|
||||||
l->sub_parmnames(build); // Replace all parameter names
|
|
||||||
for (i = 0; i < l->nparms; i++) {
|
|
||||||
p = l->get(i);
|
|
||||||
if (strlen(p->name) > 0) {
|
|
||||||
sprintf(temp1,"_in_%s", p->name);
|
|
||||||
} else {
|
|
||||||
sprintf(temp1,"_in_arg%d", i);
|
|
||||||
}
|
|
||||||
sprintf(temp2,"_obj%d",i);
|
|
||||||
build.replaceid(temp1,temp2);
|
|
||||||
}
|
|
||||||
f.code << build;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function emits code to call the real function. Assuming you read
|
// This function emits code to call the real function. Assuming you read
|
||||||
// the parameters in correctly, this will work.
|
// the parameters in correctly, this will work.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -441,9 +441,8 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
char target[64];
|
char target[64];
|
||||||
char argnum[32];
|
char argnum[32];
|
||||||
WrapperFunction f;
|
WrapperFunction f;
|
||||||
String incode, cleanup, outarg, build;
|
String incode, cleanup, outarg;
|
||||||
int numopt= 0;
|
int numopt= 0;
|
||||||
int have_build = 0;
|
|
||||||
String argstr;
|
String argstr;
|
||||||
String args;
|
String args;
|
||||||
|
|
||||||
|
|
@ -597,13 +596,6 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if there is any sort of "build" typemap (highly complicated)
|
|
||||||
|
|
||||||
if ((tm = typemap_lookup((char*)"build",(char*)"tcl8",p->t,p->name,source,target))) {
|
|
||||||
build << tm << "\n";
|
|
||||||
have_build = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if there was any sort of a constaint typemap
|
// Check to see if there was any sort of a constaint typemap
|
||||||
if ((tm = typemap_lookup((char*)"check",(char*)"tcl8",p->t,p->name,source,target))) {
|
if ((tm = typemap_lookup((char*)"check",(char*)"tcl8",p->t,p->name,source,target))) {
|
||||||
// Yep. Use it instead of the default
|
// Yep. Use it instead of the default
|
||||||
|
|
@ -634,28 +626,6 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
||||||
|
|
||||||
f.code << incode;
|
f.code << incode;
|
||||||
|
|
||||||
// If there was a "build" typemap, we need to go in and perform a serious hack
|
|
||||||
|
|
||||||
if (have_build) {
|
|
||||||
char temp1[32];
|
|
||||||
char temp2[256];
|
|
||||||
l->sub_parmnames(build); // Replace all parameter names
|
|
||||||
j = 1;
|
|
||||||
for (i = 0; i < l->nparms; i++) {
|
|
||||||
p = l->get(i);
|
|
||||||
if (strlen(p->name) > 0) {
|
|
||||||
sprintf(temp1,"_in_%s", p->name);
|
|
||||||
} else {
|
|
||||||
sprintf(temp1,"_in_arg%d", i);
|
|
||||||
}
|
|
||||||
sprintf(temp2,"argv[%d]",j);
|
|
||||||
build.replaceid(temp1,temp2);
|
|
||||||
if (!p->ignore)
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
f.code << build;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now write code to make the function call
|
// Now write code to make the function call
|
||||||
|
|
||||||
emit_func_call(name,d,l,f);
|
emit_func_call(name,d,l,f);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue