/** * Returns a {@link CallContext} instance. This may return a previously cached instance that matches * the signature requested, and should be used in preference to instantiating new instances. * * @param returnType The return type of the native function. * @param parameterTypes The parameter types the function accepts. * @param convention The calling convention of the function. * @param saveErrno Indicates that the errno should be saved * @return An instance of CallContext */ public static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno) { return CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention, saveErrno); }
public final CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno) { return getCallContext(returnType, parameterTypes, convention, saveErrno, false); }
public final CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention) { return getCallContext(returnType, parameterTypes, convention, true, false); }
/** * Returns a {@link CallContext} instance. This may return a previously cached instance that matches * the signature requested, and should be used in preference to instantiating new instances. * * @param returnType The return type of the native function. * @param parameterTypes The parameter types the function accepts. * @param convention The calling convention of the function. * @param saveErrno Indicates that the errno should be saved * @return An instance of CallContext */ public static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno) { return CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention, saveErrno); }
public final CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno) { return getCallContext(returnType, parameterTypes, convention, saveErrno, false); }
public static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno, boolean faultProtect) { return CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention, saveErrno, faultProtect); }
public final CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno) { return getCallContext(returnType, parameterTypes, convention, saveErrno, false); }
/** * Returns a {@link CallContext} instance. This may return a previously cached instance that matches * the signature requested, and should be used in preference to instantiating new instances. * * @param returnType The return type of the native function. * @param parameterTypes The parameter types the function accepts. * @param convention The calling convention of the function. * @param saveErrno Indicates that the errno should be saved * @return An instance of CallContext */ public static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno) { return CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention, saveErrno); }
public final CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention) { return getCallContext(returnType, parameterTypes, convention, true, false); }
public static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno, boolean faultProtect) { return CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention, saveErrno, faultProtect); }
public final CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention) { return getCallContext(returnType, parameterTypes, convention, true, false); }
public static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno, boolean faultProtect) { return CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention, saveErrno, faultProtect); }
/** * Wraps a java object that implements the {@link Closure} interface in a * native closure. * * @param closure The java object to be called when the native closure is invoked. * @param returnType The return type of the closure. * @param parameterTypes The parameter types of the closure. * @param convention The calling convention of the closure. * @return A new {@link Closure.Handle} instance. */ public final Closure.Handle newClosure(Closure closure, Type returnType, Type[] parameterTypes, CallingConvention convention) { return newClosure(closure, CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention)); }
/** * Wraps a java object that implements the {@link Closure} interface in a * native closure. * * @param closure The java object to be called when the native closure is invoked. * @param returnType The return type of the closure. * @param parameterTypes The parameter types of the closure. * @param convention The calling convention of the closure. * @return A new {@link Closure.Handle} instance. */ public final Closure.Handle newClosure(Closure closure, Type returnType, Type[] parameterTypes, CallingConvention convention) { return newClosure(closure, CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention)); }
/** * Wraps a java object that implements the {@link Closure} interface in a * native closure. * * @param closure The java object to be called when the native closure is invoked. * @param returnType The return type of the closure. * @param parameterTypes The parameter types of the closure. * @param convention The calling convention of the closure. * @return A new {@link Closure.Handle} instance. */ public final Closure.Handle newClosure(Closure closure, Type returnType, Type[] parameterTypes, CallingConvention convention) { return newClosure(closure, CallContextCache.getInstance().getCallContext(returnType, parameterTypes, convention)); }
static CallContext getCallContext(SigType resultType, SigType[] parameterTypes, com.kenai.jffi.CallingConvention convention, boolean requiresErrno) { com.kenai.jffi.Type[] nativeParamTypes = new com.kenai.jffi.Type[parameterTypes.length]; for (int i = 0; i < nativeParamTypes.length; ++i) { nativeParamTypes[i] = jffiType(parameterTypes[i].nativeType); } return CallContextCache.getInstance().getCallContext(jffiType(resultType.nativeType), nativeParamTypes, convention, requiresErrno); }
static CallContext getCallContext(SigType resultType, SigType[] parameterTypes, jnr.ffi.CallingConvention convention, boolean requiresErrno) { com.kenai.jffi.Type[] nativeParamTypes = new com.kenai.jffi.Type[parameterTypes.length]; for (int i = 0; i < nativeParamTypes.length; ++i) { nativeParamTypes[i] = jffiType(parameterTypes[i].getNativeType()); } return CallContextCache.getInstance().getCallContext(jffiType(resultType.getNativeType()), nativeParamTypes, jffiConvention(convention), requiresErrno); }
static CallContext getCallContext(SigType resultType, SigType[] parameterTypes, jnr.ffi.CallingConvention convention, boolean requiresErrno) { com.kenai.jffi.Type[] nativeParamTypes = new com.kenai.jffi.Type[parameterTypes.length]; for (int i = 0; i < nativeParamTypes.length; ++i) { nativeParamTypes[i] = jffiType(parameterTypes[i].getNativeType()); } return CallContextCache.getInstance().getCallContext(jffiType(resultType.getNativeType()), nativeParamTypes, jffiConvention(convention), requiresErrno); }
public NativeFunctionInfo(Ruby runtime, org.jruby.ext.ffi.Type returnType, org.jruby.ext.ffi.Type[] parameterTypes, CallingConvention convention) { this.returnType = returnType; this.parameterTypes = parameterTypes; this.jffiReturnType = FFIUtil.getFFIType(returnType); if (jffiReturnType == null) { throw runtime.newTypeError("invalid FFI return type: " + returnType); } this.jffiParameterTypes = new com.kenai.jffi.Type[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; ++i) { jffiParameterTypes[i] = FFIUtil.getFFIType(parameterTypes[i]); if (jffiParameterTypes[i] == null) { throw runtime.newTypeError("invalid FFI parameter type: " + parameterTypes[i]); } } this.callContext = CallContextCache.getInstance().getCallContext(jffiReturnType, jffiParameterTypes, convention); this.convention = convention; } }
public NativeFunctionInfo(Ruby runtime, org.jruby.ext.ffi.Type returnType, org.jruby.ext.ffi.Type[] parameterTypes, CallingConvention convention) { this.returnType = returnType; this.parameterTypes = parameterTypes; this.jffiReturnType = FFIUtil.getFFIType(returnType); if (jffiReturnType == null) { throw runtime.newTypeError("invalid FFI return type: " + returnType); } this.jffiParameterTypes = new com.kenai.jffi.Type[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; ++i) { jffiParameterTypes[i] = FFIUtil.getFFIType(parameterTypes[i]); if (jffiParameterTypes[i] == null) { throw runtime.newTypeError("invalid FFI parameter type: " + parameterTypes[i]); } } this.callContext = CallContextCache.getInstance().getCallContext(jffiReturnType, jffiParameterTypes, convention); this.convention = convention; } }