Re: sane 0.73 pre-test patch

Matto Marjanovic (maddog@mir.com)
Thu, 14 May 1998 01:49:33 -0400 (EDT)

(a bunch of commentary/review, followed by a patch to the pre0.73 code,
to fix an error crept into microtek.c....)

With regards to the new, smarter configuration code:

a) It would be a good idea if the "attach" function which is passed to
sane_config_attach_matching_devices() took an extra (void *)
argument, to handle any additional data which it may need/return.

b) sane_config_attach_matching_devices() should return something, at
least maybe the results of the called attach function. One might
want to know if it succeeds or not.

c) Might it not be cleaner if the attach_matching_devices code would
simply return a list of appropriate device name strings, then the
backend could go through and do what it wants to each entry?
(This would eliminate (a), (b), and (f).)

d) (Now, speaking from the perspective of the mentally-challenged
Microtek firmware: ) Aside from the Microtek backend needing to
look for at least five different vendor strings (something new
every day), one of these strings is " " [8 spaces, returned
by my very own E6]. The sanei_config2.c code correctly handles
quoted strings, however the code which scans /proc/scsi (which has
no quotes) discards all this 'whitespace'.

e) How about adding the "Type:" from /proc/scsi/scsi as well?
"Scanner" is a good catch-all (except for the HP scanners), and
since the average user has only one scanner, this doesn't hammer
other devices.

(as it stands, only "scsi * * * * *" works for the E6, which just
assaults the entire scsi bus....)

f) A logic glitch: If a user does happen to have multiple scanners of
the same type in his system, the config code will only attach the
first one (after which, the function returns).

-matt m.

Here's the patch to microtek.c: "attach" should have been "attach_scanner"
After this, the distribution works compiles/runs a-ok for me (with Debian 2.0
(frozen), libgtk 1.0.1, etc.)

--- microtek.c-dist Thu May 14 00:07:23 1998
+++ microtek.c Thu May 14 00:07:28 1998
@@ -1990,7 +1990,7 @@
static SANE_Status
attach_one (const char *dev)
{
- attach (dev, 0);
+ attach_scanner (dev, 0);
return SANE_STATUS_GOOD;
}

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