[sane-devel] sane_strstatus

Oliver Schwartz Oliver.Schwartz@gmx.de
Sun, 21 Apr 2002 12:40:26 +0200


Hi,

> > I'd like to add some better error messages to the snapscan backend. If I
> > understand the current SANE standard correctly, the backend can supply an
> > error string for a given status code by an implementation of
> > sane_strstatus().
> >
> > However, trying to implement sane_strstatus myself results in a linker
> > error as all backends are linked against sane_strstatus.c by default.
>
> sane_strstatus is not a backend function, it is a function
> that is linked to every library. You can not implement it
> in your backend.

Fair enough. However, I believe that there should be a possibility for a 
backend to provide some detailed error message to a frontend. If this is not 
possible via sane_strstatus we should think of other ways for SANE-2.

What I had in mind for my own implementation is an additional function 
set_error_descr(SANE_Status, SANE_String) which would be called from the 
backend prior to returning an error code. sane_strstatus would either return 
the string set by set_error_descr() if called with a matching SANE_Status or 
a default error string. Such an extension could also be built into the 
existing library function sane_strstatus without changing the interface.

Regards,

Oliver