Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.cldc.jna
Class Function

    java.lang.Object
      com.sun.cldc.jna.Function

Direct Known Subclasses:
  BlockingFunction

    public class Function

extends Object

A pointer to a native function that can be called from Java. A native function represented by a Function should not block. If you need to calling a blocking function, use the BlockingFunction class.

### Differences from JNA

- Function is NOT a subclass of Pointer
- Invocation is via calls to one of the predfined "call()" methods, not using the generic invoke() method.
- Throws RuntimeExceptions instead of UnsatisfiedLinkErrors. Are link errors really "unrecoverable"? Platform independant code might want to work around missing functions.
- Calling conventions unimplemented
- no finalization in cldc, need to call dispose() explicitly (could add a shutdownhook though).
- no parseVersion();
- no getFile()

Field Summary
`protected static boolean` | `DEBUG`
`protected Address` | `funcAddr`
`protected String` | `name`

Method Summary
`int` | `call0()`
`int` | `call1(int i1)`
`int` | `call1(Pointer p1)`
`int` | `call10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10)`
`int` | `call2(int i1, int i2)`
`int` | `call2(int i1, Pointer p2)`
`int` | `call2(Pointer p1, int i2)`
`int` | `call2(Pointer p1, Pointer p2)`
`int` | `call3(int i1, int i2, int i3)`
`int` | `call3(int i1, int i2, Pointer p3)`
`int` | `call3(int i1, Pointer p2, int i3)`
`int` | `call3(int i1, Pointer p2, Pointer p3)`
`int` | `call3(Pointer p1, int i2, int i3)`
`int` | `call3(Pointer p1, int i2, Pointer p3)`
`int` | `call3(Pointer p1, Pointer p2, int i3)`
`int` | `call3(Pointer p1, Pointer p2, Pointer p3)`
`int` | `call4(int i1, int i2, int i3, int i4)`
`int` | `call4(int i1, int i2, int i3, Pointer p4)`
`int` | `call4(int i1, int i2, Pointer p3, int i4)`
`int` | `call4(int i1, int i2, Pointer p3, Pointer p4)`
`int` | `call4(int i1, Pointer p2, int i3, int i4)`
`int` | `call4(int i1, Pointer p2, int i3, Pointer p4)`
`int` | `call4(int i1, Pointer p2, Pointer p3, int i4)`
`int` | `call4(int i1, Pointer p2, Pointer p3, Pointer p4)`
`int` | `call4(Pointer p1, int i2, int i3, int i4)`
`int` | `call4(Pointer p1, int i2, int i3, Pointer p4)`
`int` | `call4(Pointer p1, int i2, Pointer p3, int i4)`
`int` | `call4(Pointer p1, int i2, Pointer p3, Pointer p4)`
`int` | `call4(Pointer p1, Pointer p2, int i3, int i4)`
`int` | `call4(Pointer p1, Pointer p2, int i3, Pointer p4)`
`int` | `call4(Pointer p1, Pointer p2, Pointer p3, int i4)`
`int` | `call4(Pointer p1, Pointer p2, Pointer p3, Pointer p4)`
`int` | `call5(int i1, int i2, int i3, int i4, int i5)`
`int` | `call5(int i1, int i2, int i3, int i4, int i5, Pointer p5)`
`int` | `call5(int i1, int i2, int i3, Pointer p4, int i5)`
`int` | `call5(int i1, int i2, int i3, Pointer p4, Pointer p5)`
`int` | `call5(int i1, int i2, Pointer p3, int i4, int i5)`
`int` | `call5(int i1, int i2, Pointer p3, int i4, Pointer p5)`
`int` | `call5(int i1, int i2, Pointer p3, Pointer p4, int i5)`
`int` | `call5(int i1, int i2, Pointer p3, Pointer p4, Pointer p5)`
`int` | `call5(int i1, Pointer p2, int i3, int i4, int i5)`
`int` | `call5(int i1, Pointer p2, int i3, int i4, Pointer p5)`
`int` | `call5(int i1, Pointer p2, int i3, Pointer p4, int i5)`
`int` | `call5(int i1, Pointer p2, int i3, Pointer p4, Pointer p5)`
`int` | `call5(int i1, Pointer p2, Pointer p3, int i4, int i5)`
`int` | `call5(int i1, Pointer p2, Pointer p3, int i4, Pointer p5)`
`int` | `call5(int i1, Pointer p2, Pointer p3, Pointer p4, int i5)`
`int` | `call5(int i1, Pointer p2, Pointer p3, Pointer p4, Pointer p5)`
`int` | `call5(Pointer p1, int i2, int i3, int i4, int i5)`
`int` | `call5(Pointer p1, int i2, int i3, int i4, Pointer p5)`
`int` | `call5(Pointer p1, int i2, int i3, Pointer p4, int i5)`
`int` | `call5(Pointer p1, int i2, int i3, Pointer p4, Pointer p5)`
`int` | `call5(Pointer p1, int i2, Pointer p3, int i4, int i5)`
`int` | `call5(Pointer p1, int i2, Pointer p3, int i4, Pointer p5)`
`int` | `call5(Pointer p1, int i2, Pointer p3, Pointer p4, int i5)`
`int` | `call5(Pointer p1, int i2, Pointer p3, Pointer p4, Pointer p5)`
`int` | `call5(Pointer p1, Pointer p2, int i3, int i4, int i5)`
`int` | `call5(Pointer p1, Pointer p2, int i3, int i4, Pointer p5)`
`int` | `call5(Pointer p1, Pointer p2, int i3, Pointer p4, int i5)`
`int` | `call5(Pointer p1, Pointer p2, int i3, Pointer p4, Pointer p5)`
`int` | `call5(Pointer p1, Pointer p2, Pointer p3, int i4, int i5)`
`int` | `call5(Pointer p1, Pointer p2, Pointer p3, int i4, Pointer p5)`
`int` | `call5(Pointer p1, Pointer p2, Pointer p3, Pointer p4, int i5)`
`int` | `call5(Pointer p1, Pointer p2, Pointer p3, Pointer p4, Pointer p5)`
`int` | `call6(int i1, int i2, int i3, int i4, int i5, int i6)`
`int` | `call7(int i1, int i2, int i3, int i4, int i5, int i6, int i7)`
`int` | `call8(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8)`
`int` | `call9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)`
`static int` | `errno()` Return the system errno value from the last native function call made by this Java thread.
`static Function` | `getFunction(String libraryName, String funcName)` Dynamically look up a native function by name in the named library.
`String` | `getName()`
`protected void` | `postscript(int result)`
`protected void` | `preamble()`
`static String` | `returnString(int ptr)` Standard conversion function that creates java string from a C char* `ptr`.
`static Structure` | `returnStruct(Class klass, int ptr)` Standard conversion function that creates an structure instance of type `klass` from a C address `ptr`.
`String` | `toString()` Returns a string representation of the object.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEBUG

    protected static final boolean DEBUG

