gunixmounts.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. #ifndef __G_UNIX_MOUNTS_H__
  21. #define __G_UNIX_MOUNTS_H__
  22. #include <gio/gio.h>
  23. G_BEGIN_DECLS
  24. /**
  25. * GUnixMountEntry:
  26. *
  27. * Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
  28. * This corresponds roughly to a mtab entry.
  29. **/
  30. typedef struct _GUnixMountEntry GUnixMountEntry;
  31. #define G_TYPE_UNIX_MOUNT_ENTRY (g_unix_mount_entry_get_type ())
  32. GLIB_AVAILABLE_IN_2_54
  33. GType g_unix_mount_entry_get_type (void) G_GNUC_CONST;
  34. /**
  35. * GUnixMountPoint:
  36. *
  37. * Defines a Unix mount point (e.g. <filename>/dev</filename>).
  38. * This corresponds roughly to a fstab entry.
  39. **/
  40. typedef struct _GUnixMountPoint GUnixMountPoint;
  41. #define G_TYPE_UNIX_MOUNT_POINT (g_unix_mount_point_get_type ())
  42. GLIB_AVAILABLE_IN_2_54
  43. GType g_unix_mount_point_get_type (void) G_GNUC_CONST;
  44. /**
  45. * GUnixMountMonitor:
  46. *
  47. * Watches #GUnixMounts for changes.
  48. **/
  49. typedef struct _GUnixMountMonitor GUnixMountMonitor;
  50. typedef struct _GUnixMountMonitorClass GUnixMountMonitorClass;
  51. #define G_TYPE_UNIX_MOUNT_MONITOR (g_unix_mount_monitor_get_type ())
  52. #define G_UNIX_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitor))
  53. #define G_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_UNIX_MOUNT_MONITOR, GUnixMountMonitorClass))
  54. #define G_IS_UNIX_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_UNIX_MOUNT_MONITOR))
  55. #define G_IS_UNIX_MOUNT_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_UNIX_MOUNT_MONITOR))
  56. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountMonitor, g_object_unref)
  57. GLIB_AVAILABLE_IN_ALL
  58. void g_unix_mount_free (GUnixMountEntry *mount_entry);
  59. GLIB_AVAILABLE_IN_2_54
  60. GUnixMountEntry *g_unix_mount_copy (GUnixMountEntry *mount_entry);
  61. GLIB_AVAILABLE_IN_ALL
  62. void g_unix_mount_point_free (GUnixMountPoint *mount_point);
  63. GLIB_AVAILABLE_IN_2_54
  64. GUnixMountPoint *g_unix_mount_point_copy (GUnixMountPoint *mount_point);
  65. GLIB_AVAILABLE_IN_ALL
  66. gint g_unix_mount_compare (GUnixMountEntry *mount1,
  67. GUnixMountEntry *mount2);
  68. GLIB_AVAILABLE_IN_ALL
  69. const char * g_unix_mount_get_mount_path (GUnixMountEntry *mount_entry);
  70. GLIB_AVAILABLE_IN_ALL
  71. const char * g_unix_mount_get_device_path (GUnixMountEntry *mount_entry);
  72. GLIB_AVAILABLE_IN_2_60
  73. const char * g_unix_mount_get_root_path (GUnixMountEntry *mount_entry);
  74. GLIB_AVAILABLE_IN_ALL
  75. const char * g_unix_mount_get_fs_type (GUnixMountEntry *mount_entry);
  76. GLIB_AVAILABLE_IN_2_58
  77. const char * g_unix_mount_get_options (GUnixMountEntry *mount_entry);
  78. GLIB_AVAILABLE_IN_ALL
  79. gboolean g_unix_mount_is_readonly (GUnixMountEntry *mount_entry);
  80. GLIB_AVAILABLE_IN_ALL
  81. gboolean g_unix_mount_is_system_internal (GUnixMountEntry *mount_entry);
  82. GLIB_AVAILABLE_IN_ALL
  83. gboolean g_unix_mount_guess_can_eject (GUnixMountEntry *mount_entry);
  84. GLIB_AVAILABLE_IN_ALL
  85. gboolean g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry);
  86. GLIB_AVAILABLE_IN_ALL
  87. char * g_unix_mount_guess_name (GUnixMountEntry *mount_entry);
  88. GLIB_AVAILABLE_IN_ALL
  89. GIcon * g_unix_mount_guess_icon (GUnixMountEntry *mount_entry);
  90. GLIB_AVAILABLE_IN_ALL
  91. GIcon * g_unix_mount_guess_symbolic_icon (GUnixMountEntry *mount_entry);
  92. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountEntry, g_unix_mount_free)
  93. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixMountPoint, g_unix_mount_point_free)
  94. GLIB_AVAILABLE_IN_ALL
  95. gint g_unix_mount_point_compare (GUnixMountPoint *mount1,
  96. GUnixMountPoint *mount2);
  97. GLIB_AVAILABLE_IN_ALL
  98. const char * g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point);
  99. GLIB_AVAILABLE_IN_ALL
  100. const char * g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point);
  101. GLIB_AVAILABLE_IN_ALL
  102. const char * g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point);
  103. GLIB_AVAILABLE_IN_2_32
  104. const char * g_unix_mount_point_get_options (GUnixMountPoint *mount_point);
  105. GLIB_AVAILABLE_IN_ALL
  106. gboolean g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point);
  107. GLIB_AVAILABLE_IN_ALL
  108. gboolean g_unix_mount_point_is_user_mountable (GUnixMountPoint *mount_point);
  109. GLIB_AVAILABLE_IN_ALL
  110. gboolean g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point);
  111. GLIB_AVAILABLE_IN_ALL
  112. gboolean g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_point);
  113. GLIB_AVAILABLE_IN_ALL
  114. char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point);
  115. GLIB_AVAILABLE_IN_ALL
  116. GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point);
  117. GLIB_AVAILABLE_IN_ALL
  118. GIcon * g_unix_mount_point_guess_symbolic_icon (GUnixMountPoint *mount_point);
  119. GLIB_AVAILABLE_IN_ALL
  120. GList * g_unix_mount_points_get (guint64 *time_read);
  121. GLIB_AVAILABLE_IN_ALL
  122. GList * g_unix_mounts_get (guint64 *time_read);
  123. GLIB_AVAILABLE_IN_ALL
  124. GUnixMountEntry *g_unix_mount_at (const char *mount_path,
  125. guint64 *time_read);
  126. GLIB_AVAILABLE_IN_2_52
  127. GUnixMountEntry *g_unix_mount_for (const char *file_path,
  128. guint64 *time_read);
  129. GLIB_AVAILABLE_IN_ALL
  130. gboolean g_unix_mounts_changed_since (guint64 time);
  131. GLIB_AVAILABLE_IN_ALL
  132. gboolean g_unix_mount_points_changed_since (guint64 time);
  133. GLIB_AVAILABLE_IN_ALL
  134. GType g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
  135. GLIB_AVAILABLE_IN_2_44
  136. GUnixMountMonitor *g_unix_mount_monitor_get (void);
  137. GLIB_DEPRECATED_IN_2_44_FOR(g_unix_mount_monitor_get)
  138. GUnixMountMonitor *g_unix_mount_monitor_new (void);
  139. GLIB_DEPRECATED_IN_2_44
  140. void g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
  141. int limit_msec);
  142. GLIB_AVAILABLE_IN_ALL
  143. gboolean g_unix_is_mount_path_system_internal (const char *mount_path);
  144. GLIB_AVAILABLE_IN_2_56
  145. gboolean g_unix_is_system_fs_type (const char *fs_type);
  146. GLIB_AVAILABLE_IN_2_56
  147. gboolean g_unix_is_system_device_path (const char *device_path);
  148. G_END_DECLS
  149. #endif /* __G_UNIX_MOUNTS_H__ */