コード例 #1
0
ファイル: udiskslinuxprovider.c プロジェクト: GinoM/eudisk
/**
 * udisks_linux_provider_new:
 * @daemon: A #UDisksDaemon.
 *
 * Create a new provider object for Linux-specific objects / functionality.
 *
 * Returns: A #UDisksLinuxProvider object. Free with g_object_unref().
 */
UDisksLinuxProvider *
udisks_linux_provider_new (UDisksDaemon  *daemon)
{
  g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
  return UDISKS_LINUX_PROVIDER (g_object_new (UDISKS_TYPE_LINUX_PROVIDER,
                                              "daemon", daemon,
                                              NULL));
}
コード例 #2
0
ファイル: udiskslinuxblockobject.c プロジェクト: GinoM/eudisk
/**
 * udisks_linux_block_object_new:
 * @daemon: A #UDisksDaemon.
 * @device: The #UDisksLinuxDevice for the device.
 *
 * Create a new block object.
 *
 * Returns: A #UDisksLinuxBlockObject object. Free with g_object_unref().
 */
UDisksLinuxBlockObject *
udisks_linux_block_object_new (UDisksDaemon      *daemon,
                               UDisksLinuxDevice *device)
{
  g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
  return UDISKS_LINUX_BLOCK_OBJECT (g_object_new (UDISKS_TYPE_LINUX_BLOCK_OBJECT,
                                                  "daemon", daemon,
                                                  "device", device,
                                                  NULL));
}
コード例 #3
0
/**
 * udisks_linux_mdraid_object_new:
 * @daemon: A #UDisksDaemon.
 * @uuid: The UUID for the array.
 *
 * Create a new MDRaid object.
 *
 * Returns: A #UDisksLinuxMDRaidObject object. Free with g_object_unref().
 */
UDisksLinuxMDRaidObject *
udisks_linux_mdraid_object_new (UDisksDaemon  *daemon,
                                const gchar   *uuid)
{
  g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
  g_return_val_if_fail (uuid != NULL, NULL);
  return UDISKS_LINUX_MDRAID_OBJECT (g_object_new (UDISKS_TYPE_LINUX_MDRAID_OBJECT,
                                                   "daemon", daemon,
                                                   "uuid", uuid,
                                                   NULL));
}
コード例 #4
0
/**
 * udisks_linux_logical_volume_object_new:
 *
 * Create a new LogicalVolume object.
 *
 * Returns: A #UDisksLinuxLogicalVolumeObject object. Free with g_object_unref().
 */
UDisksLinuxLogicalVolumeObject *
udisks_linux_logical_volume_object_new (UDisksDaemon                 *daemon,
                                        UDisksLinuxVolumeGroupObject *volume_group,
                                        const gchar                  *name)
{
  g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
  g_return_val_if_fail (UDISKS_IS_LINUX_VOLUME_GROUP_OBJECT (volume_group), NULL);
  g_return_val_if_fail (name != NULL, NULL);

  return UDISKS_LINUX_LOGICAL_VOLUME_OBJECT (g_object_new (UDISKS_TYPE_LINUX_LOGICAL_VOLUME_OBJECT,
                                                           "daemon", daemon,
                                                           "volumegroup", volume_group,
                                                           "name", name,
                                                           NULL));
}
コード例 #5
0
ファイル: udiskslinuxdriveobject.c プロジェクト: GinoM/eudisk
/**
 * udisks_linux_drive_object_new:
 * @daemon: A #UDisksDaemon.
 * @device: The #UDisksLinuxDevice for the sysfs block device.
 *
 * Create a new drive object.
 *
 * Returns: A #UDisksLinuxDriveObject object or %NULL if @device does not represent a drive. Free with g_object_unref().
 */
UDisksLinuxDriveObject *
udisks_linux_drive_object_new (UDisksDaemon      *daemon,
                               UDisksLinuxDevice *device)
{
  GObject *object;

  g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
  g_return_val_if_fail (UDISKS_IS_LINUX_DEVICE (device), NULL);

  object = g_object_new (UDISKS_TYPE_LINUX_DRIVE_OBJECT,
                         "daemon", daemon,
                         "device", device,
                         NULL);

  if (object != NULL)
    return UDISKS_LINUX_DRIVE_OBJECT (object);
  else
    return NULL;
}