Top Inners Fields Constructors Methods
jnr.ffi

public abstract Class Platform

extends Object
Class Inheritance
Known Direct Subclasses
jnr.ffi.Platform.Supported, jnr.ffi.Platform.Unsupported
Imports
java.io.File, .FilenameFilter, java.util.ArrayList, .Collections, .LinkedHashMap, .List, .Map, java.util.regex.Matcher, .Pattern

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Platform.CPU

The supported CPU architectures.

private static class
Platform.Darwin

A Platform subclass representing the MacOS system.

private static class
pack-priv static class
pack-priv static class
Platform.Linux

A Platform subclass representing the Linux operating system.

public static enum
Platform.OS

The common names of supported operating systems.

private static class
private static class
private static class
private static class
Platform.Windows

A Platform subclass representing the Windows system.

Field Summary

Modifier and TypeField and Description
private final int
private final Platform.CPU
protected final Pattern
private static final Locale
private final int
private final Platform.OS

Constructor Summary

AccessConstructor and Description
public
Platform(Platform.OS os, Platform.CPU cpu, int addressSize, int longSize, String libPattern)

private

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

the size of a pointer in bits
addressSize
()

Deprecated Use Runtime#addressSize() instead.
Gets the size of a C address/pointer on the native platform.
private static int
private static Platform.CPU
private static Platform.OS

Returns:

An member of the OS enum.
determineOS
()

Determines the operating system jffi is running on

private static Platform

Returns:

An instance of Platform
determinePlatform
(Platform.OS
The operating system.
os
)

Determines the Platform that best describes the OS

private static Platform
private static boolean
public final Platform.CPU

Returns:

A CPU value representing the current processor architecture.
getCPU
()

Gets the current processor architecture the JVM is running on.

public String

Returns:

The name of this platform.
getName
()

Gets the name of this Platform.

public static Platform

Returns:

The current platform.
getNativePlatform
()

Gets the native Platform

public final Platform.OS

Returns:

A OS value representing the current Operating System.
getOS
()

Gets the current Operating System.

public final String

Returns:

the String representing the OS name from the System property os.name or null if none was found This is not the same as getOS() which returns the OS. For example: Mac OS X is the OS#DARWIN OS but returns "Mac OS X" from this method
getOSName
()

public static Platform
getPlatform()

Deprecated
public String

Returns:

The standard C library name
getStandardCLibraryName
()

Returns the platform specific standard C library name

public String

Returns:

the String representing the version of this platform, or null if none could be found
getVersion
()

Gets the version of this platform as specified by the system property "os.version"

public int

Returns:

the number representing the major version of this platform or -1 if none was found
getVersionMajor
()

Gets the number representing the major version of this platform This uses the first number from getVersion()

public int

Returns:

the number representing the minor version of this platform or -1 if none was found
getVersionMinor
()

Gets the number representing the minor version of this platform This uses the second number from getVersion()

private List<String>

Returns:

the list of version numbers found from getVersion() or an empty list if none were found
getVersionNumbers
()

public final boolean

Returns:

true if this platform is 32 bit, else false Note: do not use this to determine long size, instead use Runtime#longSize()
is32Bit
()

public final boolean

Returns:

true if this platform is 64 bit, else false Note: do not use this to determine long size, instead use Runtime#longSize()
is64Bit
()

public final boolean

Returns:

true if big endian, false otherwise or if cannot determine
isBigEndian
()

Returns true if the current platform is big endian

public final boolean
public final boolean

Returns:

true if little endian, false otherwise or if cannot determine
isLittleEndian
()

Returns true if the current platform is little endian

public final boolean
public List<String>

Returns:

the list of absolute paths where the library was found
libraryLocations
(String
the base name (e.g. "c") of the library to locate
libName
,
List<String>
additional paths to search, these take precedence over default paths, (as is the behavior in LibraryLoader) pass null to only search in the default paths
additionalPaths
)

Returns a list of absolute paths to the found locations of a library with the base name libName, if the returned list is empty then the library could not be found and will fail to be loaded as a result.

public String

Returns:

the path of the library
locateLibrary
(String
the base name (e.g. "c") of the library to locate
libName
,
List<String>
the list of directories to search
libraryPath
)

Searches through a list of directories for a native library.

public String

Returns:

the path of the library
locateLibrary
(String
the base name (e.g. "c") of the library to locate
libName
,
List<String>
the list of directories to search
libraryPaths
,
Map<LibraryOption, Object>
map of LibraryOptions to customize search behavior such as LibraryOption#PreferCustomPaths
options
)

Searches through a list of directories for a native library.

public final int

Returns:

the size of a long in bits
longSize
()

Deprecated Use Runtime#longSize() instead.
Gets the size of a C 'long' on the native platform.
public String

Returns:

The mapped library name.
mapLibraryName
(String
The library name to map
libName
)

Maps from a generic library name (e.g. "c") to the platform specific library name.

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait