For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > September 2004 > SANE question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SANE question
Paul F. Johnson

2004-09-18, 8:56 pm

Hi,

I'm trying to implement using SANE within Scribus and I'm hitting a small
snag. While the majority of the API is really simple to use, I'm having a
problem with what SANE_Handle is.

The sane.h header has it defined as

typedef void *SANE_Handle;

There are plenty of functions which require SANE_Handle, but nothing which
actually sets it!

According to the sane website, SANE does not require that a value of this
type be a legal pointer value and an application shouldn't attempt to
interpret the value of SANE_Handle.

This doesn't make sense - it looks like I can quite happily send "flibble"
as the handle and it makes no difference (okay, I know that's not the
case...).

How should I set the handle. For instance, when I obtain the device list,
I have two show for my USB webcam and one for my scanner. I have to be
able to set the handle to the scanner. Is it enough to set the handle to
the device name or should it be set to the physical /dev/sg0 value (which
is not a good idea!)

TTFN

Paul

--
"There are four stages to any war
First they ignore you, then they laugh at you
Then they fight you, then YOU win."
Ghandi

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com