Oops!
I was wrong - iter is not a pointer, but plain unsigned int. The tags
have played a joke with me, so when I was looking for what was a type
of mach_port_t, they showed me a line from port.h file in the Kernel
framework. And I wasn't attentive enough to notice that. So here is
the working version:
(import Cocoa)
(load "Nu:cocoa")
(function . (obj) (puts (obj description)))
(bridge function IOServiceMatching "@r*")
(bridge function IOServiceGetMatchingServices "II@^I")
(bridge function IOIteratorNext "II")
(bridge function IORegistryEntryCreateCFProperties "II^@^VI")
(bridge constant kIOMasterPortDefault "I")
(set uinfo (IOServiceMatching "IOUSBDevice"))
(set p-iter (NuPointer new))
(unless (IOServiceGetMatchingServices kIOMasterPortDefault uinfo p-
iter)
(while (set dev (IOIteratorNext (p-iter value)))
(set r-props (NuReference new))
(set allocator (NuPointer new))
(unless (IORegistryEntryCreateCFProperties dev r-props nil 0)
(. (r-props value)))))