From: Marcelo M. <mar...@us...> - 2005-12-31 10:37:40
|
Update of /cvsroot/swig/SWIG/Source/Swig In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17008 Modified Files: misc.c naming.c stype.c swig.h symbol.c typesys.c Log Message: add naming init and other string cosmetics Index: swig.h =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/swig.h,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** swig.h 27 Dec 2005 21:48:56 -0000 1.111 --- swig.h 31 Dec 2005 10:37:28 -0000 1.112 *************** *** 545,548 **** --- 545,552 ---- + /* -- naming init -- */ + extern void Swig_naming_init(); + + #ifdef __cplusplus } Index: naming.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/naming.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** naming.c 30 Dec 2005 00:00:32 -0000 1.30 --- naming.c 31 Dec 2005 10:37:27 -0000 1.31 *************** *** 20,23 **** --- 20,61 ---- /* #define SWIG_DEBUG */ + + /* ----------------------------------------------------------------------------- + * Swig_naming_init() + * + * Init the naming system + * ----------------------------------------------------------------------------- */ + static String *k_construct = 0; + static String *k_constructor = 0; + static String *k_destroy= 0; + static String *k_destructor = 0; + static String *k_disown = 0; + static String *k_name = 0; + static String *k_start = 0; + static String *k_value = 0; + static String *k_wrapper = 0; + static String *k_nodetype = 0; + static String *k_member = 0; + static String *k_get = 0; + static String *k_set = 0; + + void + Swig_naming_init() { + k_construct = NewString("construct"); + k_constructor = NewString("constructor"); + k_destroy = NewString("destroy"); + k_destructor = NewString("destructor"); + k_disown = NewString("disown"); + k_name = NewString("name"); + k_nodetype = NewString("nodeType"); + k_start = NewString("*"); + k_value = NewString("value"); + k_wrapper = NewString("wrapper"); + k_member = NewString("member"); + k_set = NewString("set"); + k_get = NewString("get"); + } + + /* ----------------------------------------------------------------------------- * Swig_name_register() *************** *** 150,154 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"wrapper"); if (!f) { Append(r,"_wrap_%f"); --- 188,192 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_wrapper); if (!f) { Append(r,"_wrap_%f"); *************** *** 178,182 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"member"); if (!f) { Append(r,"%c_%m"); --- 216,220 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_member); if (!f) { Append(r,"%c_%m"); *************** *** 214,218 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"get"); if (!f) { Append(r,"%v_get"); --- 252,256 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_get); if (!f) { Append(r,"%v_get"); *************** *** 238,242 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"set"); if (!f) { Append(r,"%v_set"); --- 276,280 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_set); if (!f) { Append(r,"%v_set"); *************** *** 265,269 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"construct"); if (!f) { Append(r,"new_%c"); --- 303,307 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_construct); if (!f) { Append(r,"new_%c"); *************** *** 300,304 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"construct"); if (!f) { Append(r,"copy_%c"); --- 338,342 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_construct); if (!f) { Append(r,"copy_%c"); *************** *** 333,337 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"destroy"); if (!f) { Append(r,"delete_%c"); --- 371,375 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_destroy); if (!f) { Append(r,"delete_%c"); *************** *** 366,370 **** r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,"disown"); if (!f) { Append(r,"disown_%c"); --- 404,408 ---- r = NewStringEmpty(); if (!naming_hash) naming_hash = NewHash(); ! f = Getattr(naming_hash,k_disown); if (!f) { Append(r,"disown_%c"); *************** *** 406,410 **** /* Add an object based on the declarator value */ if (!decl) { ! Setattr(n,"*",object); } else { SwigType *cd = Copy(decl); --- 444,448 ---- /* Add an object based on the declarator value */ if (!decl) { ! Setattr(n,k_start,object); } else { SwigType *cd = Copy(decl); *************** *** 428,432 **** rn = Getattr(n,decl); } else { ! rn = Getattr(n,"*"); } return rn; --- 466,470 ---- rn = Getattr(n,decl); } else { ! rn = Getattr(n,k_start); } return rn; *************** *** 448,452 **** DOH * Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType *decl) { ! String *tname; DOH *rn = 0; char *ncdecl = 0; --- 486,490 ---- DOH * Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType *decl) { ! String *tname = NewStringEmpty(); DOH *rn = 0; char *ncdecl = 0; *************** *** 464,509 **** if (prefix) { if (Len(prefix)) { ! tname = NewStringf("%s::%s",prefix,name); rn = name_object_get(namehash, tname, decl, ncdecl); - Delete(tname); if (!rn) { String *cls = Swig_scopename_last(prefix); ! if (Strcmp(cls,prefix)!= 0) { ! tname = NewStringf("*::%s::%s",cls,name); rn = name_object_get(namehash, tname, decl, ncdecl); - Delete(tname); } Delete(cls); ! } /* A template-based class lookup, check name first */ if (!rn && SwigType_istemplate(name)) { ! String *tname = SwigType_templateprefix(name); ! if (Strcmp(tname,name) != 0) { ! rn = Swig_name_object_get(namehash, prefix, tname, decl); } ! Delete(tname); } /* A template-based class lookup */ if (!rn && SwigType_istemplate(prefix)) { ! String *tprefix = SwigType_templateprefix(prefix); ! if (Strcmp(tprefix,prefix) != 0) { ! String *tname = SwigType_templateprefix(name); ! rn = Swig_name_object_get(namehash, tprefix, tname, decl); ! Delete(tname); } - Delete(tprefix); } } - /* A wildcard-based class lookup */ if (!rn) { ! tname = NewStringf("*::%s",name); rn = name_object_get(namehash, tname, decl, ncdecl); - Delete(tname); } } else { /* Lookup in the global namespace only */ ! tname = NewStringf("::%s",name); rn = name_object_get(namehash, tname, decl, ncdecl); - Delete(tname); } /* Catch-all */ --- 502,551 ---- if (prefix) { if (Len(prefix)) { ! Printf(tname,"%s::%s", prefix, name); rn = name_object_get(namehash, tname, decl, ncdecl); if (!rn) { String *cls = Swig_scopename_last(prefix); ! if (!Equal(cls,prefix)) { ! Clear(tname); ! Printf(tname,"*::%s::%s",cls,name); rn = name_object_get(namehash, tname, decl, ncdecl); } Delete(cls); ! } /* A template-based class lookup, check name first */ if (!rn && SwigType_istemplate(name)) { ! String *t_name = SwigType_templateprefix(name); ! if (!Equal(t_name,name)) { ! rn = Swig_name_object_get(namehash, prefix, t_name, decl); } ! Delete(t_name); } /* A template-based class lookup */ if (!rn && SwigType_istemplate(prefix)) { ! String *t_prefix = SwigType_templateprefix(prefix); ! if (Strcmp(t_prefix,prefix) != 0) { ! String *t_name = SwigType_templateprefix(name); ! rn = Swig_name_object_get(namehash, t_prefix, t_name, decl); ! Delete(t_name); ! } ! Delete(t_prefix); ! } ! /* A wildcard-based class lookup */ ! if (!rn) { ! if (!Equal(name,k_start)) { ! rn = Swig_name_object_get(namehash, prefix, k_start, decl); } } } if (!rn) { ! Clear(tname); ! Printf(tname,"*::%s",name); rn = name_object_get(namehash, tname, decl, ncdecl); } } else { /* Lookup in the global namespace only */ ! Clear(tname); ! Printf(tname,"::%s",name); rn = name_object_get(namehash, tname, decl, ncdecl); } /* Catch-all */ *************** *** 511,514 **** --- 553,560 ---- rn = name_object_get(namehash, name, decl, ncdecl); } + if (!rn) { + rn = name_object_get(namehash, k_start, decl, ncdecl); + } + Delete(tname); return rn; } *************** *** 537,547 **** char *k = Char(ki.key); if (strncmp(k,cbprefix,plen) == 0) { - Hash *n, *newh; - String *nkey; Iterator oi; ! ! nkey = NewStringf("%s%s",dprefix,k+plen); ! n = ki.item; ! newh = Getattr(namehash,nkey); if (!newh) { newh = NewHash(); --- 583,590 ---- char *k = Char(ki.key); if (strncmp(k,cbprefix,plen) == 0) { Iterator oi; ! String *nkey = NewStringf("%s%s",dprefix,k+plen); ! Hash *n = ki.item; ! Hash *newh = Getattr(namehash,nkey); if (!newh) { newh = NewHash(); *************** *** 556,561 **** --- 599,607 ---- } } + Delete(nkey); } } + Delete(bprefix); + Delete(dprefix); } *************** *** 600,604 **** void Swig_features_get(Hash *features, String *prefix, String *name, SwigType *decl, Node *node) { - String *tname; char *ncdecl = 0; String *rdecl = 0; --- 646,649 ---- *************** *** 616,635 **** /* very specific hack for template constructors/destructors */ if (name && SwigType_istemplate(name) && ! ((Strcmp(nodeType(node),"constructor") == 0) ! || (Strcmp(nodeType(node),"destructor") == 0))) { ! String *prefix = NewStringEmpty(); ! String *last = NewStringEmpty(); String *tprefix; ! Swig_scopename_split(name, &prefix, &last); ! tprefix = SwigType_templateprefix(last); ! Delete(last); ! if (Len(prefix)) { ! Append(prefix,"::"); ! Append(prefix,tprefix); Delete(tprefix); ! rname = prefix; } else { rname = tprefix; ! Delete(prefix); } rdecl = Copy(decl); --- 661,680 ---- /* very specific hack for template constructors/destructors */ if (name && SwigType_istemplate(name) && ! (HashCheckAttr(node,k_nodetype,k_constructor) ! || HashCheckAttr(node, k_nodetype,k_destructor))) { ! String *nprefix = NewStringEmpty(); ! String *nlast = NewStringEmpty(); String *tprefix; ! Swig_scopename_split(name, &nprefix, &nlast); ! tprefix = SwigType_templateprefix(nlast); ! Delete(nlast); ! if (Len(nprefix)) { ! Append(nprefix,"::"); ! Append(nprefix,tprefix); Delete(tprefix); ! rname = nprefix; } else { rname = tprefix; ! Delete(nprefix); } rdecl = Copy(decl); *************** *** 646,649 **** --- 691,695 ---- features_get(features, "", 0, 0, node); if (name) { + String *tname = NewStringEmpty(); /* Catch-all */ features_get(features, name, decl, ncdecl, node); *************** *** 652,663 **** /* A class-generic feature */ if (Len(prefix)) { ! tname = NewStringf("%s::",prefix); features_get(features, tname, decl, ncdecl, node); - Delete(tname); } /* A wildcard-based class lookup */ ! tname = NewStringf("*::%s",name); features_get(features, tname, decl, ncdecl, node); - Delete(tname); /* A specific class lookup */ if (Len(prefix)) { --- 698,708 ---- /* A class-generic feature */ if (Len(prefix)) { ! Printf(tname,"%s::",prefix); features_get(features, tname, decl, ncdecl, node); } /* A wildcard-based class lookup */ ! Clear(tname); ! Printf(tname,"*::%s",name); features_get(features, tname, decl, ncdecl, node); /* A specific class lookup */ if (Len(prefix)) { *************** *** 665,683 **** if (SwigType_istemplate(prefix)) { String *tprefix = SwigType_templateprefix(prefix); ! tname = NewStringf("%s::%s",tprefix,name); features_get(features, tname, decl, ncdecl, node); - Delete(tname); Delete(tprefix); } ! tname = NewStringf("%s::%s",prefix,name); features_get(features, tname, decl, ncdecl, node); - Delete(tname); } } else { /* Lookup in the global namespace only */ ! tname = NewStringf("::%s",name); features_get(features, tname, decl, ncdecl, node); - Delete(tname); } } if (name && SwigType_istemplate(name)) { --- 710,729 ---- if (SwigType_istemplate(prefix)) { String *tprefix = SwigType_templateprefix(prefix); ! Clear(tname); ! Printf(tname,"%s::%s",tprefix,name); features_get(features, tname, decl, ncdecl, node); Delete(tprefix); } ! Clear(tname); ! Printf(tname,"%s::%s",prefix,name); features_get(features, tname, decl, ncdecl, node); } } else { /* Lookup in the global namespace only */ ! Clear(tname); ! Printf(tname,"::%s",name); features_get(features, tname, decl, ncdecl, node); } + Delete(tname); } if (name && SwigType_istemplate(name)) { *************** *** 718,725 **** } if (!decl) { ! fhash = Getattr(n,"*"); if (!fhash) { fhash = NewHash(); ! Setattr(n,"*",fhash); Delete(fhash); } --- 764,771 ---- } if (!decl) { ! fhash = Getattr(n,k_start); if (!fhash) { fhash = NewHash(); ! Setattr(n,k_start,fhash); Delete(fhash); } *************** *** 744,751 **** Hash *attribs = featureattribs; while(attribs) { ! String *attribname = Getattr(attribs,"name"); String *featureattribname = NewStringf("%s:%s", featurename, attribname); if (value) { ! String *attribvalue = Getattr(attribs,"value"); Setattr(fhash,featureattribname,attribvalue); } else { --- 790,797 ---- Hash *attribs = featureattribs; while(attribs) { ! String *attribname = Getattr(attribs,k_name); String *featureattribname = NewStringf("%s:%s", featurename, attribname); if (value) { ! String *attribvalue = Getattr(attribs,k_value); Setattr(fhash,featureattribname,attribvalue); } else { *************** *** 753,756 **** --- 799,803 ---- } attribs = nextSibling(attribs); + Delete(featureattribname); } } Index: misc.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/misc.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** misc.c 1 Dec 2005 00:07:07 -0000 1.33 --- misc.c 31 Dec 2005 10:37:27 -0000 1.34 *************** *** 13,19 **** --- 13,21 ---- #include "swig.h" + #include <errno.h> #include <ctype.h> #include <limits.h> + /* ----------------------------------------------------------------------------- * Swig_copy_string() *************** *** 356,359 **** --- 358,366 ---- } + String *Swig_string_emangle(String *s) { + return Swig_string_mangle(s); + } + + /* ----------------------------------------------------------------------------- * Swig_scopename_prefix() *************** *** 615,618 **** --- 622,655 ---- } + /* ----------------------------------------------------------------------------- + * Swig_string_command() + * + * ----------------------------------------------------------------------------- */ + + #if defined(HAVE_POPEN) + extern FILE *popen(const char *command, const char *type); + extern int pclose(FILE *stream); + + String *Swig_string_command(String *s) { + String *res = NewStringEmpty(); + if (Len(s)) { + char *command = Char(s); + FILE *fp = popen(command,"r"); + if (fp) { + char buffer[1025]; + while(fscanf(fp,"%1024s",buffer) != EOF) { + Append(res,buffer); + } + pclose(fp); + } + if (!fp || (errno) || (StringLen(res) == 0)) { + Swig_error("SWIG",Getline(s), "Command encoder fails attempting '%s'.\n", s); + exit(1); + } + } + return res; + } + #endif + /* ----------------------------------------------------------------------------- *************** *** 630,633 **** --- 667,674 ---- DohEncoding("title", Swig_string_title); DohEncoding("typecode",Swig_string_typecode); + DohEncoding("mangle",Swig_string_emangle); + #if defined(HAVE_POPEN) + DohEncoding("command",Swig_string_command); + #endif /* Initialize typemaps */ *************** *** 637,640 **** --- 678,684 ---- Swig_symbol_init(); + /* Initialize naming system */ + Swig_naming_init(); + /* Initialize type system */ SwigType_typesystem_init(); *************** *** 642,645 **** /* Initialize template system */ SwigType_template_init(); - } --- 686,688 ---- Index: typesys.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/typesys.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** typesys.c 4 Dec 2005 01:16:57 -0000 1.46 --- typesys.c 31 Dec 2005 10:37:28 -0000 1.47 *************** *** 122,125 **** --- 122,126 ---- static String *k_value = 0; static String *k_nodetype = 0; + static String *k_class = 0; /* *************** *** 160,163 **** --- 161,165 ---- k_value = NewString("value"); k_nodetype = NewString("nodeType"); + k_class = NewString("class"); if (global_scope) Delete(global_scope); *************** *** 1285,1289 **** use_wrapper = 1; } else { ! if ((Strcmp(nodeType(n),"class") == 0) && (!Getattr(n,"allocate:default_constructor") || (Getattr(n,"allocate:noassign")))) { --- 1287,1291 ---- use_wrapper = 1; } else { ! if (HashCheckAttr(n,k_nodetype,k_class) && (!Getattr(n,"allocate:default_constructor") || (Getattr(n,"allocate:noassign")))) { *************** *** 1314,1318 **** if (SwigType_type(td) == T_USER) { if ((n = Swig_symbol_clookup(td,0))) { ! if (((Strcmp(nodeType(n),"class") == 0) && !Getattr(n,"allocate:noassign") && (Getattr(n,"allocate:default_constructor"))) --- 1316,1320 ---- if (SwigType_type(td) == T_USER) { if ((n = Swig_symbol_clookup(td,0))) { ! if ((HashCheckAttr(n,k_nodetype,k_class) && !Getattr(n,"allocate:noassign") && (Getattr(n,"allocate:default_constructor"))) Index: symbol.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/symbol.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** symbol.c 27 Dec 2005 21:50:24 -0000 1.44 --- symbol.c 31 Dec 2005 10:37:28 -0000 1.45 *************** *** 230,234 **** /* ----------------------------------------------------------------------------- ! * Swig_symbol_new() * * Create a new symbol table object --- 230,234 ---- /* ----------------------------------------------------------------------------- ! * Swig_symbol_init() * * Create a new symbol table object Index: stype.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/stype.c,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** stype.c 23 Dec 2005 10:10:38 -0000 1.67 --- stype.c 31 Dec 2005 10:37:27 -0000 1.68 *************** *** 326,334 **** { if (Strcmp(nr,"SWIGTYPE") == 0) { ! Append(def,"SWIGTYPE"); } else { String *q = SwigType_isqualifier(nr) ? SwigType_pop(nr) : 0; if (q && strstr(Char(nr),"SWIGTYPE")) { ! Append(def, nr); } else { String *nd = SwigType_default(nr); --- 326,334 ---- { if (Strcmp(nr,"SWIGTYPE") == 0) { ! StringAppend(def,"SWIGTYPE"); } else { String *q = SwigType_isqualifier(nr) ? SwigType_pop(nr) : 0; if (q && strstr(Char(nr),"SWIGTYPE")) { ! StringAppend(def, nr); } else { String *nd = SwigType_default(nr); *************** *** 344,351 **** } } ! Append(def,bdef); Delete(bdef); } else { ! Append(def,nr); } } --- 344,351 ---- } } ! StringAppend(def,bdef); Delete(bdef); } else { ! StringAppend(def,nr); } } *************** *** 441,445 **** SwigType_add_default(def, nr); #else ! Append(def,"SWIGTYPE"); #endif Delete(nr); --- 441,445 ---- SwigType_add_default(def, nr); #else ! StringAppend(def,"SWIGTYPE"); #endif Delete(nr); *************** *** 518,522 **** for (i = 0; i < sz; i++) { String *str = SwigType_str(Getitem(p,i),0); ! Append(r,str); if ((i+1) < sz) Putc(',',r); Delete(str); --- 518,522 ---- for (i = 0; i < sz; i++) { String *str = SwigType_str(Getitem(p,i),0); ! StringAppend(r,str); if ((i+1) < sz) Putc(',',r); Delete(str); *************** *** 525,529 **** Putc('>',r); suffix = SwigType_templatesuffix(t); ! Append(r,suffix); Delete(suffix); Delete(p); --- 525,529 ---- Putc('>',r); suffix = SwigType_templatesuffix(t); ! StringAppend(r,suffix); Delete(suffix); Delete(p); *************** *** 581,585 **** if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! Append(result,")"); } } else if (SwigType_ismemberpointer(element)) { --- 581,585 ---- if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! StringAppend(result,")"); } } else if (SwigType_ismemberpointer(element)) { *************** *** 590,594 **** if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! Append(result,")"); } Delete(q); --- 590,594 ---- if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! StringAppend(result,")"); } Delete(q); *************** *** 598,622 **** if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! Append(result,")"); } } else if (SwigType_isarray(element)) { DOH *size; ! Append(result,"["); size = SwigType_parm(element); ! Append(result,size); ! Append(result,"]"); Delete(size); } else if (SwigType_isfunction(element)) { DOH *parms, *p; int j, plen; ! Append(result,"("); parms = SwigType_parmlist(element); plen = Len(parms); for (j = 0; j < plen; j++) { p = SwigType_str(Getitem(parms,j),0); ! Append(result,p); ! if (j < (plen-1)) Append(result,","); } ! Append(result,")"); Delete(parms); } else { --- 598,622 ---- if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! StringAppend(result,")"); } } else if (SwigType_isarray(element)) { DOH *size; ! StringAppend(result,"["); size = SwigType_parm(element); ! StringAppend(result,size); ! StringAppend(result,"]"); Delete(size); } else if (SwigType_isfunction(element)) { DOH *parms, *p; int j, plen; ! StringAppend(result,"("); parms = SwigType_parmlist(element); plen = Len(parms); for (j = 0; j < plen; j++) { p = SwigType_str(Getitem(parms,j),0); ! StringAppend(result,p); ! if (j < (plen-1)) StringAppend(result,","); } ! StringAppend(result,")"); Delete(parms); } else { *************** *** 683,703 **** /* Do nothing. Ignore */ } else if (SwigType_ispointer(element)) { ! Append(result,element); firstarray = 0; } else if (SwigType_ismemberpointer(element)) { ! Append(result,element); firstarray = 0; } else if (SwigType_isreference(element)) { if (notypeconv) { ! Append(result,element); } else { ! Append(result,"p."); } firstarray = 0; } else if (SwigType_isarray(element) && firstarray) { if (notypeconv) { ! Append(result,element); } else { ! Append(result,"p."); } firstarray = 0; --- 683,703 ---- /* Do nothing. Ignore */ } else if (SwigType_ispointer(element)) { ! StringAppend(result,element); firstarray = 0; } else if (SwigType_ismemberpointer(element)) { ! StringAppend(result,element); firstarray = 0; } else if (SwigType_isreference(element)) { if (notypeconv) { ! StringAppend(result,element); } else { ! StringAppend(result,"p."); } firstarray = 0; } else if (SwigType_isarray(element) && firstarray) { if (notypeconv) { ! StringAppend(result,element); } else { ! StringAppend(result,"p."); } firstarray = 0; *************** *** 705,714 **** int anonymous_enum = (Cmp(element,"enum ") == 0); if (notypeconv || !anonymous_enum) { ! Append(result,element); } else { ! Append(result,"int"); } } else { ! Append(result,element); } } --- 705,714 ---- int anonymous_enum = (Cmp(element,"enum ") == 0); if (notypeconv || !anonymous_enum) { ! StringAppend(result,element); } else { ! StringAppend(result,"int"); } } else { ! StringAppend(result,element); } } *************** *** 806,810 **** if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! Append(result,")"); } firstarray = 0; --- 806,810 ---- if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! StringAppend(result,")"); } firstarray = 0; *************** *** 817,821 **** if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! Append(result,")"); } firstarray = 0; --- 817,821 ---- if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! StringAppend(result,")"); } firstarray = 0; *************** *** 824,828 **** if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! Append(result,")"); } isreference = 1; --- 824,828 ---- if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) { Insert(result,0,"("); ! StringAppend(result,")"); } isreference = 1; *************** *** 830,840 **** DOH *size; if (firstarray && !isreference) { ! Append(result,"(*)"); firstarray = 0; } else { ! Append(result,"["); size = SwigType_parm(element); ! Append(result,size); ! Append(result,"]"); Delete(size); clear = 0; --- 830,840 ---- DOH *size; if (firstarray && !isreference) { ! StringAppend(result,"(*)"); firstarray = 0; } else { ! StringAppend(result,"["); size = SwigType_parm(element); ! StringAppend(result,size); ! StringAppend(result,"]"); Delete(size); clear = 0; *************** *** 844,857 **** DOH *parms, *p; int j, plen; ! Append(result,"("); parms = SwigType_parmlist(element); plen = Len(parms); for (j = 0; j < plen; j++) { p = SwigType_str(Getitem(parms,j),0); ! Append(result,p); Delete(p); ! if (j < (plen-1)) Append(result,","); } ! Append(result,")"); Delete(parms); } else { --- 844,857 ---- DOH *parms, *p; int j, plen; ! StringAppend(result,"("); parms = SwigType_parmlist(element); plen = Len(parms); for (j = 0; j < plen; j++) { p = SwigType_str(Getitem(parms,j),0); ! StringAppend(result,p); Delete(p); ! if (j < (plen-1)) StringAppend(result,","); } ! StringAppend(result,")"); Delete(parms); } else { *************** *** 872,878 **** if (isreference) { if (isarray) Clear(cast); ! Append(cast,"*"); } ! Append(cast,name); } Delete(result); --- 872,878 ---- if (isreference) { if (isarray) Clear(cast); ! StringAppend(cast,"*"); } ! StringAppend(cast,name); } Delete(result); *************** *** 918,922 **** String *SwigType_manglestr_default(SwigType *s) { char *c; ! String *result,*base; SwigType *lt; SwigType *sr = SwigType_typedef_qualified(s); --- 918,923 ---- String *SwigType_manglestr_default(SwigType *s) { char *c; ! String *result = 0; ! String *base = 0; SwigType *lt; SwigType *sr = SwigType_typedef_qualified(s); *************** *** 966,970 **** c++; } ! Append(result,base); Insert(result,0,"_"); Delete(lt); --- 967,971 ---- c++; } ! StringAppend(result,base); Insert(result,0,"_"); Delete(lt); *************** *** 1059,1063 **** } Clear(t); ! Append(t,nt); Delete(nt); Delete(elem); --- 1060,1064 ---- } Clear(t); ! StringAppend(t,nt); Delete(nt); Delete(elem); |