Package jnr.ffi

Enum NativeType

  • All Implemented Interfaces:
    Serializable, Comparable<NativeType>

    public enum NativeType
    extends Enum<NativeType>
    NativeType defines the primitive types supported internally. Usually you will not use these types directly, and should instead use the standard types such as Pointer, NativeLong, or any of the normal java types such as int, short. All other types are defined in terms of these primitive types.
    • Enum Constant Detail

      • VOID

        public static final NativeType VOID
        Void type. Only used for function return types.
      • SCHAR

        public static final NativeType SCHAR
        Signed char. Equivalent to a C char or signed char type. Usually 1 byte in size.
      • UCHAR

        public static final NativeType UCHAR
        Unsigned char. Equivalent to a C unsigned char type. Usually 1 byte in size
      • SSHORT

        public static final NativeType SSHORT
        Signed short integer. Equivalent to a C short or signed short type. Usually 2 bytes in size.
      • USHORT

        public static final NativeType USHORT
        Unsigned short integer. Equivalent to a C unsigned short type. Usually 2 bytes in size.
      • SINT

        public static final NativeType SINT
        Signed integer. Equivalent to a C int or signed int type. Usually 4 bytes in size.
      • UINT

        public static final NativeType UINT
        Unsigned integer. Equivalent to a C unsigned int type. Usually 4 bytes in size.
      • SLONG

        public static final NativeType SLONG
        Signed long integer. Equivalent to a C long or signed long type. Can be either 4 or 8 bytes in size, depending on the platform.
      • ULONG

        public static final NativeType ULONG
        Unsigned long integer. Equivalent to a C unsigned long type. Can be either 4 or 8 bytes in size, depending on the platform.
      • SLONGLONG

        public static final NativeType SLONGLONG
        Signed long long integer. Equivalent to a C long long or signed long long type. Usually 8 bytes in size.
      • ULONGLONG

        public static final NativeType ULONGLONG
        Unsigned long long integer. Equivalent to a C unsigned long long type. Usually 8 bytes in size.
      • FLOAT

        public static final NativeType FLOAT
        Single precision floating point. Equivalent to a C float type. Usually 4 bytes in size.
      • DOUBLE

        public static final NativeType DOUBLE
        Double precision floating point. Equivalent to a C double type. Usually 8 bytes in size.
      • STRUCT

        public static final NativeType STRUCT
        Native struct type
      • ADDRESS

        public static final NativeType ADDRESS
        Native memory address. Equivalent to a C void* or char* pointer type. Can be either 4 or 8 bytes in size, depending on the platform.
    • Method Detail

      • values

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

        public static NativeType valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null