See Also:
  Constant Field Values

### funcAddr

    protected final Address funcAddr

### name

    protected final String name

Method Detail

### getFunction

    public static Function getFunction(String libraryName,
                                       String funcName)

  Dynamically look up a native function by name in the named library.

  Parameters:
    `libraryName` -
    `funcName` -
  Returns:
    an object that can be used to call the named function
  Throws:
    `RuntimeException` - if there is no function by that name.

### errno

    public static int errno()

  Return the system errno value from the last native function call made by this Java thread.

  Returns:

### getName

    public String getName()

  Returns:
    the function name

### toString

    public String toString()

  Description copied from class: `Object`
  Returns a string representation of the object. In general, the `toString` method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

  The `toString` method for class `Object` returns a string consisting of the name of the class of which the object is an instance, the at-sign character ``@`', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

  >      getClass().getName() + '@' + Integer.toHexString(hashCode())

  Overrides:
    `toString` in class `Object`
  Returns:
    a string representation of the object.

### preamble

    protected void preamble()

### postscript

    protected void postscript(int result)

### call0

    public int call0()

### call1

    public int call1(int i1)

### call2

    public int call2(int i1,
                     int i2)

### call3

    public int call3(int i1,
                     int i2,
                     int i3)

### call4

    public int call4(int i1,
                     int i2,
                     int i3,
                     int i4)

### call5

    public int call5(int i1,
                     int i2,
                     int i3,
                     int i4,
                     int i5)

### call6

    public int call6(int i1,
                     int i2,
                     int i3,
                     int i4,
                     int i5,
                     int i6)

### call7

    public int call7(int i1,
                     int i2,
                     int i3,
                     int i4,
                     int i5,
                     int i6,
                     int i7)

### call8

    public int call8(int i1,
                     int i2,
                     int i3,
                     int i4,
                     int i5,
                     int i6,
                     int i7,
                     int i8)

### call9

    public int call9(int i1,
                     int i2,
                     int i3,
                     int i4,
                     int i5,
                     int i6,
                     int i7,
                     int i8,
                     int i9)

### call10

    public int call10(int i1,
                      int i2,
                      int i3,
                      int i4,
                      int i5,
                      int i6,
                      int i7,
                      int i8,
                      int i9,
                      int i10)

### call1

    public int call1(Pointer p1)

### call2

    public int call2(int i1,
                     Pointer p2)

### call2

    public int call2(Pointer p1,
                     int i2)

### call2

    public int call2(Pointer p1,
                     Pointer p2)

### call3

    public int call3(int i1,
                     int i2,
                     Pointer p3)

### call3

    public int call3(int i1,
                     Pointer p2,
                     int i3)

### call3

    public int call3(int i1,
                     Pointer p2,
                     Pointer p3)

### call3

    public int call3(Pointer p1,
                     int i2,
                     int i3)

### call3

    public int call3(Pointer p1,
                     int i2,
                     Pointer p3)

### call3

    public int call3(Pointer p1,
                     Pointer p2,
                     int i3)

### call3

    public int call3(Pointer p1,
                     Pointer p2,
                     Pointer p3)

### call4

    public int call4(int i1,
                     int i2,
                     int i3,
                     Pointer p4)

### call4

    public int call4(int i1,
                     int i2,
                     Pointer p3,
                     int i4)

### call4

    public int call4(int i1,
                     int i2,
                     Pointer p3,
                     Pointer p4)

### call4

    public int call4(int i1,
                     Pointer p2,
                     int i3,
                     int i4)

### call4

    public int call4(int i1,
                     Pointer p2,
                     int i3,
                     Pointer p4)

### call4

    public int call4(int i1,
                     Pointer p2,
                     Pointer p3,
                     int i4)

### call4

    public int call4(int i1,
                     Pointer p2,
                     Pointer p3,
                     Pointer p4)

### call4

    public int call4(Pointer p1,
                     int i2,
                     int i3,
                     int i4)

### call4

    public int call4(Pointer p1,
                     int i2,
                     int i3,
                     Pointer p4)

### call4

    public int call4(Pointer p1,
                     int i2,
                     Pointer p3,
                     int i4)

### call4

    public int call4(Pointer p1,
                     int i2,
                     Pointer p3,
                     Pointer p4)

### call4

    public int call4(Pointer p1,
                     Pointer p2,
                     int i3,
                     int i4)

### call4

    public int call4(Pointer p1,
                     Pointer p2,
                     int i3,
                     Pointer p4)

### call4

    public int call4(Pointer p1,
                     Pointer p2,
                     Pointer p3,
                     int i4)

### call4

    public int call4(Pointer p1,
                     Pointer p2,
                     Pointer p3,
                     Pointer p4)

### call5

    public int call5(int i1,
                     int i2,
                     int i3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(int i1,
                     int i2,
                     Pointer p3,
                     int i4,
                     int i5)

### call5

    public int call5(int i1,
                     int i2,
                     Pointer p3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     int i3,
                     int i4,
                     int i5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     int i3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     Pointer p3,
                     int i4,
                     int i5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     Pointer p3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     int i3,
                     int i4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     int i3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     Pointer p3,
                     int i4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     Pointer p3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     int i3,
                     int i4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     int i3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     Pointer p3,
                     int i4,
                     int i5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     Pointer p3,
                     Pointer p4,
                     int i5)

### call5

    public int call5(int i1,
                     int i2,
                     int i3,
                     int i4,
                     int i5,
                     Pointer p5)

### call5

    public int call5(int i1,
                     int i2,
                     int i3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(int i1,
                     int i2,
                     Pointer p3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(int i1,
                     int i2,
                     Pointer p3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     int i3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     int i3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     Pointer p3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(int i1,
                     Pointer p2,
                     Pointer p3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     int i3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     int i3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     Pointer p3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     int i2,
                     Pointer p3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     int i3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     int i3,
                     Pointer p4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     Pointer p3,
                     int i4,
                     Pointer p5)

### call5

    public int call5(Pointer p1,
                     Pointer p2,
                     Pointer p3,
                     Pointer p4,
                     Pointer p5)

### returnStruct

    public static Structure returnStruct(Class klass,
                                         int ptr)

  Standard conversion function that creates an structure instance of type `klass` from a C address `ptr`. If `addr0` is not NULL, create a new Structure object and copy the data from the C struct to the Structure object.

  Parameters:
    `klass` -
    `ptr` - the raw native address of the C struct
  Returns:
    null, or a Structure containing the data from C struct

### returnString

    public static String returnString(int ptr)

  Standard conversion function that creates java string from a C char* `ptr`.

  Parameters:
    `ptr` - the raw native address of the C struct
  Returns:
    null, or Java String containing the string in Java format

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"