[sane-devel] [RFC] how to enable 1.1 features
Alessandro Zummo
azummo-lists at towertech.it
Thu Feb 28 09:29:52 UTC 2008
On Thu, 28 Feb 2008 08:43:26 +0900
Olaf Meeuwissen <olaf.meeuwissen at avasys.jp> wrote:
> Alessandro Zummo <azummo-lists at towertech.it> writes:
>
> > please see the attached patch regarding my proposal
> > for a safe enabling of 1.1 features in the backends.
>
> Hmm, the SANE Standard Version 1.03 says about SANE_VERSION_CODE():
>
> Note that the major version number alone determines whether a
> frontend/backend pair is compatible. The minor version and the
> build revision are used for informational and bug-fixing purposes
> only.
>
> This means that a backend implementer is free to pass back something
> like
>
> SANE_VERSION_CODE(1,2,3)
>
> for a SANE 1.0 backend. Isn't that a bit confusing? I think that
> just changing the name of the macro to something like SANE_API_LEVEL
> would improve code readability and reduce confusion.
yes, SANE_API_LEVEL sounds better. The 1.1 standar will have
to mention this.
>
> The same SANE Standard Version 1.03 does not explicitly state what a
> backend is supposed to return when passed and unknown action. I'd
> assume that any sane developer would return SANE_STATUS_UNSUPPORTED
> but I wouldn't quite bet on it.
neither do I, that's why I will be checking every backend. UNSUPPORTED
would be fine but any error would do. The 1.1 standard will mention that too.
> Another issue I have with the SANE_ACTION_COMPAT_LEVEL symbol is that
> I don't think of that as an action. A symbol more action-like, like
> SANE_ACTION_CHECK_API_LEVEL for example, is clearer IMHO.
ack.
> Apart from the above (and the fact that it is an ugly hack as SANE 1.0
> surely didn't intend to provide for API major/minor versions ;-), the
> above would work fine in practice.
We all noticed that SANE 1.0 missed some things.. that's the reason
we are still discussing all of that 10 years after :-D
--
Best regards,
Alessandro Zummo,
Tower Technologies - Torino, Italy
http://www.towertech.it
More information about the sane-devel
mailing list