[sane-devel] Re: Sane API Suggestion

2003-07-21 Thread Peter Santoro
Thank you all for your input.  I do understand (and expected) the responses I 
got.  I probably should have included some 
sample source code to support and clarify my suggestion.  For those who are 
interested, a summary of some cross language 
issues can be found at http://xarch.tu-graz.ac.at/autocad/lisp/ffis.html.

In any event, having to live with the sane C-API "as is" will not discourage me 
from writing a scheme->sane interface 
layer in the future.  :-)

Peter



[sane-devel] re: Sane API Suggestion

2003-07-20 Thread Peter Santoro
Oops, sorry for the typo in my first paragraph.  Here's my previous post 
with a corrected first paragraph:

The initial version of my application (written in scheme) does not use 
the sane api directly, but utilizes scanimage and scanadf to perform 
scanning.  In a future release, I would like to use the sane api 
directly for better control.

Although I have a number of years of experience programming C/C++/Java, 
I now prefer to use scheme for most of my programming.  After briefly 
looking at the sane api, I noticed that callbacks are sometimes used.  I 
am aware of a number of ways and various ffi libraries to handle 
callbacks from non-C to C, but it sure would be nice if the sane API was 
a little more non-C friendly.  Specifically, when a callback pointer is 
required, why not also require a "user data" void pointer (or perhaps an 
integer id) that would be returned untouched to the callback as a 
parameter?  This would allow non-C languages to interface more easily to 
the sane api.  A thin C interface layer could then use one callback 
dispatcher to handle all C callbacks.  The callback dispatcher could use 
stdarg.h to process the other args or perhaps they could be passed to 
the callback using a count and array.

In the future, I would be happy to contribute a scheme->sane interface 
library to the sane project, but it sure would be nice if the sane api 
was more non-C friendly.


Peter