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 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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #ifndef __G_UNIX_MOUNTS_H__
24 #define __G_UNIX_MOUNTS_H__
27 #include <glib-object.h>
34 * Defines a Unix mount.
36 typedef struct _GUnixMount GUnixMount;
41 * Defines a Unix mount point (e.g. "/dev").
43 typedef struct _GUnixMountPoint GUnixMountPoint;
47 * @G_UNIX_MOUNT_TYPE_UNKNOWN: Unknown UNIX mount type.
48 * @G_UNIX_MOUNT_TYPE_FLOPPY: Floppy disk UNIX mount type.
49 * @G_UNIX_MOUNT_TYPE_CDROM: CDROM UNIX mount type.
50 * @G_UNIX_MOUNT_TYPE_NFS: Network File System (NFS) UNIX mount type.
51 * @G_UNIX_MOUNT_TYPE_ZIP: ZIP UNIX mount type.
52 * @G_UNIX_MOUNT_TYPE_JAZ: JAZZ UNIX mount type.
53 * @G_UNIX_MOUNT_TYPE_MEMSTICK: Memory Stick UNIX mount type.
54 * @G_UNIX_MOUNT_TYPE_CF: Compact Flash UNIX mount type.
55 * @G_UNIX_MOUNT_TYPE_SM: Smart Media UNIX mount type.
56 * @G_UNIX_MOUNT_TYPE_SDMMC: SD/MMC UNIX mount type.
57 * @G_UNIX_MOUNT_TYPE_IPOD: iPod UNIX mount type.
58 * @G_UNIX_MOUNT_TYPE_CAMERA: Digital camera UNIX mount type.
59 * @G_UNIX_MOUNT_TYPE_HD: Hard drive UNIX mount type.
61 * Types of UNIX mounts.
64 G_UNIX_MOUNT_TYPE_UNKNOWN,
65 G_UNIX_MOUNT_TYPE_FLOPPY,
66 G_UNIX_MOUNT_TYPE_CDROM,
67 G_UNIX_MOUNT_TYPE_NFS,
68 G_UNIX_MOUNT_TYPE_ZIP,
69 G_UNIX_MOUNT_TYPE_JAZ,
70 G_UNIX_MOUNT_TYPE_MEMSTICK,
73 G_UNIX_MOUNT_TYPE_SDMMC,
74 G_UNIX_MOUNT_TYPE_IPOD,
75 G_UNIX_MOUNT_TYPE_CAMERA,
82 * Watches #GUnixMount<!-- -->s for changes.
84 typedef struct _GUnixMountMonitor GUnixMountMonitor;
85 typedef struct _GUnixMountMonitorClass GUnixMountMonitorClass;
87 #define G_TYPE_UNIX_MOUNT_MONITOR (g_unix_mount_monitor_get_type ())
88 #define G_UNIX_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitor))
89 #define G_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitorClass))
90 #define G_IS_UNIX_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_UNIX_MOUNT_MONITOR))
91 #define G_IS_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_UNIX_MOUNT_MONITOR))
93 void g_unix_mount_free (GUnixMount *mount_entry);
94 void g_unix_mount_point_free (GUnixMountPoint *mount_point);
95 gint g_unix_mount_compare (GUnixMount *mount1,
97 const char * g_unix_mount_get_mount_path (GUnixMount *mount_entry);
98 const char * g_unix_mount_get_device_path (GUnixMount *mount_entry);
99 const char * g_unix_mount_get_fs_type (GUnixMount *mount_entry);
100 gboolean g_unix_mount_is_readonly (GUnixMount *mount_entry);
101 gboolean g_unix_mount_is_system_internal (GUnixMount *mount_entry);
102 GUnixMountType g_unix_mount_guess_type (GUnixMount *mount_entry);
104 gint g_unix_mount_point_compare (GUnixMountPoint *mount1,
105 GUnixMountPoint *mount2);
106 const char * g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point);
107 const char * g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point);
108 const char * g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point);
109 gboolean g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point);
110 gboolean g_unix_mount_point_is_user_mountable (GUnixMountPoint *mount_point);
111 gboolean g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point);
112 GUnixMountType g_unix_mount_point_guess_type (GUnixMountPoint *mount_point);
114 GList * g_get_unix_mount_points (guint64 *time_read);
115 GList * g_get_unix_mounts (guint64 *time_read);
116 GUnixMount * g_get_unix_mount_at (const char *mount_path,
118 gboolean g_unix_mounts_changed_since (guint64 time);
119 gboolean g_unix_mount_points_changed_since (guint64 time);
121 GType g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
122 GUnixMountMonitor *g_unix_mount_monitor_new (void);
126 #endif /* __G_UNIX_MOUNTS_H__ */