Package org.jruby.ext.ffi

Examples of org.jruby.ext.ffi.Type


       
        if (!(args[1] instanceof Type)) {
            throw context.runtime.newTypeError("invalid return type");
        }
       
        final Type returnType = (Type) args[1];
        final CallingConvention conv = "stdcall".equals(args[2].toString())
                ? CallingConvention.STDCALL : CallingConvention.DEFAULT;

        FunctionInvoker functionInvoker = DefaultMethodFactory.getFunctionInvoker(returnType);
        return new VariadicInvoker(context.runtime, klass, address,
View Full Code Here


        IRubyObject[] params = ((RubyArray) paramsArg).toJavaArrayMaybeUnsafe();
        com.kenai.jffi.Type[] ffiParamTypes = new com.kenai.jffi.Type[types.length];
        ParameterMarshaller[] marshallers = new ParameterMarshaller[types.length];

        for (int i = 0; i < types.length; ++i) {
            Type type = (Type) types[i];
            switch (NativeType.valueOf(type)) {
                case CHAR:
                case SHORT:
                case INT:
                    ffiParamTypes[i] = com.kenai.jffi.Type.SINT32;
View Full Code Here

    private static ObjectParameterInfo getParameterInfo(Signature signature, int i) {
        if (signature.getParameterCount() <= i) {
            return null;
        }

        Type type = signature.getParameterType(i);
        int flags = 0;
        NativeType nativeType  = type instanceof MappedType
                ? ((MappedType) type).getRealType().getNativeType() : type.getNativeType();

        switch (nativeType) {
            case BUFFER_IN:
            case STRING:
            case TRANSIENT_STRING:
View Full Code Here

    private static CachingCallSite getParameterCallSite(Signature signature, int parameterIndex) {
        if (signature.getParameterCount() <= parameterIndex) {
            return null;
        }

        Type type = signature.getParameterType(parameterIndex);
        NativeType nativeType  = type instanceof MappedType
                ? ((MappedType) type).getRealType().getNativeType() : type.getNativeType();

        switch (nativeType) {
            case STRING:
            case TRANSIENT_STRING:
                return new FunctionalCachingCallSite("to_str");
View Full Code Here

TOP

Related Classes of org.jruby.ext.ffi.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.