Package com.kenai.jffi

Examples of com.kenai.jffi.CallingConvention


                        + enums.getMetaClass().getName() + " (expected Hash)");

            }
        }

        CallingConvention callConvention = "stdcall".equals(convention)
                        ? CallingConvention.STDCALL : CallingConvention.DEFAULT;
        if (fptr == null && proc != null) {
            fptr = CallbackManager.getInstance().newClosure(context.getRuntime(),
                    returnType, parameterTypes, proc, callConvention);
        }
View Full Code Here


        if (!(args[1] instanceof Type)) {
            throw context.getRuntime().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.getRuntime(), klass, address,
                functionInvoker, FFIUtil.getFFIType(returnType), conv);
View Full Code Here

            }
            Collection<Annotation> annotations = sortedAnnotationCollection(m.getAnnotations());
            String functionName = functionMapper.mapFunctionName(m.getName(), new NativeFunctionMapperContext(library, annotations));

            // Allow individual methods to set the calling convention to stdcall
            CallingConvention callingConvention = m.isAnnotationPresent(StdCall.class)
                    ? CallingConvention.STDCALL : libraryCallingConvention;
            boolean saveErrno = InvokerUtil.requiresErrno(m);
            try {
                generateFunctionInvocation(runtime, builder, m, library.findSymbolAddress(functionName),
                        callingConvention, saveErrno, typeMapper, generators);
View Full Code Here

                    resultContext);

            ParameterType[] parameterTypes = getParameterTypes(runtime, typeMapper, method);

            // Allow individual methods to set the calling convention to stdcall
            CallingConvention callingConvention = method.isAnnotationPresent(StdCall.class)
                    ? CallingConvention.STDCALL : libraryCallingConvention;

            Function function = new Function(functionAddress,
                    getCallContext(resultType, parameterTypes, callingConvention, InvokerUtil.requiresErrno(method)));
View Full Code Here

                resultContext.getAnnotations(), fromNativeConverter, resultContext);

        ParameterType[] parameterTypes = getParameterTypes(runtime, typeMapper, closureMethod);

        // Allow individual methods to set the calling convention to stdcall
        CallingConvention callingConvention = closureClass.isAnnotationPresent(StdCall.class)
                ? CallingConvention.STDCALL : CallingConvention.DEFAULT;
        CallContext callContext = getCallContext(resultType, parameterTypes, callingConvention, true);
        LocalVariableAllocator localVariableAllocator = new LocalVariableAllocator(parameterTypes);

View Full Code Here

            // Stash the name of the function in a static field
            String functionName = functionMapper.mapFunctionName(m.getName(), null);
            cv.visitField(ACC_PRIVATE | ACC_FINAL | ACC_STATIC, "name_" + i, ci(String.class), null, functionName);

            // Allow individual methods to set the calling convention to stdcall
            CallingConvention callingConvention = m.getAnnotation(StdCall.class) != null
                    ? CallingConvention.STDCALL : libraryCallingConvention;
            boolean saveErrno = InvokerUtil.requiresErrno(m);
            Function function;
            try {
                function = getFunction(library.findSymbolAddress(functionName),
View Full Code Here

                        + enums.getMetaClass().getName() + " (expected Hash)");

            }
        }

        CallingConvention callConvention = "stdcall".equals(convention)
                        ? CallingConvention.STDCALL : CallingConvention.DEFAULT;
        if (fptr == null && proc != null) {
            fptr = CallbackManager.getInstance().newClosure(context.runtime,
                    returnType, parameterTypes, proc, callConvention);
        }
View Full Code Here

                        + enums.getMetaClass().getName() + " (expected Hash or Enums)");

            }
        }

        CallingConvention callConvention = "stdcall".equals(convention)
                        ? CallingConvention.STDCALL : CallingConvention.DEFAULT;
        if (fptr == null && proc != null) {
            fptr = CallbackManager.getInstance().newClosure(context.runtime,
                    returnType, parameterTypes, proc, callConvention);
        }
View Full Code Here

        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,
                functionInvoker, FFIUtil.getFFIType(returnType), conv);
View Full Code Here

TOP

Related Classes of com.kenai.jffi.CallingConvention

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.