aboutsummaryrefslogtreecommitdiffstats
path: root/C2J/CFuncDeclaration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2001-06-18 23:20:46 +0000
committerSven Gothel <[email protected]>2001-06-18 23:20:46 +0000
commitcc7376ee5616743cdd7b7a5c711f054b32ae8e4e (patch)
tree1550b5fd8630667151fe30e74811abb6a45792ea /C2J/CFuncDeclaration.java
parent8512ae5ab8a75fad8a75aec0b6e04e3fcd1d2c6f (diff)
2.8.0.0 pre-release cvs only
Diffstat (limited to 'C2J/CFuncDeclaration.java')
-rw-r--r--C2J/CFuncDeclaration.java42
1 files changed, 25 insertions, 17 deletions
diff --git a/C2J/CFuncDeclaration.java b/C2J/CFuncDeclaration.java
index 4431dfd..014e78f 100644
--- a/C2J/CFuncDeclaration.java
+++ b/C2J/CFuncDeclaration.java
@@ -493,7 +493,11 @@ public class CFuncDeclaration
{
cfvar = (CFuncVariable) argList.elementAt(i);
- if( cfvar.arrayNumber>0 )
+ if(cfvar.typeJava.equals("String") && cfvar.arrayNumber==1)
+ {
+ res += "\t\tchar *ptr" + i +
+ " = NULL;\n";
+ } else if( cfvar.arrayNumber>0 )
{
jniCMethodBaseType = cfvar.getJniCMethodBaseType();
@@ -519,21 +523,17 @@ public class CFuncDeclaration
res += "\n" ;
- //
- // Add the query if the native function pointer is != NULL
- //
- res += "\t\tif ( ";
-
- if(exportMode==C2J.EXPORT_JNI_C)
- res += funcSpec.identifier;
- else
- res += "disp__"+funcSpec.identifier;
-
- res += " == NULL ) return";
+ if(exportMode==C2J.EXPORT_JNI_C_DYN)
+ {
+ //
+ // Add the query if the dynamic native function pointer is != NULL
+ //
+ res += "\t\tif ( disp__"+funcSpec.identifier+" == NULL ) return";
- if(funcSpec.typeJava.equals("void")==false)
- res += " 0";
- res += ";\n\n";
+ if(funcSpec.typeJava.equals("void")==false)
+ res += " 0";
+ res += ";\n\n";
+ }
//
// Adding the JNI access Methods
@@ -544,7 +544,12 @@ public class CFuncDeclaration
{
cfvar = (CFuncVariable) argList.elementAt(i);
- if( cfvar.arrayNumber>0 )
+ if(cfvar.typeJava.equals("String") && cfvar.arrayNumber==1)
+ {
+ res += "\t\tptr" + i + " = " +
+ "jnitoolsGetJavaString(env, "+cfvar.identifier+
+ ");\n";
+ } else if( cfvar.arrayNumber>0 )
{
jniCMethodBaseType = cfvar.getJniCMethodBaseType();
@@ -650,7 +655,10 @@ public class CFuncDeclaration
{
cfvar = (CFuncVariable) argList.elementAt(i);
- if( cfvar.arrayNumber>0 )
+ if(cfvar.typeJava.equals("String") && cfvar.arrayNumber==1)
+ {
+ res += "\t\tfree(ptr"+i+");\n";
+ } else if( cfvar.arrayNumber>0 )
{
jniCMethodBaseType = cfvar.getJniCMethodBaseType();