use direct methods for string, hash and avoid Strstr/Strnstr
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7893 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2392a85703
commit
d4e1bae364
7 changed files with 193 additions and 171 deletions
|
|
@ -328,7 +328,7 @@ void SwigType_add_default(String *def, SwigType *nr)
|
||||||
Append(def,"SWIGTYPE");
|
Append(def,"SWIGTYPE");
|
||||||
} else {
|
} else {
|
||||||
String *q = SwigType_isqualifier(nr) ? SwigType_pop(nr) : 0;
|
String *q = SwigType_isqualifier(nr) ? SwigType_pop(nr) : 0;
|
||||||
if (q && Strstr(nr,"SWIGTYPE")) {
|
if (q && strstr(Char(nr),"SWIGTYPE")) {
|
||||||
Append(def, nr);
|
Append(def, nr);
|
||||||
} else {
|
} else {
|
||||||
String *nd = SwigType_default(nr);
|
String *nd = SwigType_default(nr);
|
||||||
|
|
@ -381,7 +381,7 @@ SwigType *SwigType_default(SwigType *t) {
|
||||||
String *q;
|
String *q;
|
||||||
if (r == t) r = Copy(t);
|
if (r == t) r = Copy(t);
|
||||||
q = SwigType_pop(r);
|
q = SwigType_pop(r);
|
||||||
if (Strstr(r,"SWIGTYPE")) {
|
if (strstr(Char(r),"SWIGTYPE")) {
|
||||||
Delete(q);
|
Delete(q);
|
||||||
def = r;
|
def = r;
|
||||||
return def;
|
return def;
|
||||||
|
|
@ -496,9 +496,8 @@ SwigType_namestr(const SwigType *t) {
|
||||||
|
|
||||||
if (!SwigType_istemplate(t)) return NewString(t);
|
if (!SwigType_istemplate(t)) return NewString(t);
|
||||||
|
|
||||||
c = Strstr(t,"<(");
|
|
||||||
|
|
||||||
d = Char(t);
|
d = Char(t);
|
||||||
|
c = strstr(d,"<(");
|
||||||
e = tmp;
|
e = tmp;
|
||||||
while (d != c) {
|
while (d != c) {
|
||||||
*(e++) = *(d++);
|
*(e++) = *(d++);
|
||||||
|
|
@ -547,7 +546,7 @@ SwigType_str(SwigType *s, const String_or_char *id)
|
||||||
int nelements, i;
|
int nelements, i;
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
result = NewString(Char(id));
|
result = NewString(id);
|
||||||
} else {
|
} else {
|
||||||
result = NewString("");
|
result = NewString("");
|
||||||
}
|
}
|
||||||
|
|
@ -615,7 +614,7 @@ SwigType_str(SwigType *s, const String_or_char *id)
|
||||||
Append(result,")");
|
Append(result,")");
|
||||||
Delete(parms);
|
Delete(parms);
|
||||||
} else {
|
} else {
|
||||||
if (Strcmp(element,"v(...)") == 0) {
|
if (strcmp(Char(element),"v(...)") == 0) {
|
||||||
Insert(result,0,"...");
|
Insert(result,0,"...");
|
||||||
} else {
|
} else {
|
||||||
String *bs = SwigType_namestr(element);
|
String *bs = SwigType_namestr(element);
|
||||||
|
|
@ -996,7 +995,7 @@ SwigType_typename_replace(SwigType *t, String *pat, String *rep) {
|
||||||
Replace(e,pat,rep,DOH_REPLACE_ANY);
|
Replace(e,pat,rep,DOH_REPLACE_ANY);
|
||||||
} else if (SwigType_istemplate(e)) {
|
} else if (SwigType_istemplate(e)) {
|
||||||
/* Replaces a type of the form 'pat<args>' with 'rep' */
|
/* Replaces a type of the form 'pat<args>' with 'rep' */
|
||||||
if (Strncmp(e,pat,Len(pat)) == 0) {
|
if (StringEqual(e,pat)) {
|
||||||
String *repbase = SwigType_templateprefix(rep);
|
String *repbase = SwigType_templateprefix(rep);
|
||||||
Replace(e,pat,repbase,DOH_REPLACE_ID | DOH_REPLACE_FIRST);
|
Replace(e,pat,repbase,DOH_REPLACE_ID | DOH_REPLACE_FIRST);
|
||||||
Delete(repbase);
|
Delete(repbase);
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@ Swig_symbol_setscopename(const String_or_char *name) {
|
||||||
|
|
||||||
String *
|
String *
|
||||||
Swig_symbol_getscopename() {
|
Swig_symbol_getscopename() {
|
||||||
return Getattr(current_symtab,k_name);
|
return HashGetAttr(current_symtab,k_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
|
@ -343,19 +343,19 @@ Swig_symbol_qualifiedscopename(Symtab *symtab) {
|
||||||
Hash *parent;
|
Hash *parent;
|
||||||
String *name;
|
String *name;
|
||||||
if (!symtab) symtab = current_symtab;
|
if (!symtab) symtab = current_symtab;
|
||||||
parent = Getattr(symtab,k_parentnode);
|
parent = HashGetAttr(symtab,k_parentnode);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
result = Swig_symbol_qualifiedscopename(parent);
|
result = Swig_symbol_qualifiedscopename(parent);
|
||||||
}
|
}
|
||||||
name = Getattr(symtab,k_name);
|
name = HashGetAttr(symtab,k_name);
|
||||||
if (name) {
|
if (name) {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
result = NewString("");
|
result = NewString("");
|
||||||
}
|
}
|
||||||
if (Len(result)) {
|
if (StringLen(result)) {
|
||||||
Printv(result,"::",name, NIL);
|
Printv(result,"::",name, NIL);
|
||||||
} else {
|
} else {
|
||||||
Append(result,name);
|
StringAppend(result,name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -404,9 +404,9 @@ Symtab *
|
||||||
Swig_symbol_setscope(Symtab *sym) {
|
Swig_symbol_setscope(Symtab *sym) {
|
||||||
Symtab *ret = current_symtab;
|
Symtab *ret = current_symtab;
|
||||||
current_symtab = sym;
|
current_symtab = sym;
|
||||||
current = Getattr(sym,k_symtab);
|
current = HashGetAttr(sym,k_symtab);
|
||||||
assert(current);
|
assert(current);
|
||||||
ccurrent = Getattr(sym,k_csymtab);
|
ccurrent = HashGetAttr(sym,k_csymtab);
|
||||||
assert(ccurrent);
|
assert(ccurrent);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -421,11 +421,11 @@ Swig_symbol_setscope(Symtab *sym) {
|
||||||
Symtab *
|
Symtab *
|
||||||
Swig_symbol_popscope() {
|
Swig_symbol_popscope() {
|
||||||
Hash *h = current_symtab;
|
Hash *h = current_symtab;
|
||||||
current_symtab = Getattr(current_symtab, k_parentnode);
|
current_symtab = HashGetAttr(current_symtab, k_parentnode);
|
||||||
assert(current_symtab);
|
assert(current_symtab);
|
||||||
current = Getattr(current_symtab,k_symtab);
|
current = HashGetAttr(current_symtab,k_symtab);
|
||||||
assert(current);
|
assert(current);
|
||||||
ccurrent = Getattr(current_symtab,k_csymtab);
|
ccurrent = HashGetAttr(current_symtab,k_csymtab);
|
||||||
assert(ccurrent);
|
assert(ccurrent);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
@ -455,7 +455,7 @@ Swig_symbol_alias(String_or_char *aliasname, Symtab *s) {
|
||||||
} else {
|
} else {
|
||||||
qname = NewString(aliasname);
|
qname = NewString(aliasname);
|
||||||
}
|
}
|
||||||
if (!Getattr(symtabs,qname)) {
|
if (!HashGetAttr(symtabs,qname)) {
|
||||||
Setattr(symtabs,qname,s);
|
Setattr(symtabs,qname,s);
|
||||||
}
|
}
|
||||||
Delete(qname);
|
Delete(qname);
|
||||||
|
|
@ -469,7 +469,7 @@ Swig_symbol_alias(String_or_char *aliasname, Symtab *s) {
|
||||||
|
|
||||||
void Swig_symbol_inherit(Symtab *s) {
|
void Swig_symbol_inherit(Symtab *s) {
|
||||||
int i;
|
int i;
|
||||||
List *inherit = Getattr(current_symtab,k_inherit);
|
List *inherit = HashGetAttr(current_symtab,k_inherit);
|
||||||
if (!inherit) {
|
if (!inherit) {
|
||||||
inherit = NewList();
|
inherit = NewList();
|
||||||
Setattr(current_symtab,k_inherit, inherit);
|
Setattr(current_symtab,k_inherit, inherit);
|
||||||
|
|
@ -525,16 +525,16 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
||||||
#endif
|
#endif
|
||||||
cn = Getattr(ccurrent,name);
|
cn = Getattr(ccurrent,name);
|
||||||
|
|
||||||
if (cn && (Getattr(cn,k_symtypename))) {
|
if (cn && (HashGetAttr(cn,k_symtypename))) {
|
||||||
/* The node in the C symbol table is a typename. Do nothing */
|
/* The node in the C symbol table is a typename. Do nothing */
|
||||||
/* We might append the symbol at the end */
|
/* We might append the symbol at the end */
|
||||||
append = n;
|
append = n;
|
||||||
} else if (cn && (Getattr(cn,k_symweak))) {
|
} else if (cn && (HashGetAttr(cn,k_symweak))) {
|
||||||
/* The node in the symbol table is weak. Replace it */
|
/* The node in the symbol table is weak. Replace it */
|
||||||
Setattr(ccurrent,name, n);
|
Setattr(ccurrent,name, n);
|
||||||
} else if (cn && (Getattr(n,k_symweak))) {
|
} else if (cn && (HashGetAttr(n,k_symweak))) {
|
||||||
/* The node being added is weak. Don't worry about it */
|
/* The node being added is weak. Don't worry about it */
|
||||||
} else if (cn && (Getattr(n,k_symtypename))) {
|
} else if (cn && (HashGetAttr(n,k_symtypename))) {
|
||||||
/* The node being added is a typename. We definitely add it */
|
/* The node being added is a typename. We definitely add it */
|
||||||
Setattr(ccurrent,name,n);
|
Setattr(ccurrent,name,n);
|
||||||
append = cn;
|
append = cn;
|
||||||
|
|
@ -564,7 +564,7 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
||||||
/* already added. Bail */
|
/* already added. Bail */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fn = Getattr(fn,k_csymnextSibling);
|
fn = HashGetAttr(fn,k_csymnextSibling);
|
||||||
}
|
}
|
||||||
if (pn) {
|
if (pn) {
|
||||||
Setattr(pn,k_csymnextSibling,append);
|
Setattr(pn,k_csymnextSibling,append);
|
||||||
|
|
@ -587,8 +587,8 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
||||||
while (td && HashCheckAttr(td,k_nodetype,k_cdecl) && HashCheckAttr(td,k_storage,k_typedef)) {
|
while (td && HashCheckAttr(td,k_nodetype,k_cdecl) && HashCheckAttr(td,k_storage,k_typedef)) {
|
||||||
SwigType *type;
|
SwigType *type;
|
||||||
Node *td1;
|
Node *td1;
|
||||||
type = Copy(Getattr(td,k_type));
|
type = Copy(HashGetAttr(td,k_type));
|
||||||
SwigType_push(type,Getattr(td,k_decl));
|
SwigType_push(type,HashGetAttr(td,k_decl));
|
||||||
td1 = Swig_symbol_clookup(type,0);
|
td1 = Swig_symbol_clookup(type,0);
|
||||||
|
|
||||||
/* Fix patetic case #1214313:
|
/* Fix patetic case #1214313:
|
||||||
|
|
@ -609,10 +609,10 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
||||||
|
|
||||||
*/
|
*/
|
||||||
if (td1 && HashCheckAttr(td1,k_storage,k_typedef)) {
|
if (td1 && HashCheckAttr(td1,k_storage,k_typedef)) {
|
||||||
String *st = Getattr(td1,k_type);
|
String *st = HashGetAttr(td1,k_type);
|
||||||
String *sn = Getattr(td,k_name);
|
String *sn = HashGetAttr(td,k_name);
|
||||||
if (st && sn && StringEqual(st, sn)) {
|
if (st && sn && StringEqual(st, sn)) {
|
||||||
Symtab *sc = Getattr(current_symtab,k_parentnode);
|
Symtab *sc = HashGetAttr(current_symtab,k_parentnode);
|
||||||
if (sc) td1 = Swig_symbol_clookup(type,sc);
|
if (sc) td1 = Swig_symbol_clookup(type,sc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -621,9 +621,9 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
||||||
if (td1 == td) break;
|
if (td1 == td) break;
|
||||||
td = td1;
|
td = td1;
|
||||||
if (td) {
|
if (td) {
|
||||||
Symtab *st = Getattr(td,k_symtab);
|
Symtab *st = HashGetAttr(td,k_symtab);
|
||||||
if (st) {
|
if (st) {
|
||||||
Swig_symbol_alias(Getattr(n,k_name),st);
|
Swig_symbol_alias(HashGetAttr(n,k_name),st);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -674,7 +674,7 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
stays in the C symbol table (so that it can be expanded using %template).
|
stays in the C symbol table (so that it can be expanded using %template).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
name = Getattr(n,k_name);
|
name = HashGetAttr(n,k_name);
|
||||||
if (name && Len(name)) {
|
if (name && Len(name)) {
|
||||||
Swig_symbol_cadd(name,n);
|
Swig_symbol_cadd(name,n);
|
||||||
}
|
}
|
||||||
|
|
@ -700,7 +700,7 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
In this case, "Foo" sits in the symbol table. However, the
|
In this case, "Foo" sits in the symbol table. However, the
|
||||||
definition of Foo would replace the entry if it appeared later. */
|
definition of Foo would replace the entry if it appeared later. */
|
||||||
|
|
||||||
if (c && Getattr(c,k_symweak)) {
|
if (c && HashGetAttr(c,k_symweak)) {
|
||||||
c = 0;
|
c = 0;
|
||||||
}
|
}
|
||||||
if (c) {
|
if (c) {
|
||||||
|
|
@ -715,13 +715,13 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Check for namespaces */
|
/* Check for namespaces */
|
||||||
String *ntype = Getattr(n, k_nodetype);
|
String *ntype = HashGetAttr(n, k_nodetype);
|
||||||
if ((StringEqual(ntype,Getattr(c,k_nodetype))) && ((StringEqual(ntype,k_namespace)))) {
|
if ((StringEqual(ntype,HashGetAttr(c,k_nodetype))) && ((StringEqual(ntype,k_namespace)))) {
|
||||||
Node *cl, *pcl = 0;
|
Node *cl, *pcl = 0;
|
||||||
cl = c;
|
cl = c;
|
||||||
while (cl) {
|
while (cl) {
|
||||||
pcl = cl;
|
pcl = cl;
|
||||||
cl = Getattr(cl,k_symnextSibling);
|
cl = HashGetAttr(cl,k_symnextSibling);
|
||||||
}
|
}
|
||||||
Setattr(pcl,k_symnextSibling,n);
|
Setattr(pcl,k_symnextSibling,n);
|
||||||
Setattr(n,k_symsymtab, current_symtab);
|
Setattr(n,k_symsymtab, current_symtab);
|
||||||
|
|
@ -729,8 +729,8 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
Setattr(n,k_sympreviousSibling, pcl);
|
Setattr(n,k_sympreviousSibling, pcl);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
if (Getattr(n,k_allowstypedef)) nt = 1;
|
if (HashGetAttr(n,k_allowstypedef)) nt = 1;
|
||||||
if (Getattr(c,k_allowstypedef)) ct = 1;
|
if (HashGetAttr(c,k_allowstypedef)) ct = 1;
|
||||||
if (nt || ct) {
|
if (nt || ct) {
|
||||||
Node *td, *other;
|
Node *td, *other;
|
||||||
String *s;
|
String *s;
|
||||||
|
|
@ -748,7 +748,7 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
other = n;
|
other = n;
|
||||||
}
|
}
|
||||||
/* Make sure the other node is a typedef */
|
/* Make sure the other node is a typedef */
|
||||||
s = Getattr(other,k_storage);
|
s = HashGetAttr(other,k_storage);
|
||||||
if (!s || (!StringEqual(s,k_typedef))) return c; /* No. This is a conflict */
|
if (!s || (!StringEqual(s,k_typedef))) return c; /* No. This is a conflict */
|
||||||
|
|
||||||
/* Hmmm. This appears to be okay. Make sure the symbol table refers to the allow_type node */
|
/* Hmmm. This appears to be okay. Make sure the symbol table refers to the allow_type node */
|
||||||
|
|
@ -761,15 +761,15 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
decl = Getattr(c,k_decl);
|
decl = HashGetAttr(c,k_decl);
|
||||||
ndecl = Getattr(n,k_decl);
|
ndecl = HashGetAttr(n,k_decl);
|
||||||
|
|
||||||
{
|
{
|
||||||
String *nt1, *nt2;
|
String *nt1, *nt2;
|
||||||
nt1 = Getattr(n,k_nodetype);
|
nt1 = HashGetAttr(n,k_nodetype);
|
||||||
if (StringEqual(nt1,k_template)) nt1 = Getattr(n,k_templatetype);
|
if (StringEqual(nt1,k_template)) nt1 = HashGetAttr(n,k_templatetype);
|
||||||
nt2 = Getattr(c,k_nodetype);
|
nt2 = HashGetAttr(c,k_nodetype);
|
||||||
if (StringEqual(nt2,k_template)) nt2 = Getattr(c,k_templatetype);
|
if (StringEqual(nt2,k_template)) nt2 = HashGetAttr(c,k_templatetype);
|
||||||
if (StringEqual(nt1,k_using)) u1 = 1;
|
if (StringEqual(nt1,k_using)) u1 = 1;
|
||||||
if (StringEqual(nt2,k_using)) u2 = 1;
|
if (StringEqual(nt2,k_using)) u2 = 1;
|
||||||
|
|
||||||
|
|
@ -784,8 +784,8 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
|
|
||||||
/* Hmmm. Declarator seems to indicate that this is a function */
|
/* Hmmm. Declarator seems to indicate that this is a function */
|
||||||
/* Look at storage class to see if compatible */
|
/* Look at storage class to see if compatible */
|
||||||
cstorage = Getattr(c,k_storage);
|
cstorage = HashGetAttr(c,k_storage);
|
||||||
nstorage = Getattr(n,k_storage);
|
nstorage = HashGetAttr(n,k_storage);
|
||||||
|
|
||||||
/* If either one is declared as typedef, forget it. We're hosed */
|
/* If either one is declared as typedef, forget it. We're hosed */
|
||||||
if (Cmp(cstorage,k_typedef) == 0) {
|
if (Cmp(cstorage,k_typedef) == 0) {
|
||||||
|
|
@ -797,19 +797,19 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
|
|
||||||
/* Okay. Walk down the list of symbols and see if we get a declarator match */
|
/* Okay. Walk down the list of symbols and see if we get a declarator match */
|
||||||
{
|
{
|
||||||
String *nt = Getattr(n,k_nodetype);
|
String *nt = HashGetAttr(n,k_nodetype);
|
||||||
int n_template = StringEqual(nt,k_template) && HashCheckAttr(n,k_templatetype,k_cdecl);
|
int n_template = StringEqual(nt,k_template) && HashCheckAttr(n,k_templatetype,k_cdecl);
|
||||||
int n_plain_cdecl = StringEqual(nt,k_cdecl);
|
int n_plain_cdecl = StringEqual(nt,k_cdecl);
|
||||||
cn = c;
|
cn = c;
|
||||||
pn = 0;
|
pn = 0;
|
||||||
while (cn) {
|
while (cn) {
|
||||||
decl = Getattr(cn,k_decl);
|
decl = HashGetAttr(cn,k_decl);
|
||||||
if (!(u1 || u2)) {
|
if (!(u1 || u2)) {
|
||||||
if (Cmp(ndecl,decl) == 0) {
|
if (Cmp(ndecl,decl) == 0) {
|
||||||
/* Declarator conflict */
|
/* Declarator conflict */
|
||||||
/* Now check we don't have a non-templated function overloaded by a templated function with same params,
|
/* Now check we don't have a non-templated function overloaded by a templated function with same params,
|
||||||
* eg void foo(); template<typename> void foo(); */
|
* eg void foo(); template<typename> void foo(); */
|
||||||
String *cnt = Getattr(cn,k_nodetype);
|
String *cnt = HashGetAttr(cn,k_nodetype);
|
||||||
int cn_template = StringEqual(cnt,k_template) && HashCheckAttr(cn,k_templatetype,k_cdecl);
|
int cn_template = StringEqual(cnt,k_template) && HashCheckAttr(cn,k_templatetype,k_cdecl);
|
||||||
int cn_plain_cdecl = StringEqual(cnt,k_cdecl);
|
int cn_plain_cdecl = StringEqual(cnt,k_cdecl);
|
||||||
if (!((n_template && cn_plain_cdecl) || (cn_template && n_plain_cdecl))) {
|
if (!((n_template && cn_plain_cdecl) || (cn_template && n_plain_cdecl))) {
|
||||||
|
|
@ -819,7 +819,7 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cl = cn;
|
cl = cn;
|
||||||
cn = Getattr(cn,k_symnextSibling);
|
cn = HashGetAttr(cn,k_symnextSibling);
|
||||||
pn++;
|
pn++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -827,7 +827,7 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
Setattr(n,k_symsymtab,current_symtab);
|
Setattr(n,k_symsymtab,current_symtab);
|
||||||
Setattr(n,k_symname,symname);
|
Setattr(n,k_symname,symname);
|
||||||
/* Printf(stdout,"%s %x\n", Getattr(n,k_symovername), current_symtab); */
|
/* Printf(stdout,"%s %x\n", Getattr(n,k_symovername), current_symtab); */
|
||||||
assert(!Getattr(n,k_symovername));
|
assert(!HashGetAttr(n,k_symovername));
|
||||||
overname = NewStringf("__SWIG_%d", pn);
|
overname = NewStringf("__SWIG_%d", pn);
|
||||||
Setattr(n,k_symovername, overname);
|
Setattr(n,k_symovername, overname);
|
||||||
/*Printf(stdout,"%s %s %s\n", symname, Getattr(n,k_decl), Getattr(n,k_symovername)); */
|
/*Printf(stdout,"%s %s %s\n", symname, Getattr(n,k_decl), Getattr(n,k_symovername)); */
|
||||||
|
|
@ -866,18 +866,18 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static Node *
|
static Node *
|
||||||
symbol_lookup(String_or_char *name, Symtab *symtab, int (*check)(Node *n)) {
|
_symbol_lookup(String *name, Symtab *symtab, int (*check)(Node *n)) {
|
||||||
Node *n;
|
Node *n;
|
||||||
List *inherit;
|
List *inherit;
|
||||||
Hash *sym = Getattr(symtab,k_csymtab);
|
Hash *sym = HashGetAttr(symtab,k_csymtab);
|
||||||
if (Getmark(symtab)) return 0;
|
if (Getmark(symtab)) return 0;
|
||||||
Setmark(symtab,1);
|
Setmark(symtab,1);
|
||||||
|
|
||||||
|
|
||||||
n = Getattr(sym,name);
|
n = HashGetAttr(sym,name);
|
||||||
|
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"symbol_look %s %x %x %s\n", name, n, symtab, Getattr(symtab,k_name));
|
Printf(stderr,"symbol_look %s %x %x %s\n", name, n, symtab, HashGetAttr(symtab,k_name));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (n) {
|
if (n) {
|
||||||
|
|
@ -904,18 +904,18 @@ symbol_lookup(String_or_char *name, Symtab *symtab, int (*check)(Node *n)) {
|
||||||
Setmark(symtab,0);
|
Setmark(symtab,0);
|
||||||
dname = Swig_symbol_template_deftype(name,symtab);
|
dname = Swig_symbol_template_deftype(name,symtab);
|
||||||
if (!StringEqual(dname,name)) {
|
if (!StringEqual(dname,name)) {
|
||||||
n = symbol_lookup(dname, symtab, check);
|
n = _symbol_lookup(dname, symtab, check);
|
||||||
}
|
}
|
||||||
Delete(dname);
|
Delete(dname);
|
||||||
if (n) return n;
|
if (n) return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
inherit = Getattr(symtab,k_inherit);
|
inherit = HashGetAttr(symtab,k_inherit);
|
||||||
if (inherit) {
|
if (inherit) {
|
||||||
int i,len;
|
int i,len;
|
||||||
len = Len(inherit);
|
len = Len(inherit);
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
n = symbol_lookup(name, Getitem(inherit,i),check);
|
n = _symbol_lookup(name, Getitem(inherit,i),check);
|
||||||
if (n) {
|
if (n) {
|
||||||
Setmark(symtab,0);
|
Setmark(symtab,0);
|
||||||
return n;
|
return n;
|
||||||
|
|
@ -927,6 +927,21 @@ symbol_lookup(String_or_char *name, Symtab *symtab, int (*check)(Node *n)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Node *
|
||||||
|
symbol_lookup(String_or_char *name, Symtab *symtab, int (*check)(Node *n)) {
|
||||||
|
Node *n = 0;
|
||||||
|
if (DohCheck(name)) {
|
||||||
|
n = _symbol_lookup(name, symtab, check);
|
||||||
|
} else {
|
||||||
|
String *sname = NewString(name);
|
||||||
|
n = _symbol_lookup(sname, symtab, check);
|
||||||
|
Delete(sname);
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* symbol_lookup_qualified()
|
* symbol_lookup_qualified()
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
@ -947,21 +962,20 @@ symbol_lookup_qualified(String_or_char *name, Symtab *symtab, String *prefix, in
|
||||||
Delete(prefix);
|
Delete(prefix);
|
||||||
return n;
|
return n;
|
||||||
} else {
|
} else {
|
||||||
String *qname;
|
|
||||||
Symtab *st;
|
Symtab *st;
|
||||||
Node *n = 0;
|
Node *n = 0;
|
||||||
/* Make qualified name of current scope */
|
/* Make qualified name of current scope */
|
||||||
qname = Swig_symbol_qualifiedscopename(symtab);
|
String *qname = Swig_symbol_qualifiedscopename(symtab);
|
||||||
if (Len(qname)) {
|
if (qname && StringLen(qname)) {
|
||||||
if (Len(prefix)) {
|
if (prefix && StringLen(prefix)) {
|
||||||
Append(qname,k_coloncolon);
|
StringAppend(qname,k_coloncolon);
|
||||||
Append(qname,prefix);
|
StringAppend(qname,prefix);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Delete(qname);
|
Delete(qname);
|
||||||
qname = NewString(prefix);
|
qname = Copy(prefix);
|
||||||
}
|
}
|
||||||
st = Getattr(symtabs,qname);
|
st = HashGetAttr(symtabs,qname);
|
||||||
/* Found a scope match */
|
/* Found a scope match */
|
||||||
if (st) {
|
if (st) {
|
||||||
if (!name) return st;
|
if (!name) return st;
|
||||||
|
|
@ -971,7 +985,7 @@ symbol_lookup_qualified(String_or_char *name, Symtab *symtab, String *prefix, in
|
||||||
Delete(qname);
|
Delete(qname);
|
||||||
if (!n) {
|
if (!n) {
|
||||||
if (!local) {
|
if (!local) {
|
||||||
Node *pn = Getattr(symtab,k_parentnode);
|
Node *pn = HashGetAttr(symtab,k_parentnode);
|
||||||
if (pn) n = symbol_lookup_qualified(name,pn, prefix, local,checkfunc);
|
if (pn) n = symbol_lookup_qualified(name,pn, prefix, local,checkfunc);
|
||||||
} else {
|
} else {
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
@ -998,7 +1012,7 @@ Swig_symbol_clookup(String_or_char *name, Symtab *n) {
|
||||||
hsym = current_symtab;
|
hsym = current_symtab;
|
||||||
} else {
|
} else {
|
||||||
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
||||||
n = Getattr(n,k_symsymtab);
|
n = HashGetAttr(n,k_symsymtab);
|
||||||
}
|
}
|
||||||
assert(n);
|
assert(n);
|
||||||
if (n) {
|
if (n) {
|
||||||
|
|
@ -1007,7 +1021,8 @@ Swig_symbol_clookup(String_or_char *name, Symtab *n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Swig_scopename_check(name)) {
|
if (Swig_scopename_check(name)) {
|
||||||
if (Strncmp(name,k_coloncolon,2) == 0) {
|
char *cname = Char(name);
|
||||||
|
if (strncmp(cname,"::",2) == 0) {
|
||||||
String *nname = NewString(Char(name)+2);
|
String *nname = NewString(Char(name)+2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname,global_scope,0,0,0);
|
s = symbol_lookup_qualified(nname,global_scope,0,0,0);
|
||||||
|
|
@ -1028,7 +1043,7 @@ Swig_symbol_clookup(String_or_char *name, Symtab *n) {
|
||||||
while (hsym) {
|
while (hsym) {
|
||||||
s = symbol_lookup(name,hsym,0);
|
s = symbol_lookup(name,hsym,0);
|
||||||
if (s) break;
|
if (s) break;
|
||||||
hsym = Getattr(hsym,k_parentnode);
|
hsym = HashGetAttr(hsym,k_parentnode);
|
||||||
if (!hsym) break;
|
if (!hsym) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1037,12 +1052,12 @@ Swig_symbol_clookup(String_or_char *name, Symtab *n) {
|
||||||
}
|
}
|
||||||
/* Check if s is a 'using' node */
|
/* Check if s is a 'using' node */
|
||||||
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
||||||
String *uname = Getattr(s,k_uname);
|
String *uname = HashGetAttr(s,k_uname);
|
||||||
Symtab *un = Getattr(s,k_symsymtab);
|
Symtab *un = HashGetAttr(s,k_symsymtab);
|
||||||
Node *ss = (!StringEqual(name,uname) || (un != n)) ?
|
Node *ss = (!StringEqual(name,uname) || (un != n)) ?
|
||||||
Swig_symbol_clookup(uname, un) : 0; /* avoid infinity loop */
|
Swig_symbol_clookup(uname, un) : 0; /* avoid infinity loop */
|
||||||
if (!ss) {
|
if (!ss) {
|
||||||
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", Getattr(s,k_uname));
|
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", HashGetAttr(s,k_uname));
|
||||||
}
|
}
|
||||||
s = ss;
|
s = ss;
|
||||||
}
|
}
|
||||||
|
|
@ -1068,7 +1083,7 @@ Swig_symbol_clookup_check(String_or_char *name, Symtab *n, int (*checkfunc)(Node
|
||||||
hsym = current_symtab;
|
hsym = current_symtab;
|
||||||
} else {
|
} else {
|
||||||
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
||||||
n = Getattr(n,k_symsymtab);
|
n = HashGetAttr(n,k_symsymtab);
|
||||||
}
|
}
|
||||||
assert(n);
|
assert(n);
|
||||||
if (n) {
|
if (n) {
|
||||||
|
|
@ -1077,7 +1092,8 @@ Swig_symbol_clookup_check(String_or_char *name, Symtab *n, int (*checkfunc)(Node
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Swig_scopename_check(name)) {
|
if (Swig_scopename_check(name)) {
|
||||||
if (Strncmp(name,k_coloncolon,2) == 0) {
|
char *cname = Char(name);
|
||||||
|
if (strncmp(cname,"::",2) == 0) {
|
||||||
String *nname = NewString(Char(name)+2);
|
String *nname = NewString(Char(name)+2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname,global_scope,0,0,checkfunc);
|
s = symbol_lookup_qualified(nname,global_scope,0,0,checkfunc);
|
||||||
|
|
@ -1098,7 +1114,7 @@ Swig_symbol_clookup_check(String_or_char *name, Symtab *n, int (*checkfunc)(Node
|
||||||
while (hsym) {
|
while (hsym) {
|
||||||
s = symbol_lookup(name,hsym,checkfunc);
|
s = symbol_lookup(name,hsym,checkfunc);
|
||||||
if (s) break;
|
if (s) break;
|
||||||
hsym = Getattr(hsym,k_parentnode);
|
hsym = HashGetAttr(hsym,k_parentnode);
|
||||||
if (!hsym) break;
|
if (!hsym) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1108,9 +1124,9 @@ Swig_symbol_clookup_check(String_or_char *name, Symtab *n, int (*checkfunc)(Node
|
||||||
/* Check if s is a 'using' node */
|
/* Check if s is a 'using' node */
|
||||||
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
||||||
Node *ss;
|
Node *ss;
|
||||||
ss = Swig_symbol_clookup(Getattr(s,k_uname), Getattr(s,k_symsymtab));
|
ss = Swig_symbol_clookup(HashGetAttr(s,k_uname), HashGetAttr(s,k_symsymtab));
|
||||||
if (!ss && !checkfunc) {
|
if (!ss && !checkfunc) {
|
||||||
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", Getattr(s,k_uname));
|
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", HashGetAttr(s,k_uname));
|
||||||
}
|
}
|
||||||
s = ss;
|
s = ss;
|
||||||
}
|
}
|
||||||
|
|
@ -1131,15 +1147,16 @@ Swig_symbol_clookup_local(String_or_char *name, Symtab *n) {
|
||||||
h = ccurrent;
|
h = ccurrent;
|
||||||
} else {
|
} else {
|
||||||
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
||||||
n = Getattr(n,k_symsymtab);
|
n = HashGetAttr(n,k_symsymtab);
|
||||||
}
|
}
|
||||||
assert(n);
|
assert(n);
|
||||||
hsym = n;
|
hsym = n;
|
||||||
h = Getattr(n,k_csymtab);
|
h = HashGetAttr(n,k_csymtab);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Swig_scopename_check(name)) {
|
if (Swig_scopename_check(name)) {
|
||||||
if (Strncmp(name,k_coloncolon,2) == 0) {
|
char *cname = Char(name);
|
||||||
|
if (strncmp(cname,"::",2) == 0) {
|
||||||
String *nname = NewString(Char(name)+2);
|
String *nname = NewString(Char(name)+2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname,global_scope,0,0,0);
|
s = symbol_lookup_qualified(nname,global_scope,0,0,0);
|
||||||
|
|
@ -1155,9 +1172,9 @@ Swig_symbol_clookup_local(String_or_char *name, Symtab *n) {
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
/* Check if s is a 'using' node */
|
/* Check if s is a 'using' node */
|
||||||
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
||||||
Node *ss = Swig_symbol_clookup_local(Getattr(s,k_uname), Getattr(s,k_symsymtab));
|
Node *ss = Swig_symbol_clookup_local(HashGetAttr(s,k_uname), HashGetAttr(s,k_symsymtab));
|
||||||
if (!ss) {
|
if (!ss) {
|
||||||
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", Getattr(s,k_uname));
|
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", HashGetAttr(s,k_uname));
|
||||||
}
|
}
|
||||||
s = ss;
|
s = ss;
|
||||||
}
|
}
|
||||||
|
|
@ -1178,15 +1195,16 @@ Swig_symbol_clookup_local_check(String_or_char *name, Symtab *n, int (*checkfunc
|
||||||
h = ccurrent;
|
h = ccurrent;
|
||||||
} else {
|
} else {
|
||||||
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
if (!HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
||||||
n = Getattr(n,k_symsymtab);
|
n = HashGetAttr(n,k_symsymtab);
|
||||||
}
|
}
|
||||||
assert(n);
|
assert(n);
|
||||||
hsym = n;
|
hsym = n;
|
||||||
h = Getattr(n,k_csymtab);
|
h = HashGetAttr(n,k_csymtab);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Swig_scopename_check(name)) {
|
if (Swig_scopename_check(name)) {
|
||||||
if (Strncmp(name,k_coloncolon,2) == 0) {
|
char *cname = Char(name);
|
||||||
|
if (strncmp(cname,"::",2) == 0) {
|
||||||
String *nname = NewString(Char(name)+2);
|
String *nname = NewString(Char(name)+2);
|
||||||
if (Swig_scopename_check(nname)) {
|
if (Swig_scopename_check(nname)) {
|
||||||
s = symbol_lookup_qualified(nname,global_scope,0,0,checkfunc);
|
s = symbol_lookup_qualified(nname,global_scope,0,0,checkfunc);
|
||||||
|
|
@ -1202,9 +1220,9 @@ Swig_symbol_clookup_local_check(String_or_char *name, Symtab *n, int (*checkfunc
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
/* Check if s is a 'using' node */
|
/* Check if s is a 'using' node */
|
||||||
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
while (s && HashCheckAttr(s,k_nodetype,k_using)) {
|
||||||
Node *ss = Swig_symbol_clookup_local_check(Getattr(s,k_uname), Getattr(s,k_symsymtab),checkfunc);
|
Node *ss = Swig_symbol_clookup_local_check(HashGetAttr(s,k_uname), HashGetAttr(s,k_symsymtab),checkfunc);
|
||||||
if (!ss && !checkfunc) {
|
if (!ss && !checkfunc) {
|
||||||
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", Getattr(s,k_uname));
|
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", HashGetAttr(s,k_uname));
|
||||||
}
|
}
|
||||||
s = ss;
|
s = ss;
|
||||||
}
|
}
|
||||||
|
|
@ -1220,7 +1238,8 @@ Swig_symbol_clookup_local_check(String_or_char *name, Symtab *n, int (*checkfunc
|
||||||
|
|
||||||
Symtab *
|
Symtab *
|
||||||
Swig_symbol_cscope(String_or_char *name, Symtab *symtab) {
|
Swig_symbol_cscope(String_or_char *name, Symtab *symtab) {
|
||||||
if (Strncmp(name,k_coloncolon,2) == 0) return symbol_lookup_qualified(0, global_scope, name, 0,0);
|
char *cname = Char(name);
|
||||||
|
if (strncmp(cname,"::",2) == 0) return symbol_lookup_qualified(0, global_scope, name, 0,0);
|
||||||
return symbol_lookup_qualified(0,symtab,name,0,0);
|
return symbol_lookup_qualified(0,symtab,name,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1240,11 +1259,11 @@ Swig_symbol_remove(Node *n) {
|
||||||
Node *symprev;
|
Node *symprev;
|
||||||
Node *symnext;
|
Node *symnext;
|
||||||
Node *fixovername = 0;
|
Node *fixovername = 0;
|
||||||
symtab = Getattr(n,k_symsymtab); /* Get symbol table object */
|
symtab = HashGetAttr(n,k_symsymtab); /* Get symbol table object */
|
||||||
symtab = Getattr(symtab,k_symtab); /* Get actual hash table of symbols */
|
symtab = HashGetAttr(symtab,k_symtab); /* Get actual hash table of symbols */
|
||||||
symname = Getattr(n,k_symname);
|
symname = HashGetAttr(n,k_symname);
|
||||||
symprev = Getattr(n,k_sympreviousSibling);
|
symprev = HashGetAttr(n,k_sympreviousSibling);
|
||||||
symnext = Getattr(n,k_symnextSibling);
|
symnext = HashGetAttr(n,k_symnextSibling);
|
||||||
|
|
||||||
/* If previous symbol, just fix the links */
|
/* If previous symbol, just fix the links */
|
||||||
if (symprev) {
|
if (symprev) {
|
||||||
|
|
@ -1287,19 +1306,19 @@ Swig_symbol_remove(Node *n) {
|
||||||
/* find head of linked list */
|
/* find head of linked list */
|
||||||
while (nn) {
|
while (nn) {
|
||||||
head = nn;
|
head = nn;
|
||||||
nn = Getattr(nn, k_sympreviousSibling);
|
nn = HashGetAttr(nn, k_sympreviousSibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust all the sym:overname strings to start from 0 and increment by one */
|
/* adjust all the sym:overname strings to start from 0 and increment by one */
|
||||||
nn = head;
|
nn = head;
|
||||||
while (nn) {
|
while (nn) {
|
||||||
assert(Getattr(nn,k_symovername));
|
assert(HashGetAttr(nn,k_symovername));
|
||||||
Delattr(nn,k_symovername);
|
Delattr(nn,k_symovername);
|
||||||
overname = NewStringf("__SWIG_%d", pn);
|
overname = NewStringf("__SWIG_%d", pn);
|
||||||
Setattr(nn,k_symovername, overname);
|
Setattr(nn,k_symovername, overname);
|
||||||
Delete(overname);
|
Delete(overname);
|
||||||
pn++;
|
pn++;
|
||||||
nn = Getattr(nn,k_symnextSibling);
|
nn = HashGetAttr(nn,k_symnextSibling);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1316,11 +1335,11 @@ Swig_symbol_qualified(Node *n) {
|
||||||
if (HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
if (HashCheckAttr(n,k_nodetype,k_symboltable)) {
|
||||||
symtab = n;
|
symtab = n;
|
||||||
} else {
|
} else {
|
||||||
symtab = Getattr(n,k_symsymtab);
|
symtab = HashGetAttr(n,k_symsymtab);
|
||||||
}
|
}
|
||||||
if (!symtab) return NewString("");
|
if (!symtab) return NewString("");
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"symbol_qscope %s %x %s\n", Getattr(n,k_name), symtab,Getattr(symtab,k_name));
|
Printf(stderr,"symbol_qscope %s %x %s\n", HashGetAttr(n,k_name), symtab,HashGetAttr(symtab,k_name));
|
||||||
#endif
|
#endif
|
||||||
return Swig_symbol_qualifiedscopename(symtab);
|
return Swig_symbol_qualifiedscopename(symtab);
|
||||||
}
|
}
|
||||||
|
|
@ -1333,7 +1352,7 @@ Swig_symbol_qualified(Node *n) {
|
||||||
|
|
||||||
Node *
|
Node *
|
||||||
Swig_symbol_isoverloaded(Node *n) {
|
Swig_symbol_isoverloaded(Node *n) {
|
||||||
return Getattr(n,k_symoverloaded);
|
return HashGetAttr(n,k_symoverloaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
|
@ -1344,7 +1363,7 @@ Swig_symbol_isoverloaded(Node *n) {
|
||||||
|
|
||||||
static int no_constructor(Node *n) {
|
static int no_constructor(Node *n) {
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"node type %s\n", Getattr(n,k_name), type);
|
Printf(stderr,"node type %s\n", HashGetAttr(n,k_name), type);
|
||||||
#endif
|
#endif
|
||||||
return !HashCheckAttr(n, k_nodetype, k_constructor);
|
return !HashCheckAttr(n, k_nodetype, k_constructor);
|
||||||
}
|
}
|
||||||
|
|
@ -1362,8 +1381,8 @@ Swig_symbol_template_qualify(const SwigType *e, Symtab *st) {
|
||||||
qprefix = Swig_symbol_type_qualify(tprefix,st);
|
qprefix = Swig_symbol_type_qualify(tprefix,st);
|
||||||
targs = SwigType_parmlist(e);
|
targs = SwigType_parmlist(e);
|
||||||
tempn = Swig_symbol_clookup_local(tprefix,st);
|
tempn = Swig_symbol_clookup_local(tprefix,st);
|
||||||
tscope = tempn ? Getattr(tempn,k_symsymtab) : 0;
|
tscope = tempn ? HashGetAttr(tempn,k_symsymtab) : 0;
|
||||||
Printf(qprefix,"<(");
|
StringAppend(qprefix,"<(");
|
||||||
for (ti = First(targs); ti.item;) {
|
for (ti = First(targs); ti.item;) {
|
||||||
String *vparm;
|
String *vparm;
|
||||||
String *qparm = Swig_symbol_type_qualify(ti.item,st);
|
String *qparm = Swig_symbol_type_qualify(ti.item,st);
|
||||||
|
|
@ -1374,7 +1393,7 @@ Swig_symbol_template_qualify(const SwigType *e, Symtab *st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vparm = Swig_symbol_template_param_eval(qparm, st);
|
vparm = Swig_symbol_template_param_eval(qparm, st);
|
||||||
Append(qprefix,vparm);
|
StringAppend(qprefix,vparm);
|
||||||
ti = Next(ti);
|
ti = Next(ti);
|
||||||
if (ti.item) {
|
if (ti.item) {
|
||||||
Putc(',',qprefix);
|
Putc(',',qprefix);
|
||||||
|
|
@ -1382,8 +1401,8 @@ Swig_symbol_template_qualify(const SwigType *e, Symtab *st) {
|
||||||
Delete(qparm);
|
Delete(qparm);
|
||||||
Delete(vparm);
|
Delete(vparm);
|
||||||
}
|
}
|
||||||
Append(qprefix,")>");
|
StringAppend(qprefix,")>");
|
||||||
Append(qprefix,tsuffix);
|
StringAppend(qprefix,tsuffix);
|
||||||
Delete(tprefix);
|
Delete(tprefix);
|
||||||
Delete(tsuffix);
|
Delete(tsuffix);
|
||||||
Delete(targs);
|
Delete(targs);
|
||||||
|
|
@ -1408,15 +1427,15 @@ Swig_symbol_type_qualify(const SwigType *t, Symtab *st) {
|
||||||
if (SwigType_issimple(e)) {
|
if (SwigType_issimple(e)) {
|
||||||
Node *n = Swig_symbol_clookup_check(e,st,no_constructor);
|
Node *n = Swig_symbol_clookup_check(e,st,no_constructor);
|
||||||
if (n) {
|
if (n) {
|
||||||
String *name = Getattr(n,k_name);
|
String *name = HashGetAttr(n,k_name);
|
||||||
Clear(e);
|
Clear(e);
|
||||||
Append(e,name);
|
StringAppend(e,name);
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"symbol_qual_ei %d %s %s %x\n", i, name, e, st);
|
Printf(stderr,"symbol_qual_ei %d %s %s %x\n", i, name, e, st);
|
||||||
#endif
|
#endif
|
||||||
if (!Swig_scopename_check(name)) {
|
if (!Swig_scopename_check(name)) {
|
||||||
String *qname = Swig_symbol_qualified(n);
|
String *qname = Swig_symbol_qualified(n);
|
||||||
if (Len(qname)) {
|
if (qname && StringLen(qname)) {
|
||||||
Insert(e,0,k_coloncolon);
|
Insert(e,0,k_coloncolon);
|
||||||
Insert(e,0,qname);
|
Insert(e,0,qname);
|
||||||
}
|
}
|
||||||
|
|
@ -1428,38 +1447,38 @@ Swig_symbol_type_qualify(const SwigType *t, Symtab *st) {
|
||||||
} else if (SwigType_istemplate(e)) {
|
} else if (SwigType_istemplate(e)) {
|
||||||
SwigType *ty = Swig_symbol_template_qualify(e,st);
|
SwigType *ty = Swig_symbol_template_qualify(e,st);
|
||||||
Clear(e);
|
Clear(e);
|
||||||
Append(e,ty);
|
StringAppend(e,ty);
|
||||||
Delete(ty);
|
Delete(ty);
|
||||||
}
|
}
|
||||||
if (Strncmp(e,k_coloncolon,2) == 0) {
|
if (strncmp(Char(e),"::",2) == 0) {
|
||||||
Delitem(e,0);
|
Delitem(e,0);
|
||||||
Delitem(e,0);
|
Delitem(e,0);
|
||||||
}
|
}
|
||||||
Append(result,e);
|
StringAppend(result,e);
|
||||||
} else if (SwigType_isfunction(e)) {
|
} else if (SwigType_isfunction(e)) {
|
||||||
List *parms = SwigType_parmlist(e);
|
List *parms = SwigType_parmlist(e);
|
||||||
String *s = NewString("f(");
|
String *s = NewString("f(");
|
||||||
Iterator pi = First(parms);
|
Iterator pi = First(parms);
|
||||||
while (pi.item) {
|
while (pi.item) {
|
||||||
String *pf = Swig_symbol_type_qualify(pi.item,st);
|
String *pf = Swig_symbol_type_qualify(pi.item,st);
|
||||||
Append(s,pf);
|
StringAppend(s,pf);
|
||||||
pi = Next(pi);
|
pi = Next(pi);
|
||||||
if (pi.item) {
|
if (pi.item) {
|
||||||
Append(s,",");
|
StringAppend(s,",");
|
||||||
}
|
}
|
||||||
Delete(pf);
|
Delete(pf);
|
||||||
}
|
}
|
||||||
Append(s,").");
|
StringAppend(s,").");
|
||||||
Append(result,s);
|
StringAppend(result,s);
|
||||||
Delete(parms);
|
Delete(parms);
|
||||||
Delete(s);
|
Delete(s);
|
||||||
} else {
|
} else {
|
||||||
Append(result,e);
|
StringAppend(result,e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Delete(elements);
|
Delete(elements);
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"symbol_qualify %s %s %x %s\n", t, result, st, st ?Getattr(st,k_name): 0);
|
Printf(stderr,"symbol_qualify %s %s %x %s\n", t, result, st, st ?HashGetAttr(st,k_name): 0);
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -1488,9 +1507,9 @@ SwigType *Swig_symbol_template_reduce(SwigType *qt, Symtab *ntab)
|
||||||
Node *n = Swig_symbol_clookup(qp,ntab);
|
Node *n = Swig_symbol_clookup(qp,ntab);
|
||||||
if (n) {
|
if (n) {
|
||||||
String *qual = Swig_symbol_qualified(n);
|
String *qual = Swig_symbol_qualified(n);
|
||||||
np = Copy(Getattr(n,k_name));
|
np = Copy(HashGetAttr(n,k_name));
|
||||||
tp = np;
|
tp = np;
|
||||||
if (Len(qual)) {
|
if (qual && StringLen(qual)) {
|
||||||
Insert(np,0,k_coloncolon);
|
Insert(np,0,k_coloncolon);
|
||||||
Insert(np,0,qual);
|
Insert(np,0,qual);
|
||||||
}
|
}
|
||||||
|
|
@ -1498,15 +1517,15 @@ SwigType *Swig_symbol_template_reduce(SwigType *qt, Symtab *ntab)
|
||||||
} else {
|
} else {
|
||||||
np = qp;
|
np = qp;
|
||||||
}
|
}
|
||||||
Append(qprefix,np);
|
StringAppend(qprefix,np);
|
||||||
pi= Next(pi);
|
pi= Next(pi);
|
||||||
if (pi.item) {
|
if (pi.item) {
|
||||||
Append(qprefix,",");
|
StringAppend(qprefix,",");
|
||||||
}
|
}
|
||||||
Delete(qp);
|
Delete(qp);
|
||||||
Delete(tp);
|
Delete(tp);
|
||||||
}
|
}
|
||||||
Append(qprefix,")>");
|
StringAppend(qprefix,")>");
|
||||||
Insert(tsuffix, 0, qprefix);
|
Insert(tsuffix, 0, qprefix);
|
||||||
Delete(parms);
|
Delete(parms);
|
||||||
Delete(tprefix);
|
Delete(tprefix);
|
||||||
|
|
@ -1528,7 +1547,7 @@ SwigType *Swig_symbol_typedef_reduce(SwigType *ty, Symtab *tab) {
|
||||||
Delete(base);
|
Delete(base);
|
||||||
if (SwigType_istemplate(ty)) {
|
if (SwigType_istemplate(ty)) {
|
||||||
SwigType *qt = Swig_symbol_template_reduce(ty,tab);
|
SwigType *qt = Swig_symbol_template_reduce(ty,tab);
|
||||||
Append(prefix,qt);
|
StringAppend(prefix,qt);
|
||||||
Delete(qt);
|
Delete(qt);
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"symbol_reduce %s %s\n", ty, prefix);
|
Printf(stderr,"symbol_reduce %s %s\n", ty, prefix);
|
||||||
|
|
@ -1542,11 +1561,11 @@ SwigType *Swig_symbol_typedef_reduce(SwigType *ty, Symtab *tab) {
|
||||||
return Copy(ty);
|
return Copy(ty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nt = Getattr(n,k_nodetype);
|
nt = HashGetAttr(n,k_nodetype);
|
||||||
if (StringEqual(nt,k_using)) {
|
if (StringEqual(nt,k_using)) {
|
||||||
String *uname = Getattr(n,k_uname);
|
String *uname = HashGetAttr(n,k_uname);
|
||||||
if (uname) {
|
if (uname) {
|
||||||
n = Swig_symbol_clookup(base,Getattr(n,k_symsymtab));
|
n = Swig_symbol_clookup(base,HashGetAttr(n,k_symsymtab));
|
||||||
if (!n) {
|
if (!n) {
|
||||||
Delete(base);
|
Delete(base);
|
||||||
Delete(prefix);
|
Delete(prefix);
|
||||||
|
|
@ -1558,13 +1577,13 @@ SwigType *Swig_symbol_typedef_reduce(SwigType *ty, Symtab *tab) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StringEqual(nt,k_cdecl)) {
|
if (StringEqual(nt,k_cdecl)) {
|
||||||
String *storage = Getattr(n,k_storage);
|
String *storage = HashGetAttr(n,k_storage);
|
||||||
if (storage && (StringEqual(storage,k_typedef))) {
|
if (storage && (StringEqual(storage,k_typedef))) {
|
||||||
SwigType *decl;
|
SwigType *decl;
|
||||||
SwigType *rt;
|
SwigType *rt;
|
||||||
SwigType *qt;
|
SwigType *qt;
|
||||||
Symtab *ntab;
|
Symtab *ntab;
|
||||||
SwigType *nt = Copy(Getattr(n,k_type));
|
SwigType *nt = Copy(HashGetAttr(n,k_type));
|
||||||
|
|
||||||
/* Fix for case 'typedef struct Hello hello;' */
|
/* Fix for case 'typedef struct Hello hello;' */
|
||||||
{
|
{
|
||||||
|
|
@ -1577,14 +1596,14 @@ SwigType *Swig_symbol_typedef_reduce(SwigType *ty, Symtab *tab) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decl = Getattr(n,k_decl);
|
decl = HashGetAttr(n,k_decl);
|
||||||
if (decl) {
|
if (decl) {
|
||||||
SwigType_push(nt,decl);
|
SwigType_push(nt,decl);
|
||||||
}
|
}
|
||||||
SwigType_push(nt,prefix);
|
SwigType_push(nt,prefix);
|
||||||
Delete(base);
|
Delete(base);
|
||||||
Delete(prefix);
|
Delete(prefix);
|
||||||
ntab = Getattr(n,k_symsymtab);
|
ntab = HashGetAttr(n,k_symsymtab);
|
||||||
rt = Swig_symbol_typedef_reduce(nt, ntab);
|
rt = Swig_symbol_typedef_reduce(nt, ntab);
|
||||||
qt = Swig_symbol_type_qualify(rt, ntab);
|
qt = Swig_symbol_type_qualify(rt, ntab);
|
||||||
if (SwigType_istemplate(qt)) {
|
if (SwigType_istemplate(qt)) {
|
||||||
|
|
@ -1633,7 +1652,7 @@ Swig_symbol_string_qualify(String *s, Symtab *st) {
|
||||||
} else {
|
} else {
|
||||||
if (have_id) {
|
if (have_id) {
|
||||||
String *qid = Swig_symbol_type_qualify(id,st);
|
String *qid = Swig_symbol_type_qualify(id,st);
|
||||||
Append(r,qid);
|
StringAppend(r,qid);
|
||||||
Clear(id);
|
Clear(id);
|
||||||
Delete(qid);
|
Delete(qid);
|
||||||
have_id = 0;
|
have_id = 0;
|
||||||
|
|
@ -1644,7 +1663,7 @@ Swig_symbol_string_qualify(String *s, Symtab *st) {
|
||||||
}
|
}
|
||||||
if (have_id) {
|
if (have_id) {
|
||||||
String *qid = Swig_symbol_type_qualify(id,st);
|
String *qid = Swig_symbol_type_qualify(id,st);
|
||||||
Append(r,qid);
|
StringAppend(r,qid);
|
||||||
Delete(qid);
|
Delete(qid);
|
||||||
}
|
}
|
||||||
Delete(id);
|
Delete(id);
|
||||||
|
|
@ -1671,7 +1690,7 @@ Swig_symbol_template_defargs(Parm *parms, Parm *targs, Symtab *tscope, Symtab *t
|
||||||
if (p) lp = p;
|
if (p) lp = p;
|
||||||
}
|
}
|
||||||
while (tp) {
|
while (tp) {
|
||||||
String *value = Getattr(tp,k_value);
|
String *value = HashGetAttr(tp,k_value);
|
||||||
if (value) {
|
if (value) {
|
||||||
Parm *cp;
|
Parm *cp;
|
||||||
Parm *ta = targs;
|
Parm *ta = targs;
|
||||||
|
|
@ -1679,12 +1698,12 @@ Swig_symbol_template_defargs(Parm *parms, Parm *targs, Symtab *tscope, Symtab *t
|
||||||
SwigType *nt = Swig_symbol_string_qualify(value,tsdecl);
|
SwigType *nt = Swig_symbol_string_qualify(value,tsdecl);
|
||||||
SwigType *ntq = 0;
|
SwigType *ntq = 0;
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"value %s %s %s\n",value, nt,tsdecl ? Getattr(tsdecl,k_name) : tsdecl);
|
Printf(stderr,"value %s %s %s\n",value, nt,tsdecl ? HashGetAttr(tsdecl,k_name) : tsdecl);
|
||||||
#endif
|
#endif
|
||||||
while(p && ta) {
|
while(p && ta) {
|
||||||
String *name = Getattr(ta,k_name);
|
String *name = HashGetAttr(ta,k_name);
|
||||||
String *pvalue = Getattr(p,k_value);
|
String *pvalue = HashGetAttr(p,k_value);
|
||||||
String *value = pvalue ? pvalue : Getattr(p,k_type);
|
String *value = pvalue ? pvalue : HashGetAttr(p,k_type);
|
||||||
String *ttq = Swig_symbol_type_qualify(value,tscope);
|
String *ttq = Swig_symbol_type_qualify(value,tscope);
|
||||||
/* value = SwigType_typedef_resolve_all(value);*/
|
/* value = SwigType_typedef_resolve_all(value);*/
|
||||||
Replaceid(nt, name, ttq);
|
Replaceid(nt, name, ttq);
|
||||||
|
|
@ -1738,15 +1757,15 @@ Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
|
||||||
String *pf = SwigType_istemplate(e) ?
|
String *pf = SwigType_istemplate(e) ?
|
||||||
Swig_symbol_template_deftype(pi.item,tscope)
|
Swig_symbol_template_deftype(pi.item,tscope)
|
||||||
: Swig_symbol_type_qualify(pi.item,tscope);
|
: Swig_symbol_type_qualify(pi.item,tscope);
|
||||||
Append(s,pf);
|
StringAppend(s,pf);
|
||||||
pi = Next(pi);
|
pi = Next(pi);
|
||||||
if (pi.item) {
|
if (pi.item) {
|
||||||
Append(s,",");
|
StringAppend(s,",");
|
||||||
}
|
}
|
||||||
Delete(pf);
|
Delete(pf);
|
||||||
}
|
}
|
||||||
Append(s,").");
|
StringAppend(s,").");
|
||||||
Append(result,s);
|
StringAppend(result,s);
|
||||||
Delete(s);
|
Delete(s);
|
||||||
Delete(parms);
|
Delete(parms);
|
||||||
} else if (SwigType_istemplate(e)) {
|
} else if (SwigType_istemplate(e)) {
|
||||||
|
|
@ -1761,20 +1780,20 @@ Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
|
||||||
Printf(stderr,"deftype type %s \n", e);
|
Printf(stderr,"deftype type %s \n", e);
|
||||||
#endif
|
#endif
|
||||||
if (tempn) {
|
if (tempn) {
|
||||||
ParmList *tnargs = Getattr(tempn,k_templateparms);
|
ParmList *tnargs = HashGetAttr(tempn,k_templateparms);
|
||||||
Parm *p;
|
Parm *p;
|
||||||
Symtab *tsdecl = Getattr(tempn,k_symsymtab);
|
Symtab *tsdecl = HashGetAttr(tempn,k_symsymtab);
|
||||||
|
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"deftype type %s %s %s\n", tprefix, targs,tsuffix);
|
Printf(stderr,"deftype type %s %s %s\n", tprefix, targs,tsuffix);
|
||||||
#endif
|
#endif
|
||||||
Append(tprefix,"<(");
|
StringAppend(tprefix,"<(");
|
||||||
Swig_symbol_template_defargs(tparms, tnargs,tscope,tsdecl);
|
Swig_symbol_template_defargs(tparms, tnargs,tscope,tsdecl);
|
||||||
p = tparms;
|
p = tparms;
|
||||||
tscope = tsdecl;
|
tscope = tsdecl;
|
||||||
while (p) {
|
while (p) {
|
||||||
SwigType *ptype = Getattr(p,k_type);
|
SwigType *ptype = HashGetAttr(p,k_type);
|
||||||
SwigType *ttr = ptype ? ptype : Getattr(p,k_value);
|
SwigType *ttr = ptype ? ptype : HashGetAttr(p,k_value);
|
||||||
SwigType *ttf = Swig_symbol_type_qualify(ttr,tscope);
|
SwigType *ttf = Swig_symbol_type_qualify(ttr,tscope);
|
||||||
SwigType *ttq = Swig_symbol_template_param_eval(ttf,tscope);
|
SwigType *ttq = Swig_symbol_template_param_eval(ttf,tscope);
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
|
|
@ -1788,21 +1807,21 @@ Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
|
||||||
Printf(stderr,"arg deftype %s\n", ttq);
|
Printf(stderr,"arg deftype %s\n", ttq);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
Append(tprefix,ttq);
|
StringAppend(tprefix,ttq);
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
if (p) Putc(',',tprefix);
|
if (p) Putc(',',tprefix);
|
||||||
Delete(ttf);
|
Delete(ttf);
|
||||||
Delete(ttq);
|
Delete(ttq);
|
||||||
}
|
}
|
||||||
Append(tprefix,")>");
|
StringAppend(tprefix,")>");
|
||||||
Append(tprefix,tsuffix);
|
StringAppend(tprefix,tsuffix);
|
||||||
Append(prefix,tprefix);
|
StringAppend(prefix,tprefix);
|
||||||
#ifdef SWIG_DEBUG
|
#ifdef SWIG_DEBUG
|
||||||
Printf(stderr,"deftype %s %s \n", type, tprefix);
|
Printf(stderr,"deftype %s %s \n", type, tprefix);
|
||||||
#endif
|
#endif
|
||||||
Append(result,prefix);
|
StringAppend(result,prefix);
|
||||||
} else {
|
} else {
|
||||||
Append(result,e);
|
StringAppend(result,e);
|
||||||
}
|
}
|
||||||
Delete(prefix);
|
Delete(prefix);
|
||||||
Delete(base);
|
Delete(base);
|
||||||
|
|
@ -1811,7 +1830,7 @@ Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
|
||||||
Delete(targs);
|
Delete(targs);
|
||||||
Delete(tparms);
|
Delete(tparms);
|
||||||
} else {
|
} else {
|
||||||
Append(result,e);
|
StringAppend(result,e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Delete(elements);
|
Delete(elements);
|
||||||
|
|
@ -1827,13 +1846,13 @@ SwigType *Swig_symbol_template_param_eval(const SwigType *p, Symtab *symtab)
|
||||||
if (n == lastnode) break;
|
if (n == lastnode) break;
|
||||||
lastnode = n;
|
lastnode = n;
|
||||||
if (n) {
|
if (n) {
|
||||||
String *nt = Getattr(n,k_nodetype);
|
String *nt = HashGetAttr(n,k_nodetype);
|
||||||
if (StringEqual(nt,k_enumitem)) {
|
if (StringEqual(nt,k_enumitem)) {
|
||||||
/* An enum item. Generate a fully qualified name */
|
/* An enum item. Generate a fully qualified name */
|
||||||
String *qn = Swig_symbol_qualified(n);
|
String *qn = Swig_symbol_qualified(n);
|
||||||
if (Len(qn)) {
|
if (qn && StringLen(qn)) {
|
||||||
Append(qn,k_coloncolon);
|
StringAppend(qn,k_coloncolon);
|
||||||
Append(qn,Getattr(n,k_name));
|
StringAppend(qn,HashGetAttr(n,k_name));
|
||||||
Delete(value);
|
Delete(value);
|
||||||
value = qn;
|
value = qn;
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1842,7 +1861,7 @@ SwigType *Swig_symbol_template_param_eval(const SwigType *p, Symtab *symtab)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if ((StringEqual(nt,k_cdecl))) {
|
} else if ((StringEqual(nt,k_cdecl))) {
|
||||||
String *nv = Getattr(n,k_value);
|
String *nv = HashGetAttr(n,k_value);
|
||||||
if (nv) {
|
if (nv) {
|
||||||
Delete(value);
|
Delete(value);
|
||||||
value = Copy(nv);
|
value = Copy(nv);
|
||||||
|
|
|
||||||
|
|
@ -375,7 +375,7 @@ Swig_restore(Node *n) {
|
||||||
len = strlen(temp);
|
len = strlen(temp);
|
||||||
|
|
||||||
for (ki = First(n); ki.key; ki = Next(ki)) {
|
for (ki = First(n); ki.key; ki = Next(ki)) {
|
||||||
if (Strncmp(temp,ki.key,len) == 0) {
|
if (strncmp(temp,Char(ki.key),len) == 0) {
|
||||||
Append(l,ki.key);
|
Append(l,ki.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1629,13 +1629,13 @@ static void split_var(String *s, String **name, String **value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void replace_embedded_typemap(String *s) {
|
static void replace_embedded_typemap(String *s) {
|
||||||
while (Strstr(s,"$TYPEMAP(")) {
|
char *start = 0;
|
||||||
|
while (start = strstr(Char(s),"$TYPEMAP(")) {
|
||||||
|
|
||||||
/* Gather the argument */
|
/* Gather the argument */
|
||||||
char *start, *end=0,*c;
|
char *start, *end=0,*c;
|
||||||
int level = 0;
|
int level = 0;
|
||||||
String *tmp;
|
String *tmp;
|
||||||
start = Strstr(s,"$TYPEMAP(");
|
|
||||||
c = start;
|
c = start;
|
||||||
while (*c) {
|
while (*c) {
|
||||||
if (*c == '(') level++;
|
if (*c == '(') level++;
|
||||||
|
|
|
||||||
|
|
@ -864,7 +864,7 @@ SwigType_templateargs(const SwigType *t) {
|
||||||
|
|
||||||
int
|
int
|
||||||
SwigType_istemplate(const SwigType *t) {
|
SwigType_istemplate(const SwigType *t) {
|
||||||
if (Strstr(t,"<(")) return 1;
|
if (strstr(Char(t),"<(")) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -589,7 +589,7 @@ SwigType *SwigType_typedef_resolve(SwigType *t) {
|
||||||
if (SwigType_issimple(base)) {
|
if (SwigType_issimple(base)) {
|
||||||
s = current_scope;
|
s = current_scope;
|
||||||
ttab = current_typetab;
|
ttab = current_typetab;
|
||||||
if (Strncmp(base,"::",2) == 0) {
|
if (strncmp(Char(base),"::",2) == 0) {
|
||||||
s = global_scope;
|
s = global_scope;
|
||||||
ttab = Getattr(s,k_typetab);
|
ttab = Getattr(s,k_typetab);
|
||||||
Delitem(base,0);
|
Delitem(base,0);
|
||||||
|
|
@ -763,7 +763,8 @@ SwigType *SwigType_typedef_resolve(SwigType *t) {
|
||||||
r = SwigType_prefix(t);
|
r = SwigType_prefix(t);
|
||||||
if (!type) {
|
if (!type) {
|
||||||
if (r && Len(r)) {
|
if (r && Len(r)) {
|
||||||
if ((Strstr(r,"f(") || (Strstr(r,"m(")))) {
|
char *cr = Char(r);
|
||||||
|
if ((strstr(cr,"f(") || (strstr(cr,"m(")))) {
|
||||||
SwigType *rt = SwigType_typedef_resolve(r);
|
SwigType *rt = SwigType_typedef_resolve(r);
|
||||||
if (rt) {
|
if (rt) {
|
||||||
Delete(r);
|
Delete(r);
|
||||||
|
|
@ -998,7 +999,7 @@ SwigType *SwigType_typedef_qualified(SwigType *t)
|
||||||
Delete(qprefix);
|
Delete(qprefix);
|
||||||
Delete(parms);
|
Delete(parms);
|
||||||
}
|
}
|
||||||
if (Strncmp(e,"::",2) == 0) {
|
if (strncmp(Char(e),"::",2) == 0) {
|
||||||
Delitem(e,0);
|
Delitem(e,0);
|
||||||
Delitem(e,0);
|
Delitem(e,0);
|
||||||
}
|
}
|
||||||
|
|
@ -1442,9 +1443,12 @@ void SwigType_remember_clientdata(SwigType *t, const String_or_char *clientdata)
|
||||||
/*Printf(stdout,"t = '%s'\n", t);
|
/*Printf(stdout,"t = '%s'\n", t);
|
||||||
Printf(stdout,"fr= '%s'\n\n", fr); */
|
Printf(stdout,"fr= '%s'\n\n", fr); */
|
||||||
|
|
||||||
if (Strstr(t,"<") && !(Strstr(t,"<("))) {
|
if (t) {
|
||||||
Printf(stdout,"Bad template type passed to SwigType_remember: %s\n", t);
|
char *ct = Char(t);
|
||||||
assert(0);
|
if (strstr(ct,"<") && !(strstr(ct,"<("))) {
|
||||||
|
Printf(stdout,"Bad template type passed to SwigType_remember: %s\n", t);
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h = Getattr(r_mangled,mt);
|
h = Getattr(r_mangled,mt);
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ Wrapper_pretty_print(String *str, File *f) {
|
||||||
} else if (c == ':') {
|
} else if (c == ':') {
|
||||||
Putc(c,ts);
|
Putc(c,ts);
|
||||||
if ((c = Getc(str)) == '\n') {
|
if ((c = Getc(str)) == '\n') {
|
||||||
if (!empty && !Strstr(ts,"?")) label = 1;
|
if (!empty && !strstr(Char(ts),"?")) label = 1;
|
||||||
}
|
}
|
||||||
Ungetc(c,str);
|
Ungetc(c,str);
|
||||||
} else if (c == '(') {
|
} else if (c == '(') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue