Package jnr.ffi

Class Platform


  • public abstract class Platform
    extends Object
    • Field Detail

      • libPattern

        protected final Pattern libPattern
    • Method Detail

      • getNativePlatform

        public static Platform getNativePlatform()
        Gets the native Platform
        Returns:
        The current platform.
      • getOS

        public final Platform.OS getOS()
        Gets the current Operating System.
        Returns:
        A OS value representing the current Operating System.
      • getCPU

        public final Platform.CPU getCPU()
        Gets the current processor architecture the JVM is running on.
        Returns:
        A CPU value representing the current processor architecture.
      • isBSD

        public final boolean isBSD()
      • isUnix

        public final boolean isUnix()
      • longSize

        public final int longSize()
        Deprecated.
        Use Runtime.longSize() instead.
        Gets the size of a C 'long' on the native platform.
        Returns:
        the size of a long in bits
      • addressSize

        public final int addressSize()
        Deprecated.
        Gets the size of a C address/pointer on the native platform.
        Returns:
        the size of a pointer in bits
      • getName

        public String getName()
        Gets the name of this Platform.
        Returns:
        The name of this platform.
      • getStandardCLibraryName

        public String getStandardCLibraryName()
        Returns the platform specific standard C library name
        Returns:
        The standard C library name
      • mapLibraryName

        public String mapLibraryName​(String libName)
        Maps from a generic library name (e.g. "c") to the platform specific library name.
        Parameters:
        libName - The library name to map
        Returns:
        The mapped library name.
      • locateLibrary

        public String locateLibrary​(String libName,
                                    List<String> libraryPath)
        Searches through a list of directories for a native library.
        Parameters:
        libName - the base name (e.g. "c") of the library to locate
        libraryPath - the list of directories to search
        Returns:
        the path of the library