sane-project-website/old-archive/1998-05/0165.html

108 wiersze
5.1 KiB
HTML

<!-- received="Wed May 13 23:05:11 1998 PDT" -->
<!-- sent="Wed, 13 May 1998 23:05:09 -0700" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="David.Mosberger@acm.org" -->
<!-- subject="Re: sane 0.73 pre-test patch" -->
<!-- id="199805140605.XAA07988@panda.mostang.com" -->
<!-- inreplyto="m0yZqtZ-000J34C@yoo-hoo.ai.mit.edu" -->
<title>sane-devel: Re: sane 0.73 pre-test patch</title>
<h1>Re: sane 0.73 pre-test patch</h1>
<b>David Mosberger-Tang</b> (<a href="mailto:David.Mosberger@acm.org"><i>David.Mosberger@acm.org</i></a>)<br>
<i>Wed, 13 May 1998 23:05:09 -0700</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#165">[ date ]</a><a href="index.html#165">[ thread ]</a><a href="subject.html#165">[ subject ]</a><a href="author.html#165">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0166.html">Hugo van der Kooij: "Re: Need SCSI card advice"</a>
<li> <b>Previous message:</b> <a href="0164.html">charter@cs.ualberta.ca: "Re: problems with snapscan and scanimage"</a>
<li> <b>In reply to:</b> <a href="0163.html">Matto Marjanovic: "Re: sane 0.73 pre-test patch"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;&gt;&gt;&gt;&gt; On Thu, 14 May 1998 01:49:33 -0400 (EDT), Matto Marjanovic &lt;<a href="mailto:maddog@mir.com">maddog@mir.com</a>&gt; said:</i><br>
<p>
Matto&gt; With regards to the new, smarter configuration code:<br>
<p>
Matto&gt; a) It would be a good idea if the "attach" function which is<br>
Matto&gt; passed to sane_config_attach_matching_devices() took an extra<br>
Matto&gt; (void *) argument, to handle any additional data which it may<br>
Matto&gt; need/return.<br>
<p>
I hope it won't be necessary. Rentrancy is not an issue since this is<br>
used during initialization only so it would be perfectly ok to use<br>
some static variables in the backend (the mustek backend does this,<br>
for example).<br>
<p>
Matto&gt; b) sane_config_attach_matching_devices() should return<br>
Matto&gt; something, at least maybe the results of the called attach<br>
Matto&gt; function. One might want to know if it succeeds or not.<br>
<p>
No. It is/was a common mistake for backends to complain and stop if<br>
an attach during initialization fails. That's wrong (the attach<br>
during initialization should be considered a "probe") and with the<br>
current interface a backend writer simply can't make this mistake<br>
anymore (or so I hope).<br>
<p>
Matto&gt; c) Might it not be cleaner if the attach_matching_devices<br>
Matto&gt; code would simply return a list of appropriate device name<br>
Matto&gt; strings, then the backend could go through and do what it<br>
Matto&gt; wants to each entry? (This would eliminate (a), (b), and<br>
Matto&gt; (f).)<br>
<p>
A matter of taste, I'd say.<br>
<p>
Matto&gt; d) (Now, speaking from the perspective of the<br>
Matto&gt; mentally-challenged Microtek firmware: ) Aside from the<br>
Matto&gt; Microtek backend needing to look for at least five different<br>
Matto&gt; vendor strings (something new every day), one of these<br>
Matto&gt; strings is " " [8 spaces, returned by my very own E6]. The<br>
Matto&gt; sanei_config2.c code correctly handles quoted strings,<br>
Matto&gt; however the code which scans /proc/scsi (which has no quotes)<br>
Matto&gt; discards all this 'whitespace'.<br>
<p>
That sounds ugly. I think we can fix it through (e).<br>
<p>
Matto&gt; e) How about adding the "Type:" from /proc/scsi/scsi as well?<br>
Matto&gt; "Scanner" is a good catch-all (except for the HP scanners),<br>
Matto&gt; and since the average user has only one scanner, this doesn't<br>
Matto&gt; hammer other devices.<br>
<p>
Matto&gt; (as it stands, only "scsi * * * * *" works for the E6,<br>
Matto&gt; which just assaults the entire scsi bus....)<br>
<p>
Yes, I thought of that too. I'll add it.<br>
<p>
Matto&gt; f) A logic glitch: If a user does happen to have multiple<br>
Matto&gt; scanners of the same type in his system, the config code will<br>
Matto&gt; only attach the first one (after which, the function<br>
Matto&gt; returns).<br>
<p>
I don't think so. It returns only if (*attach)() returns something<br>
other than SANE_STATUS_GOOD, which happens only when a fatal error<br>
occurs in the backend (such as when the mustek backend runs out of<br>
memory, for example). At least, that's the idea...<br>
<p>
I integrated your fix for the microtek backend. Thanks for the<br>
feedback!<br>
<p>
Cheers,<br>
<p>
--david<br>
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0166.html">Hugo van der Kooij: "Re: Need SCSI card advice"</a>
<li> <b>Previous message:</b> <a href="0164.html">charter@cs.ualberta.ca: "Re: problems with snapscan and scanimage"</a>
<li> <b>In reply to:</b> <a href="0163.html">Matto Marjanovic: "Re: sane 0.73 pre-test patch"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>