sane-project-website/old-archive/2000-03/0013.html

159 wiersze
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: backends and external libraries</TITLE>
<META NAME="Author" CONTENT="David Paschal (paschal@ns.net)">
<META NAME="Subject" CONTENT="backends and external libraries">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>backends and external libraries</H1>
<!-- received="Fri Mar 3 01:12:42 2000" -->
<!-- isoreceived="20000303091242" -->
<!-- sent="Fri, 03 Mar 2000 01:19:59 -0800" -->
<!-- isosent="20000303091959" -->
<!-- name="David Paschal" -->
<!-- email="paschal@ns.net" -->
<!-- subject="backends and external libraries" -->
<!-- id="200003030919.BAA00976@axel.local" -->
<STRONG>From:</STRONG> David Paschal (<A HREF="mailto:paschal@ns.net?Subject=Re:%20backends%20and%20external%20libraries&In-Reply-To=&lt;200003030919.BAA00976@axel.local&gt;"><EM>paschal@ns.net</EM></A>)<BR>
<STRONG>Date:</STRONG> Fri Mar 03 2000 - 01:19:59 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0014.html">Ferenc: "Re: turning of lamp"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0012.html">John Gay: "Re: Snapscan 1236s &amp; AVA1505AE"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0094.html">Petter Reinholdtsen: "Re: backends and external libraries"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0094.html">Petter Reinholdtsen: "Re: backends and external libraries"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#13">[ date ]</A>
<A HREF="index.html#13">[ thread ]</A>
<A HREF="subject.html#13">[ subject ]</A>
<A HREF="author.html#13">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Hi. As part of my efforts to add SANE support for HP OfficeJets (see
<BR>
<A HREF="http://www.ns.net/~paschal/sane">http://www.ns.net/~paschal/sane</A>), I decided to move my I/O code from the
<BR>
backend into an external library, since the code is growing rather complicated
<BR>
and will be used for other applications besides scanning (printing, faxing,
<BR>
copying, etc.). I've looked through the configure scripts and makefiles
<BR>
and think I would be able to figure out with some experimentation how to
<BR>
modify SANE to support such an optional external library. I was wondering
<BR>
if anybody could give me some advice on the best (cleanest) way to do this
<BR>
to save me a little time and so I would do it right the first time.
<BR>
<P>Here's what I think I need to be able to do:
<BR>
<P>- Modify the configure.in (and generate a new ./configure) to check for the
<BR>
existence, version, and location of this external library (which I'm currently
<BR>
calling PTAL, for &quot;Peripheral Transport Abstraction Library&quot;). ./configure
<BR>
currently does something similar to check for GTK.
<BR>
<P>- If the library is not found, then build the HP SCL backend as usual to
<BR>
support the usual connection methods (SCSI, device, PIO). Disable the new
<BR>
HP DTF backend I'm working on to support the sheetfed OfficeJets and the
<BR>
LaserJet 1100A (which could be connected either to a LAN via an HP JetDirect
<BR>
external print server, or eventually to the parallel port on a workstation
<BR>
using a Linux kernel module).
<BR>
<P>- If the library is found, then enable the DTF backend. Use the gcc -D
<BR>
switch to pass in an extra #define to the HP SCL backend that enables my
<BR>
added code that interfaces with PTAL to support the SCL-based flatbed HP
<BR>
OfficeJets. What should I call this #define? &quot;PTAL&quot;? Or &quot;HAVE_PTAL&quot;?
<BR>
<P>- When building PTAL-enabled backends, as well as versions of Peter
<BR>
Kirchgessner's hpinq and hpscan utilities that I've hacked to support PTAL,
<BR>
either statically or dynamically link the PTAL library to the corresponding
<BR>
backend or executable. I imagine dynamic linking would be preferable, but
<BR>
isn't it unavailable on certain platforms?
<BR>
<P>And what would happen if both the SCL and DTF backends were running at the
<BR>
same time (i.e. under saned)? In the case of static linking, would there be
<BR>
problems with the identically-named PTAL symbols in the two backends clashing?
<BR>
That shouldn't be a problem for dynamic linking, since only one instance of
<BR>
PTAL would actually be loaded and running; it would merely be up to me to
<BR>
ensure that it could safely be used by two backends in this manner. (Does
<BR>
PTAL need to be thread-safe, even through AFAIK none of its intended clients
<BR>
will be multi-threaded?)
<BR>
<P>So are the above items all I need to do, or can somebody tell me what else I
<BR>
need to do? I would also greatly appreciate specific advice on how to do
<BR>
these things to make this work. On the other hand, if I wasn't clear enough
<BR>
in explaining what I'm trying to do (or why), then please let me know and
<BR>
I'll elaborate as necessary.
<BR>
<P>Thanks in advance for any assistance you can give.
<BR>
<P>David
<BR>
<P><P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20backends%20and%20external%20libraries&In-Reply-To=&lt;200003030919.BAA00976@axel.local&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0014.html">Ferenc: "Re: turning of lamp"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0012.html">John Gay: "Re: Snapscan 1236s &amp; AVA1505AE"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0094.html">Petter Reinholdtsen: "Re: backends and external libraries"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0094.html">Petter Reinholdtsen: "Re: backends and external libraries"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#13">[ date ]</A>
<A HREF="index.html#13">[ thread ]</A>
<A HREF="subject.html#13">[ subject ]</A>
<A HREF="author.html#13">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Fri Mar 03 2000 - 01:13:24 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>