[sane-devel] What's local_only and what's not?

Olaf Meeuwissen paddy-hack at member.fsf.org
Tue Nov 12 09:06:28 GMT 2019

Hi list!

In GitLab issues #130 and #141 we've run into something interesting ;-)

 #130: https://gitlab.com/sane-project/backends/issues/130
 #141: https://gitlab.com/sane-project/backends/issues/141

Discussing what `sane_get_devices()` should be considered `local_only`,
we are no longer sure what is and is not local :-o

Anyone care to chime in with opinions and arguments substantiating them?

> FWIW, the SANE Standard, in section 4.3.3 sane_get_devices, has the
> following to say:
>  4.3.3 sane_get_devices
>  This function can be used to query the list of devices that are
>  available. If the function executes successfully, it stores a pointer
>  to a `NULL` terminated array of pointers to `SANE_Device` structures
>  in `*device_list`. The returned list is guaranteed to remain unchanged
>  and valid until (a) another call to this function is performed or (b)
>  a call to `sane_exit()` is performed. This function can be called
>  repeatedly to detect when new devices become available. If argument
>  `local_only` is true, only local devices are returned (devices
>  directly attached to the machine that SANE is running on). If it is
>  false, the device list includes all remote devices that are accessible
>  to the SANE library.
>     SANE_Status sane_get_devices (const SANE_Device *** device_list,
>                                   SANE_Bool local_only);
>  This function may fail with `SANE_STATUS_NO_MEM` if an insufficient
>  amount of memory is available.
>     **Backend Implementation Note**
>     SANE does not require that this function is called before a
>     `sane_open()` call is performed. A device name may be specified
>     explicitly by a user which would make it unnecessary and
>     undesirable to call this function first.

Hope this will shed some light in our "darkness" ;-),
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join

More information about the sane-devel mailing list