Removed the undocumented build typemap

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@537 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-07-09 01:08:51 +00:00
commit 2a8c5afeea
3 changed files with 2 additions and 87 deletions

View file

@ -676,10 +676,9 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
WrapperFunction f;
char source[256],target[256],temp[256], argnum[32];
char *tm;
String cleanup,outarg,build;
String cleanup,outarg;
int numopt = 0;
int need_save, num_saved = 0; // Number of saved arguments.
int have_build = 0;
// Make a wrapper name for this
@ -813,12 +812,6 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
} else {
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
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);
}
// 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
emit_func_call(name,d,l,f);

View file

@ -582,10 +582,8 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
String get_pointers;
String cleanup, outarg;
String check;
String build;
String kwargs;
int have_build = 0;
char *tm;
int numopt = 0;
@ -787,10 +785,6 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
outarg.replace("$arg",source);
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();
i++;
}
@ -810,26 +804,6 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
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
// the parameters in correctly, this will work.

View file

@ -441,9 +441,8 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
char target[64];
char argnum[32];
WrapperFunction f;
String incode, cleanup, outarg, build;
String incode, cleanup, outarg;
int numopt= 0;
int have_build = 0;
String argstr;
String args;
@ -597,13 +596,6 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
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
if ((tm = typemap_lookup((char*)"check",(char*)"tcl8",p->t,p->name,source,target))) {
// 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;
// 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
emit_func_call(name,d,l,f);