HAL 0.5.7 -> 0.5.8 API changes (and subtle breakage heh)

Milosz Derezynski internalerror at gmail.com
Sun Nov 26 11:54:47 PST 2006


Hi everyone,

I'm the author of a/the libhal(-storage) C++ wrapper (
http://projects.beep-media-player.org/index.php/Main/Hal ).

I've noticed some subtle differences between hal 0.5.7.x and hal
0.5.8.xwhich are not clear to me as to why this happened:

0.5.7:
--snip--
struct LibHalPropertySetIterator_s {
  LibHalPropertySet *set;    /**< Property set we are iterating over */
  unsigned int index;
--snip--

0.5.8:
--snip--
struct LibHalPropertySetIterator_s {
  LibHalPropertySet *set;    /**< Property set we are iterating over */
  unsigned int idx;
--snip--

("index" was renamed to "idx")

I'm providing an STL-like (input iterator concept providing) interface for
iterating through the PS of a device in the C++ wrapper, which requires this
code here to check whether 2 iters are identical (point to the same position
in the PS, and belong to the same PS):

--snip--
#ifdef HAVE_HAL_058
                return ((i.idx == other.i.idx) && (i.set == other.i.set));
#else
                return ((i.index == other.i.index) && (i.set == other.i.set
));
#endif // HAVE_HAL_058
--snip--

I'd like to ask to please not change the name of this member or the entire
PS iterator struct itself, if possible at all. Alternatively mark the entire
structure as private/opaque/subject to change, and if that should happen,
please provide get_current_index(), and get_property_set() methods for the
iterator.

The second thing i'd like to point out is this:

0.5.7 LibHalDriveCdromCaps:
--snip--
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSR   = 0x0080,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRW  = 0x0100,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRDL = 0x0200,
  LIBHAL_DRIVE_CDROM_CAPS_BDROM      = 0x0400,
  LIBHAL_DRIVE_CDROM_CAPS_BDR        = 0x0800,
--snip--

0.5.8 LibHalDriveCdromCaps:
--snip--
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSR    = 0x00080,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRW   = 0x00100,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRDL  = 0x00200,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL = 0x00400,
  LIBHAL_DRIVE_CDROM_CAPS_BDROM       = 0x00800,
  LIBHAL_DRIVE_CDROM_CAPS_BDR         = 0x01000,
--snip--

All the values after  DVDPLUSRDL are shifted, which doesn't make much sense
to me, as there is enough padding. How this padding was to be used exactly I
don't know, but without knowing it, this here would seem to have been just
as sensible and then even keeping the API wrt this enum stable:

  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSR    = 0x00080,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRW   = 0x00100,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRDL  = 0x00200,
  LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL = 0x00201,
  LIBHAL_DRIVE_CDROM_CAPS_BDROM       = 0x00400,
  LIBHAL_DRIVE_CDROM_CAPS_BDR         = 0x00800,


Thanks for consideration
Milosz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/hal/attachments/20061126/0715d7b2/attachment.html


More information about the hal mailing list