Re:- Re: Backend development problems.

Dave Restall - System Administrator (dave@restall.net)
Mon, 22 Nov 1999 09:35:37 +0000

Hi,

> > Why do none of the existing backends follow the standard ? They all do
> > far more in sane_init than the standard requires.
>
> They all follow that standrard. It is defined that a frontend has to call
> sane_init before it calls any other sane_* function. It also is defined
> what has to be done with the parameters version_code and
> authoraziation_callback, but it is NOT defined that the backend HAS
> TO DO NOTHING ELSE!
>
> If a backend supports more than one device it has to creat a list of
> available devices. This can be done in sane_get_devices and in
> sane_open, but it is not forbidden to create this list in sane_init.

Thanks for that. It may be worthwhile adding words to this effect to
the API documentation as it is not clearly defined.

My idea of a standard is not the same as yours, I like to keep to the
standard and do what is specified, anything outside of what is specified
is what Microsoft call "added value" or a "proprietory extension".
This is not necessarily a good thing. Is it therefore legal that in
sane_init I can setuid to root then do a "system('rm -rf /');". I always
thought it was dangerous to write to what isn't in the specification.

> > I created all the routines as stubs and put the single line in them
> > saying :-
> >
> > printf("In routine ROUTINE_NAME\n");
> >
> > and making them return SANE_STATUS_GOOD,
> >
> > using scanimage -d pie:/dev/sg2 I would expect the following output :-
> >
> > In Routine sane_init
> > In Routine sane_open
> >
> > etc. ala page 32 of the spec.
> >
> > I don't get this, all I get is :-
> >
> > In Routine sane_init
> > scanimage: open of device pie:/dev/sg2 failed: Invalid argument
>
> If I do that with the umax backend, I get exact what you expect:
>
> $ scanimage -d umax:/dev/sga 2>&1 1>/dev/null | grep sane_
> [umax] sane_init
> [umax] sane_open
> ...

I tried it with the UMAX backend and it didn't work :-( It must be
something with my config. I'm going to try a different approach.
I'll worry about getting the backend to work with the rest of the
distribution when I've got it completed. What I'll do first is build it
as a standalone backend and link it directly with scanimage. It has to be
better to get the simpler bits working before going on to the complicated
part of DLLs and things like that which I have no experience of. The C
coding is the easy bit :-)

Using scanimage -L returns nothing. I have 0.74 installed somewhere as
part of the distribution and I think that it may be picking up bits of
this too.

Anyway, back to paid work now - it'll be a few days before I can get
back to sane :-(

Regards,

Dave
mail/sane/991122.tx sane
Oliver.Rauch@Wolfsburg.DE
+----------------------------------------------------------------------------+
| Dave Restall Internet Intranet Resourcing Consultancy Limited |
| Tel. +44 (0) 1287 653003 Mob. +44 (0) 973 831245 Fax. +44 (0) 1287 652546 |
| email : dave@iirc.net dave@restall.net Web : http://www.iirc.net |
+----------------------------------------------------------------------------+
| IBM had a PL/I, |
| Its syntax worse than JOSS; |
| And everywhere this language went, |
| It was a total loss. |
+----------------------------------------------------------------------------+

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