Documentation of 'com.jstatcom.engine.CFunc' Java class
CFunc
com.jstatcom.engine

Class CFunc



  • public final class CFunc
    extends CPtr
    An abstraction for a C function pointer. An instance of CFunc represents a pointer to some C function. callXXX methods provide means to call the function; select a xxx variant based on the return type of the C function.

    Beware that the copyIn, copyOut, setXXX, and getXXX methods inherited from the parent will indirect machine code.

    See Also:
    CPtr
    • Constructor Detail

      • CFunc

        public CFunc(java.lang.String lib,
                     java.lang.String fname,
                     java.lang.String conv)
        Create a new CFunc that is linked with a C function that follows a given calling convention.

        The allocated instance represents a pointer to the named C function from the named library, called with the named calling convention.

        Parameters:
        lib - library in which to find the C function
        fname - name of the C function to be linked with
        conv - calling convention used by the C function
      • CFunc

        public CFunc(java.lang.String lib,
                     java.lang.String fname)
        Create a new CFunc that is linked with a C function that follows the standard "C" calling convention.

        The allocated instance represents a pointer to the named C function from the named library, called with the standard "C" calling convention.

        Parameters:
        lib - library in which to find the C function
        fname - name of the C function to be linked with
    • Method Detail

      • callInt

        public int callInt(java.lang.Object[] args)
        Call the C function being represented by this object.
        Parameters:
        args - arguments to pass to the C function
        Returns:
        int value returned by the underlying C function
      • callVoid

        public void callVoid(java.lang.Object[] args)
        Call the C function being represented by this object.
        Parameters:
        args - arguments to pass to the C function
      • callFloat

        public float callFloat(java.lang.Object[] args)
        Call the C function being represented by this object.
        Parameters:
        args - arguments to pass to the C function
        Returns:
        float value returned by the underlying C function
      • callDouble

        public double callDouble(java.lang.Object[] args)
        Call the C function being represented by this object.
        Parameters:
        args - arguments to pass to the C function
        Returns:
        double value returned by the underlying C function
      • callCPtr

        public CPtr callCPtr(java.lang.Object[] args)
        Call the C function being represented by this object.
        Parameters:
        args - arguments to pass to the C function
        Returns:
        C pointer returned by the underlying C function

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.