[sane-devel] backend naming conventions/constraints

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 26 Feb 2003 10:57:34 +0100


Hi,

On Wed, Feb 26, 2003 at 03:12:24PM +0900, Olaf Meeuwissen wrote:
> Silly question but are there any constraints on the name of a backend?

It shouldn't be too long, but epson_kowa is ok in this respect. It
shouldn't contain any characters that can't be used in the filesystem.
And it should be usable as a C identifier, that means it shouldn't
contain " ", "-" or any other charatcers that aren't allowed to be
used in identifiers.

The reason is that if you link more than one backend statically
("preload"), the symbols must be different (sane_gt68xx_init,
sane_mustek_init etc.). So the backend name is used in the symbol.

> I am in the middle of switching "Image Scan!"s backend from epson to
> epson-kowa and ran into the BACKEND_NAME macro ;-)  Is there any harm
> in calling the backend library libsane-epson-kowa.* while defining the
> macro to epson_kowa?

I wouldn't do that. I haven't really checked the implications but that
may collide with one of the hacks used to enable static/shared linkage
and dynamic loading.

Why don't you use "libsane-epson_kowa" or "libsane-epsonkowa"?

Bye,
  Henning