FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveLinux / FiveDroid (Android) [x]sane interface and typdef struct etc
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
[x]sane interface and typdef struct etc
Posted: Mon May 03, 2010 12:55 PM

Hi Antonio and others

I want to write an [x]sane interface. sane_get_devices() should give me a NULL terminated array of pointers to SANE_Device structures which I believe look like this:

typedef struct
{
SANE_String_Const name; / unique device name /
SANE_String_Const vendor; / device vendor string /
SANE_String_Const model; / device model name /
SANE_String_Const type; / device type (e.g., "flatbed scanner") /
}
SANE_Device;

which in reality means:

typedef struct
{
const char name; / unique device name /
const char
vendor; / device vendor string /
const char model; / device model name /
const char
type; / device type (e.g., "flatbed scanner") /
}
SANE_Device;

My questions relate to the best way of returning this information to [x]Harbour.

1). Should I use a typedef struct in [x]Harbour?

2). If so how do I declare members of type char * ?

3). Then do I return an array of pointers to [x]Harbour and use the C Structure Class to examine the various devices?

Is the above viable, or should I take an alternative approach?

Regards
Doug

Continue the discussion