[sane-devel] [patch][RFC] sanei_usb_init improvement

stef stef.dev at free.fr
Sun Dec 7 07:16:37 UTC 2008


	Hello,

	here's a patch to improve sanei_usb_init() behavior. It works by using an 
internal function to store device instead of writing them directly in the 
devices array. This function first checks if the device doesn't exist yet 
using the equals() function, and then add it if it is new. The array of 
devices is initialized only once at start. This way, sanei_usb_init() can be 
called repeatedly without messing existing entries, even if new devices are 
plugged in.
	This patch doesn't handle device unplugging, but we could easily detect them 
by flagging all devices at sanei_usb_init() start, then clear it each time we 
try to add the same device again. At the end, only unplugged devices would 
still be flagged.

Regards,
	Stef
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usb_init.patch
Type: text/x-diff
Size: 8241 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20081207/4353c672/attachment-0001.patch 


More information about the sane-devel mailing list