| 1 |
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- |
| 2 |
* |
| 3 |
* Copyright (C) 2014 Tomas Bzatek <[email protected]> |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2 of the License, or |
| 8 |
* (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "config.h" |
| 22 |
|
| 23 |
#include <sys/types.h> |
| 24 |
|
| 25 |
#include <string.h> |
| 26 |
#include <stdlib.h> |
| 27 |
#include <stdio.h> |
| 28 |
|
| 29 |
#include <src/udiskslogging.h> |
| 30 |
#include <src/udiskslinuxblockobject.h> |
| 31 |
#include <src/udisksdaemon.h> |
| 32 |
#include <src/udisksdaemonutil.h> |
| 33 |
#include <src/udiskslinuxdevice.h> |
| 34 |
|
| 35 |
#include "udiskslinuxblocklvm2.h" |
| 36 |
|
| 37 |
/** |
| 38 |
* SECTION:udiskslinuxblocklvm2 |
| 39 |
* @title: UDisksLinuxBlockLVM2 |
| 40 |
* @short_description: Linux implementation of #UDisksBlockLVM2 |
| 41 |
* |
| 42 |
* This type provides an implementation of the #UDisksBlockLVM2 |
| 43 |
* interface on Linux. |
| 44 |
*/ |
| 45 |
|
| 46 |
typedef struct _UDisksLinuxBlockLVM2Class UDisksLinuxBlockLVM2Class; |
| 47 |
|
| 48 |
/** |
| 49 |
* UDisksLinuxBlockLVM2: |
| 50 |
* |
| 51 |
* The #UDisksLinuxBlockLVM2 structure contains only private data and should |
| 52 |
* only be accessed using the provided API. |
| 53 |
*/ |
| 54 |
struct _UDisksLinuxBlockLVM2 |
| 55 |
{ |
| 56 |
UDisksBlockLVM2Skeleton parent_instance; |
| 57 |
}; |
| 58 |
|
| 59 |
struct _UDisksLinuxBlockLVM2Class |
| 60 |
{ |
| 61 |
UDisksBlockLVM2SkeletonClass parent_class; |
| 62 |
}; |
| 63 |
|
| 64 |
static void udisks_linux_block_lvm2_iface_init (UDisksBlockLVM2Iface *iface); |
| 65 |
|
| 66 |
G_DEFINE_TYPE_WITH_CODE (UDisksLinuxBlockLVM2, udisks_linux_block_lvm2, UDISKS_TYPE_BLOCK_LVM2_SKELETON, |
| 67 |
G_IMPLEMENT_INTERFACE (UDISKS_TYPE_BLOCK_LVM2, udisks_linux_block_lvm2_iface_init)); |
| 68 |
|
| 69 |
/* ---------------------------------------------------------------------------------------------------- */ |
| 70 |
|
| 71 |
static void |
| 72 |
udisks_linux_block_lvm2_init (UDisksLinuxBlockLVM2 *block) |
| 73 |
{ |
| 74 |
} |
| 75 |
|
| 76 |
static void |
| 77 |
udisks_linux_block_lvm2_constructed (GObject *_object) |
| 78 |
{ |
| 79 |
if (G_OBJECT_CLASS (udisks_linux_block_lvm2_parent_class)->constructed != NULL) |
| 80 |
G_OBJECT_CLASS (udisks_linux_block_lvm2_parent_class)->constructed (_object); |
| 81 |
} |
| 82 |
|
| 83 |
static void |
| 84 |
udisks_linux_block_lvm2_finalize (GObject *_object) |
| 85 |
{ |
| 86 |
if (G_OBJECT_CLASS (udisks_linux_block_lvm2_parent_class)->finalize != NULL) |
| 87 |
G_OBJECT_CLASS (udisks_linux_block_lvm2_parent_class)->finalize (_object); |
| 88 |
} |
| 89 |
|
| 90 |
static void |
| 91 |
udisks_linux_block_lvm2_class_init (UDisksLinuxBlockLVM2Class *klass) |
| 92 |
{ |
| 93 |
GObjectClass *gobject_class; |
| 94 |
|
| 95 |
gobject_class = G_OBJECT_CLASS (klass); |
| 96 |
gobject_class->finalize = udisks_linux_block_lvm2_finalize; |
| 97 |
gobject_class->constructed = udisks_linux_block_lvm2_constructed; |
| 98 |
} |
| 99 |
|
| 100 |
/** |
| 101 |
* udisks_linux_block_lvm2_new: |
| 102 |
* |
| 103 |
* Creates a new #UDisksLinuxBlockLVM2 instance. |
| 104 |
* |
| 105 |
* Returns: A new #UDisksLinuxBlockLVM2. Free with g_object_unref(). |
| 106 |
*/ |
| 107 |
UDisksBlockLVM2 * |
| 108 |
udisks_linux_block_lvm2_new (void) |
| 109 |
{ |
| 110 |
return UDISKS_BLOCK_LVM2 (g_object_new (UDISKS_TYPE_LINUX_BLOCK_LVM2, NULL)); |
| 111 |
} |
| 112 |
|
| 113 |
/* ---------------------------------------------------------------------------------------------------- */ |
| 114 |
|
| 115 |
/** |
| 116 |
* udisks_linux_block_lvm2_update: |
| 117 |
* @block_lvm2: A #UDisksLinuxBlockLVM2. |
| 118 |
* @object: The enclosing #UDisksLinuxBlockObject instance. |
| 119 |
* |
| 120 |
* Updates the interface. |
| 121 |
* |
| 122 |
* Returns: %TRUE if configuration has changed, %FALSE otherwise. |
| 123 |
*/ |
| 124 |
gboolean |
| 125 |
udisks_linux_block_lvm2_update (UDisksLinuxBlockLVM2 *block_lvm2, |
| 126 |
UDisksLinuxBlockObject *object) |
| 127 |
{ |
| 128 |
/* do something */ |
| 129 |
|
| 130 |
return FALSE; |
| 131 |
} |
| 132 |
|
| 133 |
/* ---------------------------------------------------------------------------------------------------- */ |
| 134 |
|
| 135 |
static void |
| 136 |
udisks_linux_block_lvm2_iface_init (UDisksBlockLVM2Iface *iface) |
| 137 |
{ |
| 138 |
} |