gio/ docs/reference/gio Merged gio-standalone into glib.
[platform/upstream/glib.git] / gio / gunixmounts.h
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 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, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_UNIX_MOUNTS_H__
24 #define __G_UNIX_MOUNTS_H__
25
26 #include <glib.h>
27 #include <glib-object.h>
28
29 G_BEGIN_DECLS
30
31 typedef struct _GUnixMount GUnixMount;
32 typedef struct _GUnixMountPoint GUnixMountPoint;
33
34 typedef enum {
35   G_UNIX_MOUNT_TYPE_UNKNOWN,
36   G_UNIX_MOUNT_TYPE_FLOPPY,
37   G_UNIX_MOUNT_TYPE_CDROM,
38   G_UNIX_MOUNT_TYPE_NFS,
39   G_UNIX_MOUNT_TYPE_ZIP,
40   G_UNIX_MOUNT_TYPE_JAZ,
41   G_UNIX_MOUNT_TYPE_MEMSTICK,
42   G_UNIX_MOUNT_TYPE_CF,
43   G_UNIX_MOUNT_TYPE_SM,
44   G_UNIX_MOUNT_TYPE_SDMMC,
45   G_UNIX_MOUNT_TYPE_IPOD,
46   G_UNIX_MOUNT_TYPE_CAMERA,
47   G_UNIX_MOUNT_TYPE_HD
48 } GUnixMountType;
49
50 typedef struct _GUnixMountMonitor GUnixMountMonitor;
51 typedef struct _GUnixMountMonitorClass GUnixMountMonitorClass;
52
53 #define G_TYPE_UNIX_MOUNT_MONITOR        (g_unix_mount_monitor_get_type ())
54 #define G_UNIX_MOUNT_MONITOR(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitor))
55 #define G_UNIX_MOUNT_MONITOR_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitorClass))
56 #define G_IS_UNIX_MOUNT_MONITOR(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_UNIX_MOUNT_MONITOR))
57 #define G_IS_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_UNIX_MOUNT_MONITOR))
58
59 void           g_unix_mount_free                    (GUnixMount         *mount_entry);
60 void           g_unix_mount_point_free              (GUnixMountPoint    *mount_point);
61 gint           g_unix_mount_compare                 (GUnixMount         *mount1,
62                                                      GUnixMount         *mount2);
63 const char *   g_unix_mount_get_mount_path          (GUnixMount         *mount_entry);
64 const char *   g_unix_mount_get_device_path         (GUnixMount         *mount_entry);
65 const char *   g_unix_mount_get_fs_type             (GUnixMount         *mount_entry);
66 gboolean       g_unix_mount_is_readonly             (GUnixMount         *mount_entry);
67 gboolean       g_unix_mount_is_system_internal      (GUnixMount         *mount_entry);
68 GUnixMountType g_unix_mount_guess_type              (GUnixMount         *mount_entry);
69
70 gint           g_unix_mount_point_compare           (GUnixMountPoint    *mount1,
71                                                      GUnixMountPoint    *mount2);
72 const char *   g_unix_mount_point_get_mount_path    (GUnixMountPoint    *mount_point);
73 const char *   g_unix_mount_point_get_device_path   (GUnixMountPoint    *mount_point);
74 const char *   g_unix_mount_point_get_fs_type       (GUnixMountPoint    *mount_point);
75 gboolean       g_unix_mount_point_is_readonly       (GUnixMountPoint    *mount_point);
76 gboolean       g_unix_mount_point_is_user_mountable (GUnixMountPoint    *mount_point);
77 gboolean       g_unix_mount_point_is_loopback       (GUnixMountPoint    *mount_point);
78 GUnixMountType g_unix_mount_point_guess_type        (GUnixMountPoint    *mount_point);
79
80 GList *        g_get_unix_mount_points              (guint64            *time_read);
81 GList *        g_get_unix_mounts                    (guint64            *time_read);
82 GUnixMount *   g_get_unix_mount_at                  (const char         *mount_path,
83                                                      guint64            *time_read);
84 gboolean       g_unix_mounts_changed_since          (guint64             time);
85 gboolean       g_unix_mount_points_changed_since    (guint64             time);
86
87 GType              g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
88 GUnixMountMonitor *g_unix_mount_monitor_new      (void);
89
90 G_END_DECLS
91
92 #endif /* __G_UNIX_MOUNTS_H__ */