gunixmounts.h 5.85 KB
Newer Older
1
/* GIO - GLib Input, Output and Streaming Library
2
 *
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 * Copyright (C) 2006-2007 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Alexander Larsson <alexl@redhat.com>
 */

#ifndef __G_UNIX_MOUNTS_H__
#define __G_UNIX_MOUNTS_H__

26
#include <gio/gio.h>
27 28 29

G_BEGIN_DECLS

30
/**
31
 * GUnixMountEntry:
32 33
 *
 * Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
34
 * This corresponds roughly to a mtab entry.
35
 **/
36
typedef struct _GUnixMountEntry GUnixMountEntry;
37 38 39

/**
 * GUnixMountPoint:
40
 *
41 42
 * Defines a Unix mount point (e.g. <filename>/dev</filename>).
 * This corresponds roughly to a fstab entry.
43
 **/
44 45
typedef struct _GUnixMountPoint GUnixMountPoint;

46 47
/**
 * GUnixMountMonitor:
48
 *
49 50
 * Watches #GUnixMount<!-- -->s for changes.
 **/
51
typedef struct _GUnixMountMonitor      GUnixMountMonitor;
52 53 54 55 56 57 58 59
typedef struct _GUnixMountMonitorClass GUnixMountMonitorClass;

#define G_TYPE_UNIX_MOUNT_MONITOR        (g_unix_mount_monitor_get_type ())
#define G_UNIX_MOUNT_MONITOR(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitor))
#define G_UNIX_MOUNT_MONITOR_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitorClass))
#define G_IS_UNIX_MOUNT_MONITOR(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_UNIX_MOUNT_MONITOR))
#define G_IS_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_UNIX_MOUNT_MONITOR))

60
GLIB_AVAILABLE_IN_ALL
61
void           g_unix_mount_free                    (GUnixMountEntry    *mount_entry);
62
GLIB_AVAILABLE_IN_ALL
63
void           g_unix_mount_point_free              (GUnixMountPoint    *mount_point);
64
GLIB_AVAILABLE_IN_ALL
65 66
gint           g_unix_mount_compare                 (GUnixMountEntry    *mount1,
						     GUnixMountEntry    *mount2);
67
GLIB_AVAILABLE_IN_ALL
68
const char *   g_unix_mount_get_mount_path          (GUnixMountEntry    *mount_entry);
69
GLIB_AVAILABLE_IN_ALL
70
const char *   g_unix_mount_get_device_path         (GUnixMountEntry    *mount_entry);
71
GLIB_AVAILABLE_IN_ALL
72
const char *   g_unix_mount_get_fs_type             (GUnixMountEntry    *mount_entry);
73
GLIB_AVAILABLE_IN_ALL
74
gboolean       g_unix_mount_is_readonly             (GUnixMountEntry    *mount_entry);
75
GLIB_AVAILABLE_IN_ALL
76
gboolean       g_unix_mount_is_system_internal      (GUnixMountEntry    *mount_entry);
77
GLIB_AVAILABLE_IN_ALL
78
gboolean       g_unix_mount_guess_can_eject         (GUnixMountEntry    *mount_entry);
79
GLIB_AVAILABLE_IN_ALL
80
gboolean       g_unix_mount_guess_should_display    (GUnixMountEntry    *mount_entry);
81
GLIB_AVAILABLE_IN_ALL
82
char *         g_unix_mount_guess_name              (GUnixMountEntry    *mount_entry);
83
GLIB_AVAILABLE_IN_ALL
84
GIcon *        g_unix_mount_guess_icon              (GUnixMountEntry    *mount_entry);
85
GLIB_AVAILABLE_IN_ALL
86 87
GIcon *        g_unix_mount_guess_symbolic_icon     (GUnixMountEntry    *mount_entry);

88

89
GLIB_AVAILABLE_IN_ALL
90 91
gint           g_unix_mount_point_compare           (GUnixMountPoint    *mount1,
						     GUnixMountPoint    *mount2);
92
GLIB_AVAILABLE_IN_ALL
93
const char *   g_unix_mount_point_get_mount_path    (GUnixMountPoint    *mount_point);
94
GLIB_AVAILABLE_IN_ALL
95
const char *   g_unix_mount_point_get_device_path   (GUnixMountPoint    *mount_point);
96
GLIB_AVAILABLE_IN_ALL
97
const char *   g_unix_mount_point_get_fs_type       (GUnixMountPoint    *mount_point);
98
GLIB_AVAILABLE_IN_2_32
99
const char *   g_unix_mount_point_get_options       (GUnixMountPoint    *mount_point);
100
GLIB_AVAILABLE_IN_ALL
101
gboolean       g_unix_mount_point_is_readonly       (GUnixMountPoint    *mount_point);
102
GLIB_AVAILABLE_IN_ALL
103
gboolean       g_unix_mount_point_is_user_mountable (GUnixMountPoint    *mount_point);
104
GLIB_AVAILABLE_IN_ALL
105
gboolean       g_unix_mount_point_is_loopback       (GUnixMountPoint    *mount_point);
106
GLIB_AVAILABLE_IN_ALL
107
gboolean       g_unix_mount_point_guess_can_eject   (GUnixMountPoint    *mount_point);
108
GLIB_AVAILABLE_IN_ALL
109
char *         g_unix_mount_point_guess_name        (GUnixMountPoint    *mount_point);
110
GLIB_AVAILABLE_IN_ALL
111
GIcon *        g_unix_mount_point_guess_icon        (GUnixMountPoint    *mount_point);
112
GLIB_AVAILABLE_IN_ALL
113 114
GIcon *        g_unix_mount_point_guess_symbolic_icon (GUnixMountPoint    *mount_point);

115

116
GLIB_AVAILABLE_IN_ALL
117
GList *        g_unix_mount_points_get              (guint64            *time_read);
118
GLIB_AVAILABLE_IN_ALL
119
GList *        g_unix_mounts_get                    (guint64            *time_read);
120
GLIB_AVAILABLE_IN_ALL
121
GUnixMountEntry *g_unix_mount_at                    (const char         *mount_path,
122
						     guint64            *time_read);
123
GLIB_AVAILABLE_IN_ALL
124
gboolean       g_unix_mounts_changed_since          (guint64             time);
125
GLIB_AVAILABLE_IN_ALL
126 127
gboolean       g_unix_mount_points_changed_since    (guint64             time);

128
GLIB_AVAILABLE_IN_ALL
129
GType              g_unix_mount_monitor_get_type       (void) G_GNUC_CONST;
130
GLIB_AVAILABLE_IN_ALL
131
GUnixMountMonitor *g_unix_mount_monitor_new            (void);
132
GLIB_AVAILABLE_IN_ALL
133 134
void               g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
                                                        int                limit_msec);
135

136
GLIB_AVAILABLE_IN_ALL
137 138
gboolean g_unix_is_mount_path_system_internal (const char *mount_path);

139 140 141
G_END_DECLS

#endif /* __G_UNIX_MOUNTS_H__ */