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

m. allan noah kitno455 at gmail.com
Thu Jun 19 13:36:59 UTC 2008


pretty good, but i have two comments:

1. i think calling the struct SANE_Config instead of something with
sanei in it, makes it look too much like something that should be in
the SANE standard, instead of the internal-use function that it is.

2. some backends seem to have dozens of options, that struct is going
to become quite large if it is extending to hold everything. does it
instead make more sense for the callback to be run for each line
extracted from the file, with a flag indicating that it was an option
instead of an attach line?

allan

2008/6/16 stef <stef.dev at free.fr>:
>        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
>
>
>
>
>
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> 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 mailing list