All Downloads are FREE. Search and download functionalities are using the official Maven repository.

oshi.jna.platform.mac.DiskArbitration Maven / Gradle / Ivy

package oshi.jna.platform.mac;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.PointerType;

/**
 * @author angju
 * 
 */
public interface DiskArbitration extends Library {
    DiskArbitration INSTANCE = (DiskArbitration) Native.loadLibrary("DiskArbitration", DiskArbitration.class);

    class DASessionRef extends PointerType {
    }

    class DADiskRef extends PointerType {
    }

    /**
     * Creates a new session. The caller of this function receives a reference
     * to the returned object. The caller also implicitly retains the object and
     * is responsible for releasing it with CFRelease().
     *
     * @param allocator
     *            The allocator object to be used to allocate memory.
     * @return A reference to a new DASession.
     */
    DASessionRef DASessionCreate(CoreFoundation.CFAllocatorRef allocator);

    /**
     * Creates a new disk object. The caller of this function receives a
     * reference to the returned object. The caller also implicitly retains the
     * object and is responsible for releasing it with CFRelease().
     *
     * @param allocator
     *            The allocator object to be used to allocate memory.
     * @param session
     *            The DASession in which to contact Disk Arbitration.
     * @param diskName
     *            he BSD device name.
     * @return A reference to a new DADisk.
     */
    DADiskRef DADiskCreateFromBSDName(CoreFoundation.CFAllocatorRef allocator, DASessionRef session, String diskName);

    /**
     * Creates a new disk object. The caller of this function receives a
     * reference to the returned object. The caller also implicitly retains the
     * object and is responsible for releasing it with CFRelease().
     *
     * @param allocator
     *            The allocator object to be used to allocate memory.
     * @param session
     *            The DASession in which to contact Disk Arbitration.
     * @param media
     *            The I/O Kit media object.
     * @return A reference to a new DADisk.
     */
    DADiskRef DADiskCreateFromIOMedia(CoreFoundation.CFAllocatorRef allocator, DASessionRef session, int media);

    /**
     * Obtains the Disk Arbitration description of the specified disk. This
     * function will contact Disk Arbitration to acquire the latest description
     * of the specified disk, unless this function is called on a disk object
     * passed within the context of a registered callback, in which case the
     * description is current as of that callback event.
     *
     * The caller of this function receives a reference to the returned object.
     * The caller also implicitly retains the object and is responsible for
     * releasing it with CFRelease().
     *
     * @param disk
     *            The DADisk for which to obtain the Disk Arbitration
     *            description.
     * @return The disk's Disk Arbitration description.
     */
    CoreFoundation.CFDictionaryRef DADiskCopyDescription(DADiskRef disk);

    /**
     * Obtains the BSD device name for the specified disk.
     *
     * @param disk
     *            The DADisk for which to obtain the BSD device name.
     *
     * @return The disk's BSD device name.
     */
    String DADiskGetBSDName(DADiskRef disk);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy