hal/libhal-storage libhal-storage.c,1.12,1.13
David Zeuthen
david at freedesktop.org
Wed Feb 16 13:25:37 PST 2005
Update of /cvs/hal/hal/libhal-storage
In directory gabe:/tmp/cvs-serv16495/libhal-storage
Modified Files:
libhal-storage.c
Log Message:
2005-02-16 David Zeuthen <davidz at redhat.com>
Fix up more sloppy errors incuded from patches that I should
have reviewed more carefully :-/
* libhal-storage/libhal-storage.c: Match against
LIBHAL_PROPERTY_TYPE_*, not DBUS_TYPE_*
(libhal_drive_policy_default_use_managed_keyword):
(libhal_drive_policy_default_get_mount_root):
(libhal_drive_policy_default_use_managed_keyword):
(libhal_drive_policy_default_get_managed_keyword_primary):
(libhal_drive_policy_default_get_managed_keyword_secondary):
(libhal_drive_policy_get_mount_options):
(libhal_volume_policy_get_mount_options): Yikes, Yikes, rename
"/org/freedesktop/LibHal" back to "/org/freedesktop/Hal"
* libhal/libhal.c (libhal_property_fill_value_from_variant): p->type
wasn't being assigned :-/. Also, DBUS_TYPE_BOOLEAN wasn't handled.
* hald/hald_test_libhal.c (check_libhal): Fix this test
Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- libhal-storage.c 16 Feb 2005 18:45:19 -0000 1.12
+++ libhal-storage.c 16 Feb 2005 21:25:35 -0000 1.13
@@ -758,17 +758,17 @@
#define LIBHAL_PROP_EXTRACT_BEGIN if (FALSE)
#define LIBHAL_PROP_EXTRACT_END ;
-#define LIBHAL_PROP_EXTRACT_INT(_property_, _where_) else if (strcmp (key, _property_) == 0 && type == DBUS_TYPE_INT32) _where_ = libhal_psi_get_int (&it)
-#define LIBHAL_PROP_EXTRACT_STRING(_property_, _where_) else if (strcmp (key, _property_) == 0 && type == DBUS_TYPE_STRING) _where_ = (libhal_psi_get_string (&it) != NULL && strlen (libhal_psi_get_string (&it)) > 0) ? strdup (libhal_psi_get_string (&it)) : NULL
-#define LIBHAL_PROP_EXTRACT_BOOL(_property_, _where_) else if (strcmp (key, _property_) == 0 && type == DBUS_TYPE_BOOLEAN) _where_ = libhal_psi_get_bool (&it)
-#define LIBHAL_PROP_EXTRACT_BOOL_BITFIELD(_property_, _where_, _field_) else if (strcmp (key, _property_) == 0 && type == DBUS_TYPE_BOOLEAN) _where_ |= libhal_psi_get_bool (&it) ? _field_ : 0
+#define LIBHAL_PROP_EXTRACT_INT(_property_, _where_) else if (strcmp (key, _property_) == 0 && type == LIBHAL_PROPERTY_TYPE_INT32) _where_ = libhal_psi_get_int (&it)
+#define LIBHAL_PROP_EXTRACT_STRING(_property_, _where_) else if (strcmp (key, _property_) == 0 && type == LIBHAL_PROPERTY_TYPE_STRING) _where_ = (libhal_psi_get_string (&it) != NULL && strlen (libhal_psi_get_string (&it)) > 0) ? strdup (libhal_psi_get_string (&it)) : NULL
+#define LIBHAL_PROP_EXTRACT_BOOL(_property_, _where_) else if (strcmp (key, _property_) == 0 && type == LIBHAL_PROPERTY_TYPE_BOOLEAN) _where_ = libhal_psi_get_bool (&it)
+#define LIBHAL_PROP_EXTRACT_BOOL_BITFIELD(_property_, _where_, _field_) else if (strcmp (key, _property_) == 0 && type == LIBHAL_PROPERTY_TYPE_BOOLEAN) _where_ |= libhal_psi_get_bool (&it) ? _field_ : 0
-/** Given a UDI for a LIBHAL device of capability 'storage', this
+/** Given a UDI for a HAL device of capability 'storage', this
* function retrieves all the relevant properties into convenient
* in-process data structures.
*
* @param hal_ctx libhal context
- * @param udi LIBHAL UDI
+ * @param udi HAL UDI
* @return LibHalDrive object or NULL if UDI is invalid
*/
LibHalDrive *
@@ -948,7 +948,7 @@
* in-process data structures.
*
* @param hal_ctx libhal context
- * @param udi LIBHAL UDI
+ * @param udi HAL UDI
* @return LibHalVolume object or NULL if UDI is invalid
*/
LibHalVolume *
@@ -1428,7 +1428,7 @@
{
DBusError error;
dbus_error_init (&error);
- return libhal_device_get_property_string (hal_ctx, "/org/freedesktop/LibHal/devices/computer",
+ return libhal_device_get_property_string (hal_ctx, "/org/freedesktop/Hal/devices/computer",
"storage.policy.default.mount_root", &error);
}
@@ -1437,7 +1437,7 @@
{
DBusError error;
dbus_error_init (&error);
- return libhal_device_get_property_bool (hal_ctx, "/org/freedesktop/LibHal/devices/computer",
+ return libhal_device_get_property_bool (hal_ctx, "/org/freedesktop/Hal/devices/computer",
"storage.policy.default.use_managed_keyword", &error);
}
@@ -1446,7 +1446,7 @@
{
DBusError error;
dbus_error_init (&error);
- return libhal_device_get_property_string (hal_ctx, "/org/freedesktop/LibHal/devices/computer",
+ return libhal_device_get_property_string (hal_ctx, "/org/freedesktop/Hal/devices/computer",
"storage.policy.default.managed_keyword.primary", &error);
}
@@ -1455,7 +1455,7 @@
{
DBusError error;
dbus_error_init (&error);
- return libhal_device_get_property_string (hal_ctx, "/org/freedesktop/LibHal/devices/computer",
+ return libhal_device_get_property_string (hal_ctx, "/org/freedesktop/Hal/devices/computer",
"storage.policy.default.managed_keyword.secondary", &error);
}
@@ -1464,6 +1464,8 @@
dbus_bool_t
libhal_drive_policy_is_mountable (LibHalDrive *drive, LibHalStoragePolicy *policy)
{
+ printf ("should_mount=%d, no_partitions_hint=%d\n", drive->should_mount, drive->no_partitions_hint);
+
return drive->should_mount && drive->no_partitions_hint;
}
@@ -1500,7 +1502,7 @@
type = libhal_psi_get_type (&it);
key = libhal_psi_get_key (&it);
- if (libhal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN &&
+ if (libhal_psi_get_type (&it) == LIBHAL_PROPERTY_TYPE_BOOLEAN &&
strncmp (key, namespace, namespace_len - 1) == 0) {
const char *option = key + namespace_len - 1;
char *location;
@@ -1564,12 +1566,12 @@
/* collect options != ('pamconsole', 'user', 'users', 'defaults' options that imply other options) */
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/LibHal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
+ "/org/freedesktop/Hal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
mopts_collect (drive->hal_ctx, stor_mount_option_begin, sizeof (stor_mount_option_begin),
drive->udi, drive->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
/* ensure ('pamconsole', 'user', 'users', 'defaults' options that imply other options), are first */
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/LibHal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
+ "/org/freedesktop/Hal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
mopts_collect (drive->hal_ctx, stor_mount_option_begin, sizeof (stor_mount_option_begin),
drive->udi, drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
@@ -1607,12 +1609,12 @@
/* ensure ('pamconsole', 'user', 'users', 'defaults' options that imply other options), are first */
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/LibHal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
+ "/org/freedesktop/Hal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
mopts_collect (drive->hal_ctx, vol_mount_option_begin, sizeof (vol_mount_option_begin),
volume->udi, volume->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
/* collect options != ('pamconsole', 'user', 'users', 'defaults' options that imply other options) */
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/LibHal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
+ "/org/freedesktop/Hal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
mopts_collect (drive->hal_ctx, vol_mount_option_begin, sizeof (vol_mount_option_begin),
volume->udi, volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
More information about the hal-commit
mailing list