Added function pointer wrapper trait
package metacall
import com.sun.jna._
+import scala.annotation.varargs
object util {
private[metacall] class SizeT(value: Long)
@@ -11,6 +12,10 @@ object util {
def apply(value: Long) = new SizeT(value)
}
+ private[metacall] trait FunctionPointer extends Callback {
+ @varargs def invoke(params: Pointer*): Pointer
+ }
+
sealed class MetaCallException(message: String, val cause: Option[String])
extends Exception(message + cause.map(" Cause: " + _).getOrElse(""))
class AllocationError[A](value: Option[A], cause: Option[String])
@@ -26,4 +31,5 @@ object util {
protected[metacall] def isNull(ptr: Pointer): Boolean =
ptr == null || ptr == Pointer.NULL
+
}
