[sane-devel] backend naming conventions/constraints

Olaf Meeuwissen olaf@epkowa.co.jp
27 Feb 2003 09:16:35 +0900


Henning Meier-Geinitz <henning@meier-geinitz.de> writes:

> 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.

I was afraid so :-{

> > 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.

Yup, backends/Makefile.in uses

  %-s.lo: %-s.c
          @$(LIBTOOL) $(MCOMP) $(COMPILE) -DSTUBS -DBACKEND_NAME=$* $<

  %.lo:   %.c
          @$(LIBTOOL) $(MCOMP) $(COMPILE) -DBACKEND_NAME=$* \
                -DLIBDIR=$(libsanedir) $<

So using epson-kowa.c screws things up.  However, I only have one
backend to build with "Image Scan!" so I could hack around this.
Either in Makefile.in or in my source file.

BTW, is there any reason the build system is not updated to reflect
the improved capabilities of libtool?  It pretty much seems to be
based on libtool-1.0 or so, while the current version is 1.4.

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

Apart from esthetics and readability?  Guess not, so it boils down to
whether I think it's worth the trouble.
-- 
Olaf Meeuwissen                            EPSON KOWA Corporation, ECS
GnuPG key: 6BE37D90/AB6B 0D1F 99E7 1BF5 EB97  976A 16C7 F27D 6BE3 7D90
Penguin's lib!       -- I hack, therefore I am --               LPIC-2