mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
Namespace waste reduction, move some g_get_unix_mount functions to the
2007-12-17 Matthias Clasen <mclasen@redhat.com> * gio.symbols: * gunixmounts.[hc]: Namespace waste reduction, move some g_get_unix_mount functions to the g_unix_mount namespace. * gunixmounts.c: * gunixvolumemonitor.c: * glocalfile.c: * glocaldirectorymonitor.c: Update all callers. * gunixmounts.h: Remove leftover g_unix_get_canonical_device_path svn path=/trunk/; revision=6143
This commit is contained in:
parent
19e895d818
commit
feb5258cf9
@ -1,3 +1,7 @@
|
|||||||
|
2007-12-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gio/gio-sections.txt: Updates
|
||||||
|
|
||||||
2007-12-14 Matthias Clasen <mclasen@redhat.com>
|
2007-12-14 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/tmpl/hash_tables.sgml:
|
* glib/tmpl/hash_tables.sgml:
|
||||||
|
@ -1111,13 +1111,12 @@ g_unix_mount_point_is_user_mountable
|
|||||||
g_unix_mount_point_is_loopback
|
g_unix_mount_point_is_loopback
|
||||||
g_unix_mount_point_guess_icon
|
g_unix_mount_point_guess_icon
|
||||||
g_unix_mount_point_guess_name
|
g_unix_mount_point_guess_name
|
||||||
g_get_unix_mount_points
|
g_unix_mount_points_get
|
||||||
g_get_unix_mounts
|
g_unix_mounts_get
|
||||||
g_get_unix_mount_at
|
g_unix_mount_at
|
||||||
g_unix_mounts_changed_since
|
g_unix_mounts_changed_since
|
||||||
g_unix_mount_points_changed_since
|
g_unix_mount_points_changed_since
|
||||||
g_unix_mount_monitor_new
|
g_unix_mount_monitor_new
|
||||||
g_unix_get_canonical_device_path
|
|
||||||
g_unix_is_mount_path_system_internal
|
g_unix_is_mount_path_system_internal
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GUnixMountClass
|
GUnixMountClass
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
2007-12-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gio.symbols:
|
||||||
|
* gunixmounts.[hc]: Namespace waste reduction, move some
|
||||||
|
g_get_unix_mount functions to the g_unix_mount namespace.
|
||||||
|
|
||||||
|
* gunixmounts.c:
|
||||||
|
* gunixvolumemonitor.c:
|
||||||
|
* glocalfile.c:
|
||||||
|
* glocaldirectorymonitor.c: Update all callers.
|
||||||
|
|
||||||
|
* gunixmounts.h: Remove leftover g_unix_get_canonical_device_path
|
||||||
|
|
||||||
2007-12-17 Alexander Larsson <alexl@redhat.com>
|
2007-12-17 Alexander Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gfile.c:
|
* gfile.c:
|
||||||
|
@ -645,9 +645,9 @@ g_unix_mount_point_is_user_mountable
|
|||||||
g_unix_mount_point_is_loopback
|
g_unix_mount_point_is_loopback
|
||||||
g_unix_mount_point_guess_name
|
g_unix_mount_point_guess_name
|
||||||
g_unix_mount_point_guess_icon
|
g_unix_mount_point_guess_icon
|
||||||
g_get_unix_mount_points
|
g_unix_mount_points_get
|
||||||
g_get_unix_mounts
|
g_unix_mounts_get
|
||||||
g_get_unix_mount_at
|
g_unix_mount_at
|
||||||
g_unix_mounts_changed_since
|
g_unix_mounts_changed_since
|
||||||
g_unix_mount_points_changed_since
|
g_unix_mount_points_changed_since
|
||||||
g_unix_mount_monitor_get_type G_GNUC_CONST
|
g_unix_mount_monitor_get_type G_GNUC_CONST
|
||||||
|
@ -119,7 +119,7 @@ g_local_directory_monitor_constructor (GType type,
|
|||||||
|
|
||||||
/* Emulate unmount detection */
|
/* Emulate unmount detection */
|
||||||
|
|
||||||
mount = g_get_unix_mount_at (local_monitor->dirname, NULL);
|
mount = g_unix_mount_at (local_monitor->dirname, NULL);
|
||||||
|
|
||||||
local_monitor->was_mounted = mount != NULL;
|
local_monitor->was_mounted = mount != NULL;
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ mounts_changed (GUnixMountMonitor *mount_monitor,
|
|||||||
mount = NULL;
|
mount = NULL;
|
||||||
g_warning ("G_OS_WIN32: no mount emulation");
|
g_warning ("G_OS_WIN32: no mount emulation");
|
||||||
#else
|
#else
|
||||||
mount = g_get_unix_mount_at (local_monitor->dirname, NULL);
|
mount = g_unix_mount_at (local_monitor->dirname, NULL);
|
||||||
|
|
||||||
is_mounted = mount != NULL;
|
is_mounted = mount != NULL;
|
||||||
|
|
||||||
|
@ -730,7 +730,7 @@ get_mount_info (GFileInfo *fs_info,
|
|||||||
if (mountpoint == NULL)
|
if (mountpoint == NULL)
|
||||||
mountpoint = "/";
|
mountpoint = "/";
|
||||||
|
|
||||||
mount = g_get_unix_mount_at (mountpoint, &cache_time);
|
mount = g_unix_mount_at (mountpoint, &cache_time);
|
||||||
if (mount)
|
if (mount)
|
||||||
{
|
{
|
||||||
if (g_unix_mount_is_readonly (mount))
|
if (g_unix_mount_is_readonly (mount))
|
||||||
|
@ -981,7 +981,7 @@ get_mount_points_timestamp (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_get_unix_mounts:
|
* g_unix_mounts_get:
|
||||||
* @time_read: guint64 to contain a timestamp.
|
* @time_read: guint64 to contain a timestamp.
|
||||||
*
|
*
|
||||||
* Gets a #GList of strings containing the unix mounts.
|
* Gets a #GList of strings containing the unix mounts.
|
||||||
@ -992,7 +992,7 @@ get_mount_points_timestamp (void)
|
|||||||
* Returns: a #GList of the UNIX mounts.
|
* Returns: a #GList of the UNIX mounts.
|
||||||
**/
|
**/
|
||||||
GList *
|
GList *
|
||||||
g_get_unix_mounts (guint64 *time_read)
|
g_unix_mounts_get (guint64 *time_read)
|
||||||
{
|
{
|
||||||
if (time_read)
|
if (time_read)
|
||||||
*time_read = get_mounts_timestamp ();
|
*time_read = get_mounts_timestamp ();
|
||||||
@ -1001,7 +1001,7 @@ g_get_unix_mounts (guint64 *time_read)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_get_unix_mount_at:
|
* g_unix_mount_at:
|
||||||
* @mount_path: path for a possible unix mount.
|
* @mount_path: path for a possible unix mount.
|
||||||
* @time_read: guint64 to contain a timestamp.
|
* @time_read: guint64 to contain a timestamp.
|
||||||
*
|
*
|
||||||
@ -1012,13 +1012,13 @@ g_get_unix_mounts (guint64 *time_read)
|
|||||||
* Returns: a #GUnixMount.
|
* Returns: a #GUnixMount.
|
||||||
**/
|
**/
|
||||||
GUnixMountEntry *
|
GUnixMountEntry *
|
||||||
g_get_unix_mount_at (const char *mount_path,
|
g_unix_mount_at (const char *mount_path,
|
||||||
guint64 *time_read)
|
guint64 *time_read)
|
||||||
{
|
{
|
||||||
GList *mounts, *l;
|
GList *mounts, *l;
|
||||||
GUnixMountEntry *mount_entry, *found;
|
GUnixMountEntry *mount_entry, *found;
|
||||||
|
|
||||||
mounts = g_get_unix_mounts (time_read);
|
mounts = g_unix_mounts_get (time_read);
|
||||||
|
|
||||||
found = NULL;
|
found = NULL;
|
||||||
for (l = mounts; l != NULL; l = l->next)
|
for (l = mounts; l != NULL; l = l->next)
|
||||||
@ -1037,7 +1037,7 @@ g_get_unix_mount_at (const char *mount_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_get_unix_mount_points:
|
* g_unix_mount_points_get:
|
||||||
* @time_read: guint64 to contain a timestamp.
|
* @time_read: guint64 to contain a timestamp.
|
||||||
*
|
*
|
||||||
* Gets a #GList of strings containing the unix mount points.
|
* Gets a #GList of strings containing the unix mount points.
|
||||||
@ -1048,7 +1048,7 @@ g_get_unix_mount_at (const char *mount_path,
|
|||||||
* Returns: a #GList of the UNIX mountpoints.
|
* Returns: a #GList of the UNIX mountpoints.
|
||||||
**/
|
**/
|
||||||
GList *
|
GList *
|
||||||
g_get_unix_mount_points (guint64 *time_read)
|
g_unix_mount_points_get (guint64 *time_read)
|
||||||
{
|
{
|
||||||
if (time_read)
|
if (time_read)
|
||||||
*time_read = get_mount_points_timestamp ();
|
*time_read = get_mount_points_timestamp ();
|
||||||
|
@ -30,14 +30,16 @@ G_BEGIN_DECLS
|
|||||||
/**
|
/**
|
||||||
* GUnixMountEntry:
|
* GUnixMountEntry:
|
||||||
*
|
*
|
||||||
* Defines a Unix mount entry (e.g. "/media/cdrom").
|
* Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
|
||||||
|
* This corresponds roughly to a mtab entry.
|
||||||
**/
|
**/
|
||||||
typedef struct _GUnixMountEntry GUnixMountEntry;
|
typedef struct _GUnixMountEntry GUnixMountEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GUnixMountPoint:
|
* GUnixMountPoint:
|
||||||
*
|
*
|
||||||
* Defines a Unix mount point (e.g. "/dev").
|
* Defines a Unix mount point (e.g. <filename>/dev</filename>).
|
||||||
|
* This corresponds roughly to a fstab entry.
|
||||||
**/
|
**/
|
||||||
typedef struct _GUnixMountPoint GUnixMountPoint;
|
typedef struct _GUnixMountPoint GUnixMountPoint;
|
||||||
|
|
||||||
@ -80,9 +82,9 @@ gboolean g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_p
|
|||||||
char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point);
|
char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point);
|
||||||
GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point);
|
GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point);
|
||||||
|
|
||||||
GList * g_get_unix_mount_points (guint64 *time_read);
|
GList * g_unix_mount_points_get (guint64 *time_read);
|
||||||
GList * g_get_unix_mounts (guint64 *time_read);
|
GList * g_unix_mounts_get (guint64 *time_read);
|
||||||
GUnixMountEntry * g_get_unix_mount_at (const char *mount_path,
|
GUnixMountEntry *g_unix_mount_at (const char *mount_path,
|
||||||
guint64 *time_read);
|
guint64 *time_read);
|
||||||
gboolean g_unix_mounts_changed_since (guint64 time);
|
gboolean g_unix_mounts_changed_since (guint64 time);
|
||||||
gboolean g_unix_mount_points_changed_since (guint64 time);
|
gboolean g_unix_mount_points_changed_since (guint64 time);
|
||||||
@ -90,10 +92,6 @@ gboolean g_unix_mount_points_changed_since (guint64 time);
|
|||||||
GType g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
|
GType g_unix_mount_monitor_get_type (void) G_GNUC_CONST;
|
||||||
GUnixMountMonitor *g_unix_mount_monitor_new (void);
|
GUnixMountMonitor *g_unix_mount_monitor_new (void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char *g_unix_get_canonical_device_path (const char *device_path);
|
|
||||||
|
|
||||||
gboolean g_unix_is_mount_path_system_internal (const char *mount_path);
|
gboolean g_unix_is_mount_path_system_internal (const char *mount_path);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -137,7 +137,7 @@ get_mount_for_mount_path (const char *mount_path)
|
|||||||
GUnixMountEntry *mount_entry;
|
GUnixMountEntry *mount_entry;
|
||||||
GUnixMount *mount;
|
GUnixMount *mount;
|
||||||
|
|
||||||
mount_entry = g_get_unix_mount_at (mount_path, NULL);
|
mount_entry = g_unix_mount_at (mount_path, NULL);
|
||||||
|
|
||||||
/* TODO: Set mountable volume? */
|
/* TODO: Set mountable volume? */
|
||||||
mount = _g_unix_mount_new (NULL, mount_entry, NULL);
|
mount = _g_unix_mount_new (NULL, mount_entry, NULL);
|
||||||
@ -312,7 +312,7 @@ update_volumes (GUnixVolumeMonitor *monitor)
|
|||||||
GList *l;
|
GList *l;
|
||||||
GUnixVolume *volume;
|
GUnixVolume *volume;
|
||||||
|
|
||||||
new_mountpoints = g_get_unix_mount_points (NULL);
|
new_mountpoints = g_unix_mount_points_get (NULL);
|
||||||
|
|
||||||
new_mountpoints = g_list_sort (new_mountpoints, (GCompareFunc) g_unix_mount_point_compare);
|
new_mountpoints = g_list_sort (new_mountpoints, (GCompareFunc) g_unix_mount_point_compare);
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ update_mounts (GUnixVolumeMonitor *monitor)
|
|||||||
GUnixVolume *volume;
|
GUnixVolume *volume;
|
||||||
const char *mount_path;
|
const char *mount_path;
|
||||||
|
|
||||||
new_mounts = g_get_unix_mounts (NULL);
|
new_mounts = g_unix_mounts_get (NULL);
|
||||||
|
|
||||||
new_mounts = g_list_sort (new_mounts, (GCompareFunc) g_unix_mount_compare);
|
new_mounts = g_list_sort (new_mounts, (GCompareFunc) g_unix_mount_compare);
|
||||||
|
|
||||||
|
@ -39,6 +39,12 @@ typedef struct _GUnixVolumeMonitor GUnixVolumeMonitor;
|
|||||||
typedef struct _GUnixVolumeMonitorClass GUnixVolumeMonitorClass;
|
typedef struct _GUnixVolumeMonitorClass GUnixVolumeMonitorClass;
|
||||||
|
|
||||||
/* Forward definitions */
|
/* Forward definitions */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GUnixMount:
|
||||||
|
*
|
||||||
|
* Implementation of the #GMount interface for Unix systems.
|
||||||
|
*/
|
||||||
typedef struct _GUnixMount GUnixMount;
|
typedef struct _GUnixMount GUnixMount;
|
||||||
typedef struct _GUnixVolume GUnixVolume;
|
typedef struct _GUnixVolume GUnixVolume;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user