[sane-devel] SANE_CAP_ALWAYS_SETTABLE (was Re: Preparing for a sane-backends release)

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Tue Aug 4 23:21:57 UTC 2015


Johannes Meixner writes:

> Everey Linux distribution should submit their patches to SANE
> upstream (provided their changes make sense for upstream).
>
> Here our (i.e. openSUSE) patches that we still have:
> [...]
> 2)
> My re-add-SANE_CAP_ALWAYS_SETTABLE.patch re-adds SANE_CAP_ALWAYS_SETTABLE
> to sane.h which was erroneously removed in sane-backends-1.0.20 so that
> sane-frontends and xsane can no longer build, see
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527675

Hmm, SANE_CAP_ALWAYS_SETTABLE is not part of the SANE Standard.  Not in
version 1 at least (and so far there hasn't been any other version).

> re-add-SANE_CAP_ALWAYS_SETTABLE.patch
> -----------------------------------------------------------------------------
> --- include/sane/sane.h.orig    2009-06-12 10:19:19.000000000 +0200
> +++ include/sane/sane.h 2009-06-12 10:20:12.000000000 +0200
> @@ -115,6 +115,7 @@ SANE_Device;
>   #define SANE_CAP_AUTOMATIC             (1 << 4)
>   #define SANE_CAP_INACTIVE              (1 << 5)
>   #define SANE_CAP_ADVANCED              (1 << 6)
> +#define SANE_CAP_ALWAYS_SETTABLE       (1 << 7)

The version 2 *draft* adds it with a value of 256, i.e. (1 << 8), and
uses 128 (1 << 7) for SANE_CAP_HIDDEN.

>   #define SANE_OPTION_IS_ACTIVE(cap)     (((cap) & SANE_CAP_INACTIVE) == 0)
>   #define SANE_OPTION_IS_SETTABLE(cap)   (((cap) & SANE_CAP_SOFT_SELECT) != 0)
> -----------------------------------------------------------------------------
>
> The re-add-SANE_CAP_ALWAYS_SETTABLE.patch still applies for
> current sane-backends-git20150804.tar.gz so that I assume
> SANE_CAP_ALWAYS_SETTABLE is still missing in sane-backends.
>
> I did not verify whether or not meanwhile all SANE frontends
> also no longer use SANE_CAP_ALWAYS_SETTABLE so that it could
> meanwhile be really removed in sane-backends.

The sane-frontends have it in an #ifdef conditional (in src/gtkglue.c)
that was added in 5e96223, apparently to switch to SANE 1.1 which never
materialized.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2     FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



More information about the sane-devel mailing list