com.jinvoke
Enum CallingConvention

java.lang.Object
  extended by java.lang.Enum<CallingConvention>
      extended by com.jinvoke.CallingConvention
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CallingConvention>

public enum CallingConvention
extends java.lang.Enum<CallingConvention>

Indicates the calling convention of a native function. The calling convention is a standardized method for a program to pass parameters to a function and receive a result value back from it. All native functions use a calling convention, that describes how they receive function parameters and return results.

The calling convention is typically spcified in the method signature in header files, or in the associated documentation.
For example, in the following method declaration from a header file, WINAPI (STDCALL) refers to the calling convention: extern "C" WINAPI __declspec(dllexport) int NmcInit(char *portname, unsigned int baudrate); If a calling convention is not specified, J/Invoke uses the STDCALL calling convention.


Enum Constant Summary
CDECL
          The cdecl calling convention.
STDCALL
          The standard-call calling convention.
THISCALL
          The thiscall calling convention (described here).
 
Method Summary
 int getIntCode()
           
static CallingConvention valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static CallingConvention[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STDCALL

public static final CallingConvention STDCALL
The standard-call calling convention. This is the calling convention used by the Win32 API and is the default calling convention used by J/Invoke. Use this when calling the Win32 API, or methods declared as using WINAPI or STDCALL.


CDECL

public static final CallingConvention CDECL
The cdecl calling convention. This is the calling convention used by the C runtime library. Use this when calling the C-runtime library. Also, Visual C++, 32 bit edition uses cdecl as the default calling convention. If no calling convention is specified, use CDECL.


THISCALL

public static final CallingConvention THISCALL
The thiscall calling convention (described here). This is the default calling convention used by C++ member functions that do not use variable arguments. (For variardic functions, the cdecl convention is used.) When using THISCALL calling convention, the first argument of the method must be a Java int holding the address of the c++ object.

Method Detail

values

public static final CallingConvention[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(CallingConvention c : CallingConvention.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static CallingConvention valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getIntCode

public int getIntCode()