backends and external libraries

From: David Paschal (paschal@ns.net)
Date: Fri Mar 03 2000 - 01:19:59 PST

  • Next message: Ferenc: "Re: turning of lamp"

    Hi. As part of my efforts to add SANE support for HP OfficeJets (see
    http://www.ns.net/~paschal/sane), I decided to move my I/O code from the
    backend into an external library, since the code is growing rather complicated
    and will be used for other applications besides scanning (printing, faxing,
    copying, etc.). I've looked through the configure scripts and makefiles
    and think I would be able to figure out with some experimentation how to
    modify SANE to support such an optional external library. I was wondering
    if anybody could give me some advice on the best (cleanest) way to do this
    to save me a little time and so I would do it right the first time.

    Here's what I think I need to be able to do:

    - Modify the configure.in (and generate a new ./configure) to check for the
    existence, version, and location of this external library (which I'm currently
    calling PTAL, for "Peripheral Transport Abstraction Library"). ./configure
    currently does something similar to check for GTK.

    - If the library is not found, then build the HP SCL backend as usual to
    support the usual connection methods (SCSI, device, PIO). Disable the new
    HP DTF backend I'm working on to support the sheetfed OfficeJets and the
    LaserJet 1100A (which could be connected either to a LAN via an HP JetDirect
    external print server, or eventually to the parallel port on a workstation
    using a Linux kernel module).

    - If the library is found, then enable the DTF backend. Use the gcc -D
    switch to pass in an extra #define to the HP SCL backend that enables my
    added code that interfaces with PTAL to support the SCL-based flatbed HP
    OfficeJets. What should I call this #define? "PTAL"? Or "HAVE_PTAL"?

    - When building PTAL-enabled backends, as well as versions of Peter
    Kirchgessner's hpinq and hpscan utilities that I've hacked to support PTAL,
    either statically or dynamically link the PTAL library to the corresponding
    backend or executable. I imagine dynamic linking would be preferable, but
    isn't it unavailable on certain platforms?

    And what would happen if both the SCL and DTF backends were running at the
    same time (i.e. under saned)? In the case of static linking, would there be
    problems with the identically-named PTAL symbols in the two backends clashing?
    That shouldn't be a problem for dynamic linking, since only one instance of
    PTAL would actually be loaded and running; it would merely be up to me to
    ensure that it could safely be used by two backends in this manner. (Does
    PTAL need to be thread-safe, even through AFAIK none of its intended clients
    will be multi-threaded?)

    So are the above items all I need to do, or can somebody tell me what else I
    need to do? I would also greatly appreciate specific advice on how to do
    these things to make this work. On the other hand, if I wasn't clear enough
    in explaining what I'm trying to do (or why), then please let me know and
    I'll elaborate as necessary.

    Thanks in advance for any assistance you can give.

    David

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Fri Mar 03 2000 - 01:13:24 PST