[sane-devel] SANE2 standard revisited: Code flow

Oliver Rauch oliver.rauch at rauch-domain.de
Mon Dec 9 22:36:22 GMT 2002


On Friday 06 December 2002 20:24, Henning Meier-Geinitz wrote:
> Proposal:
>
> "... However, as options are set, other options may become active or
>  inactive or their constraint may change. Thus, after setting
>  an option, it may be necessary to re-read the descriptors."
>
> | Image data is collected by repeatedly calling sane_read() until this
> | function will return an end-of-file status (SANE_STATUS_EOF). This
> | indicates the end of the current frame.
>
> Is this change of wording intended? The old standard says:
> | Image data is collected by repeatedly calling sane_read(). Eventually,
> | this function will return an end-of-file status (SANE_STATUS_EOF).
> | This indicates the end of the current frame.
>
> I'm not sure but the new versions sound like you must call sane_read()
> until EOF while the old version seems to allow to use the select_fd to
> detect EOF. So with the new version we need to call sane_read to get
> the EOF even if we already know of EOF from the select_fd. Does this
> make sense?
>
> The example pseudo code is nice. I would pipe it through indent -gnu
> or at least use a sonsitant coding style but that's just cosmetics :-)

but this would make the sane_cancel unnecessaryly complex
because you have to call

	sane_cancel
	while (sane_read != SANE_STATUS_EOF);

and wait until sane_read really reutrnes SANE_STATUS_EOF.

I suggest to keep this like it is: no need to call sane_read when
sane_cancel is called!

Oliver

-- 
http://www.xsane.org
http://www.mostang.com/sane
http://www.rauch-domain.de
mailto:Oliver.Rauch at Rauch-Domain.DE



More information about the sane-devel mailing list