Replaced the C++ String class with a wrapper around DOHString. Eliminated
the automatic conversion of String --> char * at the risk of breaking the universe (although I think I have fixed everything). This change made the wrapper modules a lot more ugly, but it's now a lot more obvious as to what is a String and what is a char * which will be useful when I get around to patching up all of the interfaces and objects. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@504 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
36627e941a
commit
190382207b
14 changed files with 164 additions and 480 deletions
|
|
@ -397,9 +397,9 @@ GUILE::get_pointer (char *iname, int parm, DataType *t,
|
|||
static void
|
||||
mreplace (String &s, String &argnum, String &arg, String &proc_name)
|
||||
{
|
||||
s.replace ("$argnum", argnum);
|
||||
s.replace ("$arg", arg);
|
||||
s.replace ("$name", proc_name);
|
||||
s.replace ("$argnum", argnum.get());
|
||||
s.replace ("$arg", arg.get());
|
||||
s.replace ("$name", proc_name.get());
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -507,7 +507,7 @@ GUILE::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
else {
|
||||
++numargs;
|
||||
if ((tm = typemap_lookup ((char*)"in", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
f.code << tm << "\n";
|
||||
mreplace (f.code, argnum, arg, proc_name);
|
||||
}
|
||||
|
|
@ -522,7 +522,7 @@ GUILE::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
// Check if there are any constraints.
|
||||
|
||||
if ((tm = typemap_lookup ((char*)"check", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
f.code << tm << "\n";
|
||||
mreplace (f.code, argnum, arg, proc_name);
|
||||
}
|
||||
|
|
@ -530,7 +530,7 @@ GUILE::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
// Pass output arguments back to the caller.
|
||||
|
||||
if ((tm = typemap_lookup ((char*)"argout", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
outarg << tm << "\n";
|
||||
mreplace (outarg, argnum, arg, proc_name);
|
||||
}
|
||||
|
|
@ -538,7 +538,7 @@ GUILE::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
// Free up any memory allocated for the arguments.
|
||||
|
||||
if ((tm = typemap_lookup ((char*)"freearg", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
cleanup << tm << "\n";
|
||||
mreplace (cleanup, argnum, arg, proc_name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,9 +227,9 @@ char *JAVA::makeValidJniName(char *name) {
|
|||
// !! this approach fails for functions without arguments
|
||||
char *JAVA::JNICALL(String& func) {
|
||||
if(jnic)
|
||||
sprintf(bigbuf, "(*jenv)->%s(jenv, ", (char *) func);
|
||||
sprintf(bigbuf, "(*jenv)->%s(jenv, ", (char *) func.get());
|
||||
else
|
||||
sprintf(bigbuf, "jenv->%s(", (char *) func);
|
||||
sprintf(bigbuf, "jenv->%s(", (char *) func.get());
|
||||
|
||||
return strdup(bigbuf);
|
||||
}
|
||||
|
|
@ -259,25 +259,25 @@ void JAVA::writeRegisterNatives()
|
|||
// The registerNatives function
|
||||
String registerFunction;
|
||||
|
||||
registerFunction << "jint registerNatives(JNIEnv *jenv) {" << endl
|
||||
registerFunction << "jint registerNatives(JNIEnv *jenv) {" << "\n"
|
||||
<< tab4 << "jclass nativeClass = " << JNICALL((char*)"FindClass")
|
||||
<< "\"" << jni_pkgstr << module << "\");" <<endl;
|
||||
registerFunction << tab4 << "if (nativeClass == 0)" << endl << tab8 << "return -1;" << endl;
|
||||
<< "\"" << jni_pkgstr << module << "\");" <<"\n";
|
||||
registerFunction << tab4 << "if (nativeClass == 0)" << "\n" << tab8 << "return -1;" << "\n";
|
||||
|
||||
registerFunction << tab4 << "return " << JNICALL((char*)"RegisterNatives") << "nativeClass, nativeMethods, " << "numberOfNativeMethods);" << endl;
|
||||
registerFunction << "}" << endl << endl;
|
||||
registerFunction << tab4 << "return " << JNICALL((char*)"RegisterNatives") << "nativeClass, nativeMethods, " << "numberOfNativeMethods);" << "\n";
|
||||
registerFunction << "}" << "\n" << "\n";
|
||||
|
||||
// The unregisterNatives function
|
||||
|
||||
registerFunction << "jint unregisterNatives(JNIEnv *jenv) {" << endl
|
||||
registerFunction << "jint unregisterNatives(JNIEnv *jenv) {" << "\n"
|
||||
<< tab4 << "jclass nativeClass = " << JNICALL((char*)"FindClass")
|
||||
<< "\"" << jni_pkgstr << module << "\");" <<endl;
|
||||
registerFunction << tab4 << "if (nativeClass == 0)" << endl << tab8 << "return -1;" << endl;
|
||||
<< "\"" << jni_pkgstr << module << "\");" <<"\n";
|
||||
registerFunction << tab4 << "if (nativeClass == 0)" << "\n" << tab8 << "return -1;" << "\n";
|
||||
registerFunction << tab4 << "// Sun documentation suggests that this method should not be invoked in "
|
||||
<< "\"normal native code\"." << endl;
|
||||
registerFunction << tab4 << "// return " << JNICALL((char*)"UnregisterNatives") << "nativeClass);" << endl;
|
||||
registerFunction << tab4 << "return 0;" << endl;
|
||||
registerFunction << "}" << endl;
|
||||
<< "\"normal native code\"." << "\n";
|
||||
registerFunction << tab4 << "// return " << JNICALL((char*)"UnregisterNatives") << "nativeClass);" << "\n";
|
||||
registerFunction << tab4 << "return 0;" << "\n";
|
||||
registerFunction << "}" << "\n";
|
||||
|
||||
// Now write the C function
|
||||
fprintf(f_wrappers,registerFunction.get());
|
||||
|
|
@ -551,7 +551,7 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
else member_name << "get";
|
||||
member_name << (char) toupper((int) *shadow_name);
|
||||
member_name << shadow_name + 1;
|
||||
fprintf(f_shadow, " public %s %s(", javarettype, (char *) member_name);
|
||||
fprintf(f_shadow, " public %s %s(", javarettype, (char *) member_name.get());
|
||||
body << tab4 << "return " << module << "." << iname << "(_self";
|
||||
}
|
||||
|
||||
|
|
@ -590,13 +590,13 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
if(shadow && member_func) {
|
||||
if(i > 0) {
|
||||
if(i>1) fprintf(f_shadow, ", ");
|
||||
fprintf(f_shadow, "%s %s", jtype, (char *) source);
|
||||
fprintf(f_shadow, "%s %s", jtype, (char *) source.get());
|
||||
body << ", " << source;
|
||||
}
|
||||
}
|
||||
|
||||
if(gencomma) fprintf(f_java, ", ");
|
||||
fprintf(f_java, "%s %s", jtype, (char *) source);
|
||||
fprintf(f_java, "%s %s", jtype, (char *) source.get());
|
||||
|
||||
gencomma = 1;
|
||||
|
||||
|
|
@ -604,10 +604,10 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
f.def << ", " << jnitype << " " << source;
|
||||
|
||||
// Get typemap for this argument
|
||||
tm = typemap_lookup((char*)"in",typemap_lang,p->t,p->name,source,target,&f);
|
||||
tm = typemap_lookup((char*)"in",typemap_lang,p->t,p->name,source.get(),target.get(),&f);
|
||||
if (tm) {
|
||||
f.code << tm << "\n";
|
||||
f.code.replace("$arg",source); // Perform a variable replacement
|
||||
f.code.replace("$arg",source.get()); // Perform a variable replacement
|
||||
} else {
|
||||
if(!p->t->is_pointer)
|
||||
f.code << tab4 << target << " = " << p->t->print_cast() << source << ";\n";
|
||||
|
|
@ -618,7 +618,7 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
p->t->is_pointer--;
|
||||
} else {
|
||||
if(p->t->type == T_CHAR && p->t->is_pointer == 1) {
|
||||
f.code << tab4 << (char *) target << " = (" << source << ") ? (char *)" << JNICALL((char*)"GetStringUTFChars") << source << ", 0) : NULL;\n";
|
||||
f.code << tab4 << target << " = (" << source << ") ? (char *)" << JNICALL((char*)"GetStringUTFChars") << source << ", 0) : NULL;\n";
|
||||
} else {
|
||||
char *scalarType = SwigTcToJniScalarType(p->t);
|
||||
char *cptrtype = p->t->print_type();
|
||||
|
|
@ -636,8 +636,8 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
String source_length = JNICALL((char*)"GetArrayLength");
|
||||
source_length << source << ")";
|
||||
|
||||
target_copy = copy_string(f.new_local((char *) basic_jniptrtype, target, NULL));
|
||||
target_length = copy_string(f.new_local((char*)"jsize", target, source_length));
|
||||
target_copy = copy_string(f.new_local((char *) basic_jniptrtype.get(), target.get(), NULL));
|
||||
target_length = copy_string(f.new_local((char*)"jsize", target.get(), source_length.get()));
|
||||
if(local_i == NULL) local_i = copy_string(f.new_local((char*)"int", (char*)"i", NULL));
|
||||
|
||||
String scalarFunc = "Get";
|
||||
|
|
@ -658,23 +658,23 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
}
|
||||
|
||||
// Check to see if there was any sort of a constaint typemap
|
||||
if ((tm = typemap_lookup((char*)"check",typemap_lang,p->t,p->name,source,target))) {
|
||||
if ((tm = typemap_lookup((char*)"check",typemap_lang,p->t,p->name,source.get(),target.get()))) {
|
||||
// Yep. Use it instead of the default
|
||||
f.code << tm << "\n";
|
||||
f.code.replace("$arg",source);
|
||||
f.code.replace("$arg",source.get());
|
||||
}
|
||||
|
||||
// Check if there was any cleanup code (save it for later)
|
||||
if ((tm = typemap_lookup((char*)"freearg",typemap_lang,p->t,p->name,source,target))) {
|
||||
if ((tm = typemap_lookup((char*)"freearg",typemap_lang,p->t,p->name,source.get(),target.get()))) {
|
||||
// Yep. Use it instead of the default
|
||||
cleanup << tm << "\n";
|
||||
cleanup.replace("$arg",source);
|
||||
cleanup.replace("$arg",source.get());
|
||||
}
|
||||
|
||||
if ((tm = typemap_lookup((char*)"argout",typemap_lang,p->t,p->name,source,target))) {
|
||||
if ((tm = typemap_lookup((char*)"argout",typemap_lang,p->t,p->name,source.get(),target.get()))) {
|
||||
// Yep. Use it instead of the default
|
||||
outarg << tm << "\n";
|
||||
outarg.replace("$arg",source);
|
||||
outarg.replace("$arg",source.get());
|
||||
} else {
|
||||
// if(p->t->is_pointer && p->t->type != T_USER && p->t->type != T_VOID) {
|
||||
if(p->t->is_pointer) {
|
||||
|
|
@ -718,7 +718,7 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
if(shadow && member_func) {
|
||||
fprintf(f_shadow, ") {\n");
|
||||
body << ")";
|
||||
fprintf(f_shadow, "%s;\n }\n\n", (char *) body);
|
||||
fprintf(f_shadow, "%s;\n }\n\n", (char *) body.get());
|
||||
}
|
||||
f.def << ") {";
|
||||
|
||||
|
|
@ -784,7 +784,7 @@ void JAVA::create_function(char *name, char *iname, DataType *t, ParmList *l)
|
|||
f.code << "}\n";
|
||||
|
||||
// Substitute the cleanup code (some exception handlers like to have this)
|
||||
f.code.replace("$cleanup",cleanup);
|
||||
f.code.replace("$cleanup",cleanup.get());
|
||||
|
||||
// Emit the function
|
||||
|
||||
|
|
@ -833,7 +833,7 @@ void JAVA::declare_const(char *name, char *iname, DataType *type, char *value) {
|
|||
if ((tm = typemap_lookup((char*)"const",typemap_lang,type,name,name,iname))) {
|
||||
String str = tm;
|
||||
str.replace("$value",value);
|
||||
fprintf(jfile," %s\n\n", (char *) str);
|
||||
fprintf(jfile," %s\n\n", (char *) str.get());
|
||||
} else {
|
||||
if((type->is_pointer == 0)) {
|
||||
char *jtype = typemap_lookup((char*)"jtype", typemap_lang, type, name, name, iname);
|
||||
|
|
@ -878,17 +878,17 @@ void JAVA::pragma(char *lang, char *code, char *value) {
|
|||
String s = value;
|
||||
s.replace("\\\"", "\"");
|
||||
if(strcmp(code, "import") == 0) {
|
||||
jimport = copy_string((char *) s);
|
||||
jimport = copy_string((char *) s.get());
|
||||
fprintf(f_java, "// pragma\nimport %s;\n\n", jimport);
|
||||
} else if(strcmp(code, "module") == 0) {
|
||||
if(!classdef_emitted) emit_classdef();
|
||||
fprintf(f_java, "// pragma\n");
|
||||
fprintf(f_java, (char *) s);
|
||||
fprintf(f_java, (char *) s.get());
|
||||
fprintf(f_java, "\n\n");
|
||||
} else if(strcmp(code, "shadow") == 0) {
|
||||
if(shadow && f_shadow) {
|
||||
fprintf(f_shadow, "// pragma\n");
|
||||
fprintf(f_shadow, (char *) s);
|
||||
fprintf(f_shadow, (char *) s.get());
|
||||
fprintf(f_shadow, "\n\n");
|
||||
}
|
||||
} else if(strcmp(code, "modifiers") == 0) {
|
||||
|
|
@ -985,7 +985,7 @@ void JAVA::emit_shadow_classdef() {
|
|||
|
||||
shadow_classdef << " public Class _selfClass() {\n" << tab4 << "return " << shadow_classname << ".class;\n" << " };\n\n";
|
||||
|
||||
fprintf(f_shadow, (char *) shadow_classdef);
|
||||
fprintf(f_shadow, (char *) shadow_classdef.get());
|
||||
|
||||
shadow_classdef_emitted = 1;
|
||||
}
|
||||
|
|
@ -1059,7 +1059,7 @@ void JAVA::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
}
|
||||
|
||||
// Add to java function header
|
||||
fprintf(f_shadow, "%s %s", (jstype) ? jstype : jtype, (char *) arg);
|
||||
fprintf(f_shadow, "%s %s", (jstype) ? jstype : jtype, (char *) arg.get());
|
||||
if(i != pcount-1) {
|
||||
fprintf(f_shadow, ", ");
|
||||
}
|
||||
|
|
@ -1072,7 +1072,7 @@ void JAVA::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
nativecall << ");\n";
|
||||
|
||||
fprintf(f_shadow, ") {\n");
|
||||
fprintf(f_shadow, "\t%s\n", (char *) nativecall);
|
||||
fprintf(f_shadow, "\t%s\n", (char *) nativecall.get());
|
||||
fprintf(f_shadow, " }\n\n");
|
||||
}
|
||||
|
||||
|
|
@ -1132,7 +1132,7 @@ void JAVA::cpp_static_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
}
|
||||
|
||||
// Add to java function header
|
||||
fprintf(f_shadow, "%s %s", (jstype) ? jstype : jtype, (char *) arg);
|
||||
fprintf(f_shadow, "%s %s", (jstype) ? jstype : jtype, (char *) arg.get());
|
||||
if(i != pcount-1) {
|
||||
fprintf(f_shadow, ", ");
|
||||
}
|
||||
|
|
@ -1145,7 +1145,7 @@ void JAVA::cpp_static_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
nativecall << ");\n";
|
||||
|
||||
fprintf(f_shadow, ") {\n");
|
||||
fprintf(f_shadow, "\t%s\n", (char *) nativecall);
|
||||
fprintf(f_shadow, "\t%s\n", (char *) nativecall.get());
|
||||
fprintf(f_shadow, " }\n\n");
|
||||
}
|
||||
|
||||
|
|
@ -1187,7 +1187,7 @@ void JAVA::cpp_constructor(char *name, char *iname, ParmList *l) {
|
|||
if(strcmp(jtype, jstype) == 0) jstype = NULL;
|
||||
|
||||
// Add to java function header
|
||||
fprintf(f_shadow, "%s %s", (jstype) ? jstype : jtype, (char *) arg);
|
||||
fprintf(f_shadow, "%s %s", (jstype) ? jstype : jtype, (char *) arg.get());
|
||||
|
||||
if(p->t->type == T_USER && p->t->is_pointer <= 1 && Getattr(shadow_classes,p->t->name)) {
|
||||
nativecall << arg << "._self";
|
||||
|
|
@ -1205,7 +1205,7 @@ void JAVA::cpp_constructor(char *name, char *iname, ParmList *l) {
|
|||
nativecall << tab8 << " _selfown = true;\n";
|
||||
nativecall << " }\n";
|
||||
|
||||
fprintf(f_shadow, "%s", (char *) nativecall);
|
||||
fprintf(f_shadow, "%s", (char *) nativecall.get());
|
||||
fprintf(f_shadow, " }\n\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -269,9 +269,9 @@ MZSCHEME::get_pointer (String &name, int parm, DataType *t,
|
|||
static void
|
||||
mreplace (String &s, String &argnum, String &arg, String &proc_name)
|
||||
{
|
||||
s.replace ("$argnum", argnum);
|
||||
s.replace ("$arg", arg);
|
||||
s.replace ("$name", proc_name);
|
||||
s.replace ("$argnum", argnum.get());
|
||||
s.replace ("$arg", arg.get());
|
||||
s.replace ("$name", proc_name.get());
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -365,7 +365,7 @@ MZSCHEME::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
else {
|
||||
++numargs;
|
||||
if ((tm = typemap_lookup ((char*)"in", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
f.code << tm << "\n";
|
||||
mreplace (f.code, argnum, arg, proc_name);
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ MZSCHEME::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
// Check if there are any constraints.
|
||||
|
||||
if ((tm = typemap_lookup ((char*)"check", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
// Yep. Use it instead of the default
|
||||
f.code << tm << "\n";
|
||||
mreplace (f.code, argnum, arg, proc_name);
|
||||
|
|
@ -390,7 +390,7 @@ MZSCHEME::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
// Pass output arguments back to the caller.
|
||||
|
||||
if ((tm = typemap_lookup ((char*)"argout", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
// Yep. Use it instead of the default
|
||||
outarg << tm << "\n";
|
||||
mreplace (outarg, argnum, arg, proc_name);
|
||||
|
|
@ -399,7 +399,7 @@ MZSCHEME::create_function (char *name, char *iname, DataType *d, ParmList *l)
|
|||
|
||||
// Free up any memory allocated for the arguments.
|
||||
if ((tm = typemap_lookup ((char*)"freearg", typemap_lang,
|
||||
p.t, p.name, source, target, &f))) {
|
||||
p.t, p.name, source.get(), target.get(), &f))) {
|
||||
// Yep. Use it instead of the default
|
||||
cleanup << tm << "\n";
|
||||
mreplace (cleanup, argnum, arg, proc_name);
|
||||
|
|
|
|||
|
|
@ -969,7 +969,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
f.add_local((char*)"dXSARGS",(char*)"");
|
||||
|
||||
// Substitute the cleanup code
|
||||
f.code.replace("$cleanup",cleanup);
|
||||
f.code.replace("$cleanup",cleanup.get());
|
||||
f.code.replace("$name",iname);
|
||||
|
||||
// Dump this function out
|
||||
|
|
@ -1017,7 +1017,7 @@ void PERL5::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
String sourceNtarget;
|
||||
sourceNtarget << "$args[" << i << "]";
|
||||
|
||||
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",p->t,(char*)"",sourceNtarget,sourceNtarget)))
|
||||
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",p->t,(char*)"",sourceNtarget.get(),sourceNtarget.get())))
|
||||
func << tm << "\n";
|
||||
else if ((Getattr(classes,p->t->name)) && (p->t->is_pointer <= 1)) {
|
||||
if (i >= (pcount - numopt))
|
||||
|
|
@ -1632,7 +1632,7 @@ void PERL5::cpp_open_class(char *classname, char *rname, char *ctype, int strip)
|
|||
// Add some symbols to the hash tables
|
||||
|
||||
// classes.add(real_classname,copy_string(class_name)); /* Map original classname to class */
|
||||
Setattr(classes,real_classname,fullclassname);
|
||||
Setattr(classes,real_classname,fullclassname.get());
|
||||
|
||||
// Add full name of datatype to the hash table just in case the user uses it
|
||||
|
||||
|
|
@ -1813,7 +1813,7 @@ void PERL5::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
String sourceNtarget;
|
||||
sourceNtarget << "$args[" << i << "]";
|
||||
|
||||
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",p->t,(char*)"",sourceNtarget,sourceNtarget)))
|
||||
if ((tm = typemap_lookup((char*)"perl5in",(char*)"perl5",p->t,(char*)"",sourceNtarget.get(),sourceNtarget.get())))
|
||||
func << tm << "\n";
|
||||
// Look up the datatype name here
|
||||
else if ((Getattr(classes,p->t->name)) && (p->t->is_pointer <= 1)) {
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ void PYTHON::close(void)
|
|||
<< "\n\n#-------------- VARIABLE WRAPPERS ------------------\n\n"
|
||||
<< vars;
|
||||
|
||||
if (strlen(pragma_include) > 0) {
|
||||
if (strlen(pragma_include.get()) > 0) {
|
||||
fullshadow << "\n\n#-------------- USER INCLUDE -----------------------\n\n"
|
||||
<< pragma_include;
|
||||
}
|
||||
|
|
@ -600,7 +600,7 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
// should modify this to return the appropriate types and use the
|
||||
// appropriate parameters.
|
||||
|
||||
emit_function_header(f, wname);
|
||||
emit_function_header(f, wname.get());
|
||||
|
||||
f.add_local((char*)"PyObject *",(char*)"_resultobj");
|
||||
|
||||
|
|
@ -835,7 +835,7 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
|
||||
call_name = "";
|
||||
call_name << self_name << name;
|
||||
emit_func_call(call_name,d,l,f);
|
||||
emit_func_call(call_name.get(),d,l,f);
|
||||
|
||||
// Now emit code to return the functions return value (if any).
|
||||
// If there was a result, it was saved in _result.
|
||||
|
|
@ -952,7 +952,7 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
f.code << "}\n";
|
||||
|
||||
// Substitute the cleanup code
|
||||
f.code.replace("$cleanup",cleanup);
|
||||
f.code.replace("$cleanup",cleanup.get());
|
||||
|
||||
// Substitute the function name
|
||||
f.code.replace("$name",iname);
|
||||
|
|
@ -962,7 +962,7 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
|
||||
// Now register the function with the interpreter.
|
||||
|
||||
add_method(iname, wname, use_kw);
|
||||
add_method(iname, wname.get(), use_kw);
|
||||
|
||||
#ifdef SHADOW_METHODS
|
||||
if (shadow && (shadow & PYSHADOW_MEMBER)) {
|
||||
|
|
@ -1500,8 +1500,8 @@ void PYTHON::cpp_pragma(Pragma *plist) {
|
|||
pragmas = 0;
|
||||
}
|
||||
while (plist) {
|
||||
if (strcmp(plist->lang,(char*)"python") == 0) {
|
||||
if (strcmp(plist->name,"addtomethod") == 0) {
|
||||
if (strcmp(plist->lang.get(),(char*)"python") == 0) {
|
||||
if (strcmp(plist->name.get(),"addtomethod") == 0) {
|
||||
// parse value, expected to be in the form "methodName:line"
|
||||
String temp = plist->value;
|
||||
char* txtptr = strchr(temp.get(), ':');
|
||||
|
|
@ -1509,7 +1509,7 @@ void PYTHON::cpp_pragma(Pragma *plist) {
|
|||
// add name and line to a list in current_class
|
||||
*txtptr = 0;
|
||||
txtptr++;
|
||||
pyp1 = new PyPragma(temp,txtptr);
|
||||
pyp1 = new PyPragma(temp.get(),txtptr);
|
||||
if (pyp2) {
|
||||
pyp2->next = pyp1;
|
||||
pyp2 = pyp1;
|
||||
|
|
@ -1521,8 +1521,8 @@ void PYTHON::cpp_pragma(Pragma *plist) {
|
|||
fprintf(stderr,"%s : Line %d. Malformed addtomethod pragma. Should be \"methodName:text\"\n",
|
||||
plist->filename.get(),plist->lineno);
|
||||
}
|
||||
} else if (strcmp(plist->name, "addtoclass") == 0) {
|
||||
pyp1 = new PyPragma((char*)"__class__",plist->value);
|
||||
} else if (strcmp(plist->name.get(), "addtoclass") == 0) {
|
||||
pyp1 = new PyPragma((char*)"__class__",plist->value.get());
|
||||
if (pyp2) {
|
||||
pyp2->next = pyp1;
|
||||
pyp2 = pyp1;
|
||||
|
|
@ -1547,7 +1547,7 @@ void PYTHON::emitAddPragmas(String& output, char* name, char* spacing)
|
|||
{
|
||||
PyPragma *p = pragmas;
|
||||
while (p) {
|
||||
if (strcmp(p->m_method,name) == 0) {
|
||||
if (strcmp(p->m_method.get(),name) == 0) {
|
||||
output << spacing << p->m_text << "\n";
|
||||
}
|
||||
p = p->next;
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ void TCL8::create_function(char *name, char *iname, DataType *d, ParmList *l)
|
|||
f.code << tab4 << "return TCL_OK;\n}";
|
||||
|
||||
// Substitute the cleanup code
|
||||
f.code.replace("$cleanup",cleanup);
|
||||
f.code.replace("$cleanup",cleanup.get());
|
||||
f.code.replace("$name",iname);
|
||||
|
||||
// Dump out the function
|
||||
|
|
@ -1154,7 +1154,7 @@ char * TCL8::usage_string(char *iname, DataType *, ParmList *l) {
|
|||
}
|
||||
p = l->get_next();
|
||||
}
|
||||
return temp;
|
||||
return temp.get();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -1172,7 +1172,7 @@ char * TCL8::usage_func(char *iname, DataType *t, ParmList *l) {
|
|||
} else {
|
||||
temp << prefix << iname;
|
||||
}
|
||||
return usage_string(temp,t,l);
|
||||
return usage_string(temp.get(),t,l);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
|
@ -1327,7 +1327,7 @@ void TCL8::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l) {
|
|||
|
||||
temp = "";
|
||||
temp << Swig_name_member(class_name,realname);
|
||||
rname = GetChar(repeatcmd,temp);
|
||||
rname = GetChar(repeatcmd,temp.get());
|
||||
if (!rname)
|
||||
rname = Swig_name_wrapper(temp.get());
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@ void TCL8::cpp_variable(char *name, char *iname, DataType *t) {
|
|||
// Try to figure out if there is a wrapper for this function
|
||||
temp = "";
|
||||
temp << Swig_name_get(Swig_name_member(bc,realname));
|
||||
rname = GetChar(repeatcmd,temp);
|
||||
rname = GetChar(repeatcmd,temp.get());
|
||||
if (!rname)
|
||||
rname = Swig_name_wrapper(temp.get());
|
||||
attributes << rname << ", ";
|
||||
|
|
@ -1363,7 +1363,7 @@ void TCL8::cpp_variable(char *name, char *iname, DataType *t) {
|
|||
if (!(Status & STAT_READONLY)) {
|
||||
temp = "";
|
||||
temp << Swig_name_set(Swig_name_member(bc,realname));
|
||||
rname = GetChar(repeatcmd,temp);
|
||||
rname = GetChar(repeatcmd,temp.get());
|
||||
if (!rname)
|
||||
rname = Swig_name_wrapper(temp.get());
|
||||
attributes << rname << "},\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue