[sane-devel] General question on C programming

Julien BLACHE jb at jblache.org
Wed Oct 17 15:05:13 UTC 2007

jazz_johnson at verizon.net wrote:


> So, is the static keyword necessary to prevent backend drivers from 
> interfering with each other, or is the keyword unnecessary?

Every function in a backend that isn't part of the SANE API described
in the SANE standard must be declared static. Put another way, only
the SANE API functions must be exported.

This is to avoid any clash with an application that would link
statically against a backend. (use ./configure --enable-static; make;
make libcheck to check that your backend is OK)

Also, the SANE build system doesn't really support having several
source files for a backend. You'll see that most multi-file backends
in fact #include the other .c files.


Julien BLACHE                                   <http://www.jblache.org> 
<jb at jblache.org>                                  GPG KeyID 0xF5D65169

More information about the sane-devel mailing list