![]() |
![]() |
![]() |
Storaged Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
StoragedMount; enum StoragedMountType; dev_t storaged_mount_get_dev (StoragedMount *mount
); StoragedMountType storaged_mount_get_mount_type (StoragedMount *mount
); const gchar * storaged_mount_get_mount_path (StoragedMount *mount
); gint storaged_mount_compare (StoragedMount *mount
,StoragedMount *other_mount
); StoragedMountMonitor; StoragedMountMonitor * storaged_mount_monitor_new (void
); GList * storaged_mount_monitor_get_mounts_for_dev (StoragedMountMonitor *monitor
,dev_t dev
); gboolean storaged_mount_monitor_is_dev_in_use (StoragedMountMonitor *monitor
,dev_t dev
,StoragedMountType *out_type
);
This type is used for monitoring mounted devices and swap devices
in use. On Linux, this is done by inspecting and monitoring the
/proc/self/mountinfo
and
/proc/swaps
files.
typedef struct _StoragedMount StoragedMount;
The StoragedMount structure contains only private data and should only be accessed using the provided API.
typedef enum { STORAGED_MOUNT_TYPE_FILESYSTEM, STORAGED_MOUNT_TYPE_SWAP } StoragedMountType;
Types of a mount.
dev_t storaged_mount_get_dev (StoragedMount *mount
);
Gets the device number for mount
.
|
A StoragedMount. |
Returns : |
A dev_t. |
StoragedMountType storaged_mount_get_mount_type (StoragedMount *mount
);
Gets the StoragedMountType for mount
.
|
A StoragedMount. |
Returns : |
A value from the StoragedMountType enumeration. |
const gchar * storaged_mount_get_mount_path (StoragedMount *mount
);
Gets the mount path for a STORAGED_MOUNT_TYPE_FILESYSTEM-type mount.
It is a programming error to call this on any other type of StoragedMount.
|
A StoragedMount |
Returns : |
A string owned by mount . Do not free. |
gint storaged_mount_compare (StoragedMount *mount
,StoragedMount *other_mount
);
Comparison function for comparing two StoragedMount objects.
|
A StoragedMount |
|
Another StoragedMount. |
Returns : |
Negative value if mount < other_mount ; zero if mount = other_mount ; positive value if mount > other_mount . |
typedef struct _StoragedMountMonitor StoragedMountMonitor;
The StoragedMountMonitor structure contains only private data and should only be accessed using the provided API.
StoragedMountMonitor * storaged_mount_monitor_new (void
);
Creates a new StoragedMountMonitor object.
Signals are emitted in the
Returns : |
A StoragedMountMonitor. Free with g_object_unref() . |
GList * storaged_mount_monitor_get_mounts_for_dev (StoragedMountMonitor *monitor
,dev_t dev
);
Gets all StoragedMount objects for dev
.
|
A StoragedMountMonitor. |
|
A dev_t device number. |
Returns : |
A GList of StoragedMount objects. The returned list must
be freed with g_list_free() after each element has been freed with
g_object_unref() . |
gboolean storaged_mount_monitor_is_dev_in_use (StoragedMountMonitor *monitor
,dev_t dev
,StoragedMountType *out_type
);
Checks if dev
is in use (e.g. mounted or swap-area in-use).
|
A StoragedMountMonitor. |
|
A dev_t device number. |
|
Return location for mount type, if in use or NULL . [out allow-none]
|
Returns : |
TRUE if in use, FALSE otherwise. |
"mount-added"
signalvoid user_function (StoragedMountMonitor *monitor,
StoragedMount *mount,
gpointer user_data) : Has Details
Emitted when a mount is added.
This signal is emitted in the
thread-default main loop
that monitor
was created in.
|
A StoragedMountMonitor. |
|
The StoragedMount that was added. |
|
user data set when the signal handler was connected. |
"mount-removed"
signalvoid user_function (StoragedMountMonitor *monitor,
StoragedMount *mount,
gpointer user_data) : Has Details
Emitted when a mount is removed.
This signal is emitted in the
thread-default main loop
that monitor
was created in.
|
A StoragedMountMonitor. |
|
The StoragedMount that was removed. |
|
user data set when the signal handler was connected. |