fix java reg. tests and add -directors flag

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5867 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-04-11 05:55:35 +00:00
commit 1eba66b31b
7 changed files with 96 additions and 29 deletions

View file

@ -757,9 +757,11 @@ String *SwigType_lcaststr(SwigType *s, const String_or_char *name) {
return result;
}
/* keep old mangling since Java codes need it */
String *SwigType_manglestr_default(SwigType *s) {
String *result,*base,*mbase;
SwigType *lt, *ltp;
char *c;
String *result,*base;
SwigType *lt;
SwigType *ss = 0;
if (SwigType_istemplate(s)) {
@ -767,11 +769,14 @@ String *SwigType_manglestr_default(SwigType *s) {
s = ss;
}
lt = SwigType_ltype(s);
ltp = SwigType_prefix(lt);
result = SwigType_prefix(lt);
base = SwigType_base(lt);
result = Swig_string_mangle(ltp);
c = Char(result);
while (*c) {
if (!isalnum((int)*c)) *c = '_';
c++;
}
if (SwigType_istemplate(base)) {
String *b = SwigType_namestr(base);
Delete(base);
@ -782,13 +787,23 @@ String *SwigType_manglestr_default(SwigType *s) {
Replace(base,"class ","", DOH_REPLACE_ANY);
Replace(base,"union ","", DOH_REPLACE_ANY);
mbase = Swig_string_mangle(base);
Append(result,mbase);
c = Char(base);
while (*c) {
if (*c == '<') *c = 'T';
else if (*c == '>') *c = 't';
else if (*c == '*') *c = 'p';
else if (*c == '[') *c = 'a';
else if (*c == ']') *c = 'A';
else if (*c == '&') *c = 'R';
else if (*c == '(') *c = 'f';
else if (*c == ')') *c = 'F';
else if (!isalnum((int)*c)) *c = '_';
c++;
}
Append(result,base);
Insert(result,0,"_");
Delete(lt);
Delete(ltp);
Delete(base);
Delete(mbase);
if (ss) Delete(ss);
return result;
}

View file

@ -501,6 +501,8 @@ extern void Swig_fragment_emit(String *name);
/* hacks defined in C++ ! */
extern int Swig_need_protected();
extern int Swig_director_mode();
extern int Swig_template_extmode();
#ifdef __cplusplus
}