Use option name instead of index

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Use option name instead of index

Étienne Bersac-3

In SANE 1, frontend has to list almost all options in order to build a
relation table of index -> option_name (or use a struct like xsane).

I suggest to use directly option name (SANE_String) as referer.

This imply also that, instead of a "option-count" option, we provide a
sane_device_list_options (handle) call which retourn a NULL terminated
array of SANE_Option_Descriptor. Then, this make sense to use Macro for
Well-Known option name.

As a summary :

      * Define sane_device_list_options (handle) which return a NULL
        terminated array of SANE_Option_Descriptor
      * Use string instead of integer to refer options
      * Define well know option macr (e.g. SANE_OPTION_RESOLUTION
        "resolution", …).

Again, that's just an idea. Please comment.

Verso l'Alto !

sane-standard mailing list: [hidden email]
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to  [hidden email]

signature.asc (196 bytes) Download Attachment