[sane-devel] Proposal to change function signatures of a couple of sanei_usb_* functions

Olivier Valentin valentio at free.fr
Sat Aug 6 20:04:00 BST 2022




>>I propose that we change the function signature of the functions and the callback to include a (void *) context pointer:
>>
>>SANE_Status
>>sanei_usb_find_devices (SANE_Int vendor, SANE_Int product, void *context,
>>            SANE_Status (*attach) (SANE_String_Const dev, void *context));
>>
>>void
>>sanei_usb_attach_matching_devices (const char *name, void *context,
>>                   SANE_Status (*attach) (const char *dev, void *context));
>>
>Hi Ralph,
>
>Your change may impact proprietary backends (Brother, Canon, ...).
>
>Thierry 
>

Would it be possible to rely on the relative position of `const char *dev` inside the device structure by making use of `container_of()` ?

Olivier



More information about the sane-devel mailing list