[sane-devel] [RFC][PATCH] sanei configuration framework extension

stef stef.dev at free.fr
Mon Jun 16 04:52:49 UTC 2008


	Hello,

	here's a demo patch (compile only for now, waiting for feedback first) that 
adds a sanei_configure_attach function. It parses a given configuration 
file 'top down', detects any line starting by "option". In this case it 
analyzes the option name and store the read value in the proper field of the 
new SANE_Config structure. It also handles blank and comment lines. When a 
non comment line which doesn't start by "option" is found, it is considered a 
device name and a backend-provided function is called to try to attach to it. 
The current configuration structure is given as a parameter of this function. 
	
	With this sanei function, backends don't need to implement any option 
parsing. In case the need for new options arise, we only need to add it to  
sanei_configure_attach() and add a corresponding field in SANE_Config struct. 
The function doesn't call any SCSI or USB attaching function so that backends 
won't have to allways depend on sanei_usb_* or sanei_scsi_* functions.

Regards,
	Stef




	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.patch.gz
Type: application/x-gzip
Size: 3273 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20080616/b1f9de7f/attachment-0001.bin 


More information about the sane-devel mailing list