[sane-devel] SANE2 standard completion

m. allan noah kitno455 at gmail.com
Sun Apr 6 19:16:44 UTC 2008


On 3/28/08, Rene Rebe <rene at exactcode.de> wrote:
> > >       But before starting, there are some things I'd like to see in the
> new standard:
> > >       - the current code flow is
> > >       sane_init
> > >               sane_open
> > >                       sane_start
> > >                               sane_read
> > >                       sane_cancel
> > >               sane_close
> > >       sane_exit
> > >
> > >               rather than calling sane_cancel at the end of scan, I'd
> like to have a sane_end function. Leaving the use of sane_cancel for
> canceling the scan like it allready does. This new function would do about
> the same, but code flow would be cleaner and easier to understand:
> > >       sane_init
> > >               sane_open
> > >                       sane_start
> > >                               sane_read
> > >                       sane_end
> > >               sane_close
> > >       sane_exit
> > >
> > >
> >
> > this is a simple, single scan case. can you draw up what you think an
> > ADF or duplex scan would look like? right now, it does sane_start,
> > sane_read, sane_start, sane_read, sane_start, sane_read,
> >
>
>  I do not see a problem in this call graph. Sure, we could leave the
>  cancel (or rename it to _end :-), however existing codebase like
>  frontends (applications) have deal with the current API and
>  backends (drivers) anyway. This is what I mean when I declare
>  unnecessary work. The gain is just a little nicer callgraph on
>  the paper.
>

actually, i have some code in my private version of fujitsu backend
now, to try and make sane_cancel work properly. and i can say that
stef is right that separating the 'cancel' from 'dont want more
images' would be very nice for ADF programming. without it, i have to
replicate some measure of the 'EOF' sending code into the cancelling
code, so that it can tell if it needs to actually stop the scanner, or
just not start again.

gentlement (and ladies if there are any), i am in favor of starting a
new sane2 draft, with soversion bump.

allan

-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list