[sane-devel] SANE2 standard revisited: Code flow
Mon, 9 Dec 2002 23:36:22 +0100
On Friday 06 December 2002 20:24, Henning Meier-Geinitz wrote:
> "... 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
=09while (sane_read !=3D 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!