1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2006-2007 Red Hat, Inc.
4 *
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.
9 *
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.
14 *
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/>.
17 *
18 * Author: Alexander Larsson <alexl@redhat.com>
19 */
20
21#ifndef __G_UNIX_MOUNTS_H__
22#define __G_UNIX_MOUNTS_H__
23
24#include <gio/gio.h>
25
26G_BEGIN_DECLS
27
28/**
29 * GUnixMountEntry:
30 *
31 * Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
32 * This corresponds roughly to a mtab entry.
33 **/
34typedef struct _GUnixMountEntry GUnixMountEntry;
35
36#define G_TYPE_UNIX_MOUNT_ENTRY (g_unix_mount_entry_get_type ())
37GLIB_AVAILABLE_IN_2_54
38GType g_unix_mount_entry_get_type (void) G_GNUC_CONST;
39
40/**
41 * GUnixMountPoint:
42 *
43 * Defines a Unix mount point (e.g. <filename>/dev</filename>).
44 * This corresponds roughly to a fstab entry.
45 **/
46typedef struct _GUnixMountPoint GUnixMountPoint;
47
48#define G_TYPE_UNIX_MOUNT_POINT (g_unix_mount_point_get_type ())
49GLIB_AVAILABLE_IN_2_54
50GType g_unix_mount_point_get_type (void) G_GNUC_CONST;
51
52/**
53 * GUnixMountMonitor:
54 *
55 * Watches #GUnixMounts for changes.
56 **/
57typedef struct _GUnixMountMonitor GUnixMountMonitor;
58typedef struct _GUnixMountMonitorClass GUnixMountMonitorClass;
59
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))
65G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountMonitor, g_object_unref)
66
67GLIB_AVAILABLE_IN_ALL
68void g_unix_mount_free (GUnixMountEntry *mount_entry);
69GLIB_AVAILABLE_IN_2_54
70GUnixMountEntry *g_unix_mount_copy (GUnixMountEntry *mount_entry);
71GLIB_AVAILABLE_IN_ALL
72void g_unix_mount_point_free (GUnixMountPoint *mount_point);
73GLIB_AVAILABLE_IN_2_54
74GUnixMountPoint *g_unix_mount_point_copy (GUnixMountPoint *mount_point);
75GLIB_AVAILABLE_IN_ALL
76gint g_unix_mount_compare (GUnixMountEntry *mount1,
77 GUnixMountEntry *mount2);
78GLIB_AVAILABLE_IN_ALL
79const char * g_unix_mount_get_mount_path (GUnixMountEntry *mount_entry);
80GLIB_AVAILABLE_IN_ALL
81const char * g_unix_mount_get_device_path (GUnixMountEntry *mount_entry);
82GLIB_AVAILABLE_IN_2_60
83const char * g_unix_mount_get_root_path (GUnixMountEntry *mount_entry);
84GLIB_AVAILABLE_IN_ALL
85const char * g_unix_mount_get_fs_type (GUnixMountEntry *mount_entry);
86GLIB_AVAILABLE_IN_2_58
87const char * g_unix_mount_get_options (GUnixMountEntry *mount_entry);
88GLIB_AVAILABLE_IN_ALL
89gboolean g_unix_mount_is_readonly (GUnixMountEntry *mount_entry);
90GLIB_AVAILABLE_IN_ALL
91gboolean g_unix_mount_is_system_internal (GUnixMountEntry *mount_entry);
92GLIB_AVAILABLE_IN_ALL
93gboolean g_unix_mount_guess_can_eject (GUnixMountEntry *mount_entry);
94GLIB_AVAILABLE_IN_ALL
95gboolean g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry);
96GLIB_AVAILABLE_IN_ALL
97char * g_unix_mount_guess_name (GUnixMountEntry *mount_entry);
98GLIB_AVAILABLE_IN_ALL
99GIcon * g_unix_mount_guess_icon (GUnixMountEntry *mount_entry);
100GLIB_AVAILABLE_IN_ALL
101GIcon * g_unix_mount_guess_symbolic_icon (GUnixMountEntry *mount_entry);
102
103G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountEntry, g_unix_mount_free)
104G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountPoint, g_unix_mount_point_free)
105
106GLIB_AVAILABLE_IN_ALL
107gint g_unix_mount_point_compare (GUnixMountPoint *mount1,
108 GUnixMountPoint *mount2);
109GLIB_AVAILABLE_IN_ALL
110const char * g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point);
111GLIB_AVAILABLE_IN_ALL
112const char * g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point);
113GLIB_AVAILABLE_IN_ALL
114const char * g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point);
115GLIB_AVAILABLE_IN_2_32
116const char * g_unix_mount_point_get_options (GUnixMountPoint *mount_point);
117GLIB_AVAILABLE_IN_ALL
118gboolean g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point);
119GLIB_AVAILABLE_IN_ALL
120gboolean g_unix_mount_point_is_user_mountable (GUnixMountPoint *mount_point);
121GLIB_AVAILABLE_IN_ALL
122gboolean g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point);
123GLIB_AVAILABLE_IN_ALL
124gboolean g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_point);
125GLIB_AVAILABLE_IN_ALL
126char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point);
127GLIB_AVAILABLE_IN_ALL
128GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point);
129GLIB_AVAILABLE_IN_ALL
130GIcon * g_unix_mount_point_guess_symbolic_icon (GUnixMountPoint *mount_point);
131
132
133GLIB_AVAILABLE_IN_ALL
134GList * g_unix_mount_points_get (guint64 *time_read);
135GLIB_AVAILABLE_IN_2_66
136GUnixMountPoint *g_unix_mount_point_at (const char *mount_path,
137 guint64 *time_read);
138GLIB_AVAILABLE_IN_ALL
139GList * g_unix_mounts_get (guint64 *time_read);
140GLIB_AVAILABLE_IN_ALL
141GUnixMountEntry *g_unix_mount_at (const char *mount_path,
142 guint64 *time_read);
143GLIB_AVAILABLE_IN_2_52
144GUnixMountEntry *g_unix_mount_for (const char *file_path,
145 guint64 *time_read);
146GLIB_AVAILABLE_IN_ALL
147gboolean g_unix_mounts_changed_since (guint64 time);
148GLIB_AVAILABLE_IN_ALL
149gboolean g_unix_mount_points_changed_since (guint64 time);
150
151GLIB_AVAILABLE_IN_ALL
152GType g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
153GLIB_AVAILABLE_IN_2_44
154GUnixMountMonitor *g_unix_mount_monitor_get (void);
155GLIB_DEPRECATED_IN_2_44_FOR(g_unix_mount_monitor_get)
156GUnixMountMonitor *g_unix_mount_monitor_new (void);
157GLIB_DEPRECATED_IN_2_44
158void g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
159 int limit_msec);
160
161GLIB_AVAILABLE_IN_ALL
162gboolean g_unix_is_mount_path_system_internal (const char *mount_path);
163GLIB_AVAILABLE_IN_2_56
164gboolean g_unix_is_system_fs_type (const char *fs_type);
165GLIB_AVAILABLE_IN_2_56
166gboolean g_unix_is_system_device_path (const char *device_path);
167
168G_END_DECLS
169
170#endif /* __G_UNIX_MOUNTS_H__ */
171

source code of gtk/subprojects/glib/gio/gunixmounts.h