Re: May sane_init fail?

Petter Reinholdtsen (pere@hungry.com)
Wed, 28 Apr 1999 00:16:39 +0200

[Graham Stoney]
> After a quick look at the 1.01-pre4 sources, the DC210 backend can
> also return SANE_STATUS_INVAL. There may be others...

After reading dc210.c, I seriously beleave that the tests returning
SANE_STATUS_INVAL from sane_init() should be moved to sane_open().

I beleave a backend should not connect to the device until sane_open()
is called. The DC210 backend opens the serial device, and extract
camera info in sane_init().

Anyway. I'm now writing a patch to sane 1.0.1 with my suggested
change. I suggest three valid responses from sane_init():

SANE_STATUS_GOOD - Success
SANE_STATUS_NO_MEM - Ran out of memory
SANE_STATUS_UNSUPPORTED - Not supported on this machines current
configuration

Would there be need for more return values?

-- 
##>  Petter Reinholdtsen <##    | pere@td.org.uit.no
 O-  <SCRIPT Language="Javascript">window.close()</SCRIPT>
http://www.hungry.com/~pere/    | Go Mozilla, go! Go!

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