1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 * Author: Alexander Larsson <alexl@redhat.com>
21 #ifndef __G_UNIX_MOUNTS_H__
22 #define __G_UNIX_MOUNTS_H__
31 * Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
32 * This corresponds roughly to a mtab entry.
34 typedef struct _GUnixMountEntry GUnixMountEntry;
36 #define G_TYPE_UNIX_MOUNT_ENTRY (g_unix_mount_entry_get_type ())
37 GLIB_AVAILABLE_IN_2_54
38 GType g_unix_mount_entry_get_type (void) G_GNUC_CONST;
43 * Defines a Unix mount point (e.g. <filename>/dev</filename>).
44 * This corresponds roughly to a fstab entry.
46 typedef struct _GUnixMountPoint GUnixMountPoint;
48 #define G_TYPE_UNIX_MOUNT_POINT (g_unix_mount_point_get_type ())
49 GLIB_AVAILABLE_IN_2_54
50 GType g_unix_mount_point_get_type (void) G_GNUC_CONST;
55 * Watches #GUnixMounts for changes.
57 typedef struct _GUnixMountMonitor GUnixMountMonitor;
58 typedef struct _GUnixMountMonitorClass GUnixMountMonitorClass;
60 #define G_TYPE_UNIX_MOUNT_MONITOR (g_unix_mount_monitor_get_type ())
61 #define G_UNIX_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitor))
62 #define G_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitorClass))
63 #define G_IS_UNIX_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_UNIX_MOUNT_MONITOR))
64 #define G_IS_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_UNIX_MOUNT_MONITOR))
65 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountMonitor, g_object_unref)
68 void g_unix_mount_free (GUnixMountEntry *mount_entry);
69 GLIB_AVAILABLE_IN_2_54
70 GUnixMountEntry *g_unix_mount_copy (GUnixMountEntry *mount_entry);
72 void g_unix_mount_point_free (GUnixMountPoint *mount_point);
73 GLIB_AVAILABLE_IN_2_54
74 GUnixMountPoint *g_unix_mount_point_copy (GUnixMountPoint *mount_point);
76 gint g_unix_mount_compare (GUnixMountEntry *mount1,
77 GUnixMountEntry *mount2);
79 const char * g_unix_mount_get_mount_path (GUnixMountEntry *mount_entry);
81 const char * g_unix_mount_get_device_path (GUnixMountEntry *mount_entry);
83 const char * g_unix_mount_get_fs_type (GUnixMountEntry *mount_entry);
85 gboolean g_unix_mount_is_readonly (GUnixMountEntry *mount_entry);
87 gboolean g_unix_mount_is_system_internal (GUnixMountEntry *mount_entry);
89 gboolean g_unix_mount_guess_can_eject (GUnixMountEntry *mount_entry);
91 gboolean g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry);
93 char * g_unix_mount_guess_name (GUnixMountEntry *mount_entry);
95 GIcon * g_unix_mount_guess_icon (GUnixMountEntry *mount_entry);
97 GIcon * g_unix_mount_guess_symbolic_icon (GUnixMountEntry *mount_entry);
100 GLIB_AVAILABLE_IN_ALL
101 gint g_unix_mount_point_compare (GUnixMountPoint *mount1,
102 GUnixMountPoint *mount2);
103 GLIB_AVAILABLE_IN_ALL
104 const char * g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point);
105 GLIB_AVAILABLE_IN_ALL
106 const char * g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point);
107 GLIB_AVAILABLE_IN_ALL
108 const char * g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point);
109 GLIB_AVAILABLE_IN_2_32
110 const char * g_unix_mount_point_get_options (GUnixMountPoint *mount_point);
111 GLIB_AVAILABLE_IN_ALL
112 gboolean g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point);
113 GLIB_AVAILABLE_IN_ALL
114 gboolean g_unix_mount_point_is_user_mountable (GUnixMountPoint *mount_point);
115 GLIB_AVAILABLE_IN_ALL
116 gboolean g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point);
117 GLIB_AVAILABLE_IN_ALL
118 gboolean g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_point);
119 GLIB_AVAILABLE_IN_ALL
120 char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point);
121 GLIB_AVAILABLE_IN_ALL
122 GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point);
123 GLIB_AVAILABLE_IN_ALL
124 GIcon * g_unix_mount_point_guess_symbolic_icon (GUnixMountPoint *mount_point);
127 GLIB_AVAILABLE_IN_ALL
128 GList * g_unix_mount_points_get (guint64 *time_read);
129 GLIB_AVAILABLE_IN_ALL
130 GList * g_unix_mounts_get (guint64 *time_read);
131 GLIB_AVAILABLE_IN_ALL
132 GUnixMountEntry *g_unix_mount_at (const char *mount_path,
134 GLIB_AVAILABLE_IN_2_52
135 GUnixMountEntry *g_unix_mount_for (const char *file_path,
137 GLIB_AVAILABLE_IN_ALL
138 gboolean g_unix_mounts_changed_since (guint64 time);
139 GLIB_AVAILABLE_IN_ALL
140 gboolean g_unix_mount_points_changed_since (guint64 time);
142 GLIB_AVAILABLE_IN_ALL
143 GType g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
144 GLIB_AVAILABLE_IN_2_44
145 GUnixMountMonitor *g_unix_mount_monitor_get (void);
146 GLIB_DEPRECATED_IN_2_44_FOR(g_unix_mount_monitor_get)
147 GUnixMountMonitor *g_unix_mount_monitor_new (void);
148 GLIB_DEPRECATED_IN_2_44
149 void g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
152 GLIB_AVAILABLE_IN_ALL
153 gboolean g_unix_is_mount_path_system_internal (const char *mount_path);
157 #endif /* __G_UNIX_MOUNTS_H__ */