hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Thu Apr 17 07:51:33 PDT 2008
doc/spec/hal-spec-properties.xml | 12 -----
hald/linux/device.c | 4 -
hald/util.c | 90 ---------------------------------------
hald/util.h | 4 -
4 files changed, 110 deletions(-)
New commits:
commit 72c7ebedcdd5ebcf4784ff406b4ffc98a97cb4d6
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Thu Apr 17 16:51:23 2008 +0200
removed deprecated keys usb_device.*_bcd
Removed deprecated keys which reached end of lifetime (2008-03-21):
* usb_device.speed_bcd (replaced by usb_device.speed)
* usb_device.version_bcd (replaced by usb_device.version)
Removed also hal_util_{g,s}et_bcd2_from_file() from hald/util.*
since they are not needed any longer.
NOTE: Someone need to adapt FreeBSD code!
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 264a06a..050f54a 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -7591,18 +7591,6 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
<entry>2007-05-01</entry>
<entry></entry>
</row>
- <row>
- <entry><literal>usb_device.speed_bcd</literal> (int)</entry>
- <entry><literal>usb_device.speed</literal> (double)</entry>
- <entry>2008-03-21</entry>
- <entry>changed from 'BCD with two decimals' to double</entry>
- </row>
- <row>
- <entry><literal>usb_device.version_bcd</literal> (int)</entry>
- <entry><literal>usb_device.version</literal> (double)</entry>
- <entry>2008-03-21</entry>
- <entry>changed from 'BCD with two decimals' to double</entry>
- </row>
</tbody>
</tgroup>
</informaltable>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 28894a8..80dd39e 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1773,11 +1773,7 @@ usb_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
hal_util_set_int_from_file (d, "usb_device.linux.device_number", sysfs_path, "devnum", 10);
hal_util_set_string_from_file (d, "usb_device.serial", sysfs_path, "serial");
-
- hal_util_set_string_from_file (d, "usb_device.serial", sysfs_path, "serial");
- hal_util_set_bcd2_from_file (d, "usb_device.speed_bcd", sysfs_path, "speed");
hal_util_set_double_from_file (d, "usb_device.speed", sysfs_path, "speed");
- hal_util_set_bcd2_from_file (d, "usb_device.version_bcd", sysfs_path, "version");
hal_util_set_double_from_file (d, "usb_device.version", sysfs_path, "version");
hal_util_get_int_from_file (sysfs_path, "bmAttributes", &bmAttributes, 16);
diff --git a/hald/util.c b/hald/util.c
index ee3cb37..29da72e 100644
--- a/hald/util.c
+++ b/hald/util.c
@@ -279,96 +279,6 @@ hal_util_set_uint64_from_file (HalDevice *d, const gchar *key, const gchar *dire
return ret;
}
-gboolean
-hal_util_get_bcd2_from_file (const gchar *directory, const gchar *file, gint *result)
-{
- FILE *f;
- char buf[64];
- gchar path[HAL_PATH_MAX];
- gboolean ret;
- gint digit;
- gint left, right;
- gboolean passed_white_space;
- gint num_prec;
- gsize len;
- gchar c;
- guint i;
-
- f = NULL;
- ret = FALSE;
-
- g_snprintf (path, sizeof (path), "%s/%s", directory, file);
-
- f = fopen (path, "rb");
- if (f == NULL) {
- //HAL_ERROR (("Cannot open '%s'", path));
- goto out;
- }
-
- if (fgets (buf, sizeof (buf), f) == NULL) {
- //HAL_ERROR (("Cannot read from '%s'", path));
- goto out;
- }
-
- left = 0;
- len = strlen (buf);
- passed_white_space = FALSE;
- for (i = 0; i < len && buf[i] != '.'; i++) {
- if (g_ascii_isspace (buf[i])) {
- if (passed_white_space)
- break;
- else
- continue;
- }
- passed_white_space = TRUE;
- left *= 16;
- c = buf[i];
- digit = (int) (c - '0');
- left += digit;
- }
- i++;
- right = 0;
- num_prec = 0;
- for (; i < len; i++) {
- if (g_ascii_isspace (buf[i]))
- break;
- if (num_prec == 2) /* Only care about two digits
- * of precision */
- break;
- right *= 16;
- c = buf[i];
- digit = (int) (c - '0');
- right += digit;
- num_prec++;
- }
-
- for (; num_prec < 2; num_prec++)
- right *= 16;
-
- *result = left * 256 + (right & 255);
- ret = TRUE;
-
-out:
- if (f != NULL)
- fclose (f);
-
- return ret;
-}
-
-gboolean
-hal_util_set_bcd2_from_file (HalDevice *d, const gchar *key, const gchar *directory, const gchar *file)
-{
- gint value;
- gboolean ret;
-
- ret = FALSE;
-
- if (hal_util_get_bcd2_from_file (directory, file, &value))
- ret = hal_device_property_set_int (d, key, value);
-
- return ret;
-}
-
gchar *
hal_util_get_string_from_file (const gchar *directory, const gchar *file)
{
diff --git a/hald/util.h b/hald/util.h
index 4cf9524..e1783e2 100644
--- a/hald/util.h
+++ b/hald/util.h
@@ -62,10 +62,6 @@ gboolean hal_util_get_bool_from_file (const gchar *directory, const gchar *file,
gboolean hal_util_set_string_from_file (HalDevice *d, const gchar *key, const gchar *directory, const gchar *file);
-gboolean hal_util_get_bcd2_from_file (const gchar *directory, const gchar *file, gint *result);
-
-gboolean hal_util_set_bcd2_from_file (HalDevice *d, const gchar *key, const gchar *directory, const gchar *file);
-
gboolean hal_util_set_double_from_file (HalDevice *d, const gchar *key, const gchar *directory, const gchar *file);
void hal_util_make_udi_unique (HalDeviceStore *store, gchar *udi, gsize udisize, const char *original_udi);
More information about the hal-commit
mailing list