Next Up Previous Contents

3.1 Attaching to a SANE backend

Attaching to a SANE backend

The process through which a SANE frontend connects to a backend is platform dependent. Several possibilities exist:

Figure 1:Example SANE Hiearchy

There is not complete answer for this question. It depends on the implementation which will probably be chosen with regard to the limitations of the OS underneath.

For systems which are able to handle dynamic library loading, it is recommended to build SANE drivers as DLLs and use a "wrapper-lib" that chooses the driver to use and loads it via "dlopen()" or something similar.

If only one scanner is reachable by an installation, the correct lib can simply be installed in place of the wrapper.

Systems that do not support dynamic binding have other options:

1. Use the NET-SANE driver and install the correct scanner daemon. 2. Link the app with all drivers it should use. This will need a few #define sane_driver_sane_ and a wrapper lib that knows about all attached drivers. 3. Make multiple apps. Each linked with the right driver.


Next Up Previous Contents