[sane-devel] [RFC][PATCH] sanei configuration framework extension
m. allan noah
kitno455 at gmail.com
Wed Jul 9 18:27:23 UTC 2008
excellent. this will make config parsing much easier. please commit!
2008/7/9 stef <stef.dev at free.fr>:
> Le Monday 07 July 2008 22:25:34 m. allan noah, vous avez écrit :
>> 2008/6/25 stef <stef.dev at free.fr>:
>> > here's the patch modified like you suggest. Now both descriptors
>> > and placeholders are given by the backend. There is no need for a
>> > free'ing function anymore.
>> this looks very good, but i dont see much point in the helper
>> functions. presumably the backend will maintain some sort of enum list
>> of indexes (like most do with options), so it wont need to lookup by
>> name, and the initializer would probably be fewer lines of code if
>> done inside the backend, and you wont need the descriptor array to be
>> null terminated.
>> oh, and what about a backend that has only option lines in the config
>> file, it would never call the callback. i guess the backend can still
>> read the SANEI_Config structure pointer if it cached it somewhere,
>> after calling sanei_configure_attach()?
>> "The truth is an offense, but not a sin"
> I removed other functions other than the one for parsing configuration
> options given by the backend. It is now up to the backend to allocate and
> free the needed ressources, and to provie the option count in SANEI_Config.
> In case a backend doesn't provide an attach callback and had only option
> lines, the SANEI_Config structure is still filled with the values found
> during configuration parsing after the call. So it can be used by the
> The attached patch implements all this and a sample usage in the rts8891
> backend. All SANE_TYPE_* with their optional constraints are supported. Among
> the existing configuration file, only 'calibrate' and 'port' options of
> canon_pp.conf wouldn't be handled directly since they rely on 2 strings
> I developped and tested this patch using testsuites built with 'check'
> (http://check.sf.net). I can provide them in case of interest.
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> Unsubscribe: Send mail with subject "unsubscribe your_password"
> to sane-devel-request at lists.alioth.debian.org
"The truth is an offense, but not a sin"
More information about the sane-devel