summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/procaddress
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-04-24 18:13:36 +0200
committerMichael Bien <[email protected]>2010-04-24 18:13:36 +0200
commit64b0148972c410a8f76c5f55ed866060886849a7 (patch)
tree2c4b83305268df4a1c9a2d4556c3bf1cb21ed6d2 /src/java/com/sun/gluegen/procaddress
parent734a341e4703870dc5d562099bd267aa41e850f2 (diff)
Refactored ProcAddressTable generation.
- ProcAddressTable is now the common superclass for all tables - Removed ProcAddressHelpers and added FunctionAddressResolver extension mechanism
Diffstat (limited to 'src/java/com/sun/gluegen/procaddress')
-rwxr-xr-xsrc/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java
index c49e239..aa71495 100755
--- a/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java
+++ b/src/java/com/sun/gluegen/procaddress/ProcAddressEmitter.java
@@ -52,7 +52,7 @@ import com.jogamp.gluegen.runtime.*;
*/
public class ProcAddressEmitter extends JavaEmitter {
- public static final String PROCADDRESS_VAR_PREFIX = ProcAddressHelper.PROCADDRESS_VAR_PREFIX;
+ public static final String PROCADDRESS_VAR_PREFIX = ProcAddressTable.PROCADDRESS_VAR_PREFIX;
protected static final String WRAP_PREFIX = "dispatch_";
private TypeDictionary typedefDictionary;
protected PrintWriter tableWriter;
@@ -320,12 +320,19 @@ public class ProcAddressEmitter extends JavaEmitter {
tableWriter.println(" * pointer is 0, the function is considered to be unavailable and can");
tableWriter.println(" * not be called.");
tableWriter.println(" */");
- tableWriter.println("public class " + tableClassName + " implements com.jogamp.gluegen.runtime.ProcAddressTable");
- tableWriter.println("{");
+ tableWriter.println("public class " + tableClassName + " extends "+ ProcAddressTable.class.getName() + " {");
+ tableWriter.println();
for (String string : getProcAddressConfig().getForceProcAddressGen()) {
emitProcAddressTableEntryForString(string);
}
+
+ tableWriter.println();
+ tableWriter.println(" public "+tableClassName+"(){ super(); }");
+ tableWriter.println();
+ tableWriter.println(" public "+tableClassName+"("+FunctionAddressResolver.class.getName()+" resolver){ super(resolver); }");
+ tableWriter.println();
+
}
protected void endProcAddressTable() throws Exception {
@@ -345,7 +352,7 @@ public class ProcAddressEmitter extends JavaEmitter {
w.println(" * it was statically linked.");
w.println(" */");
w.println(" public long getAddressFor(String functionName) {");
- w.println(" String addressFieldName = " + getProcAddressConfig().gluegenRuntimePackage() + ".ProcAddressHelper.PROCADDRESS_VAR_PREFIX + functionName;");
+ w.println(" String addressFieldName = PROCADDRESS_VAR_PREFIX + functionName;");
w.println(" try { ");
w.println(" java.lang.reflect.Field addressField = getClass().getField(addressFieldName);");
w.println(" return addressField.getLong(this);");