[sane-devel] Options that cannot be controlled

m. allan noah kitno455 at gmail.com
Sat Mar 29 19:46:20 UTC 2014


Have you checked the 'cap' on the option descriptor? The three pass
option, for instance, is SANE_CAP_INACTIVE unless you are in color
mode.

allan

On Sat, Mar 29, 2014 at 3:30 PM, Ross Vandegrift <ross at kallisti.us> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hello,
>
> I've been working with libsane, and have discovered that some options
> cannot be used to anything.  One cannot get, set or force them to
> auto.  For example, option 5 on the sane-test backend, "three-pass" is
> one such option.  Sample code demonstrating this is below.  Is this
> intentional?  If so, what is the point?
>
> Please keep me CCed, as I am not subscribed.
>
> Thanks,
> Ross
>
>
>
> #include <stdlib.h>
> #include <stdio.h>
> #include <sane/sane.h>
>
> int main(void) {
>   static SANE_Handle h;
>   const SANE_Option_Descriptor *desc;
>   const SANE_String_Const *x;
>   SANE_Status s;
>   char *buf;
>   SANE_Int i;
>
>   sane_init(NULL, NULL);
>   sane_open("test", &h);
>
>   /* "three-pass" is option index 5 for the sane-test backend */
>   desc = sane_get_option_descriptor(h, 5);
>   printf("name: %s\n", desc->name);
>   printf("title: %s\n", desc->title);
>   printf("desc: %s\n", desc->desc);
>
>   buf = (char *) malloc((size_t) desc->size);
>   s = sane_control_option(h, 5, SANE_ACTION_SET_AUTO, buf, &i);
>   printf("Set auto return: %s (info: %d)\n", sane_strstatus(s), i);
>   s = sane_control_option(h, 5, SANE_ACTION_GET_VALUE, buf, &i);
>   printf("Get value return: %s (info: %d)\n", sane_strstatus(s), i);
>   s = sane_control_option(h, 5, SANE_ACTION_SET_VALUE, buf, &i);
>   printf("Set value return: %s (info: %d)\n", sane_strstatus(s), i);
> }
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iQIcBAEBCgAGBQJTNx9cAAoJENqziTKaTPoWi/gQAKhLiyyeWM7hFzRiN7kBAtlj
> 24h2lPIZ0c2EFUg8eDhzBnBzPx5T+l24R4IhwgmQu/5rmFJZh1AEw5i/z7O4HqSX
> 1gC9La/xUrCCsrFEWI2CkHobAmChhto0tLGnOkCPIVwHNF4DELkRb5LFkYtQOJlV
> z6hGt5K/AYX5ou+vLHnfghpn+ZnO96Eri5BDC75xf55crDtNQaZDjV+/M9ksy+sA
> mDQdyuj/o1H71Jb779bk0jMhVBYQj4aoC6+qfuHEoR7ddzVrHJ7JCx9eUaxOZ0eR
> pg0xNiY7BLH6yD/6wJO+JDpqpFT0m/drExyoqJVXdn2ALJwnTfL5XMnCReAwbTsE
> 0+ECzEaOXO8rn6imecv8msEXRfunyeRZc1XTV2WsI8qVVhguU1uDWBVgAVfJM27A
> V2s2i1Kkt8Rm5YUov8HCXaNCRUXjRGvwtUi96kelmo2cugvgALi4UmA8tQA2yCD0
> 1HEB+lHlv1szEQvat+S+LJtVxFGAmdAybmoLsP6uEQCziDMMJN+2ywn1uEzKQhSt
> eYqjbJfBF5ENBRgKA3iRIl8/kzL1HMiGceYwCDfZtmA0kh4bJKLgxE4ACV0y3kTe
> 1RmfU2v6qaK3mpRaqeVLioos9lwRTRwZkG+u7oxSwt1fFfyL3/RwLiknruGZubcM
> 4C00Rl/ZcXszQN3DmJEj
> =fFpf
> -----END PGP SIGNATURE-----
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/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