[x]sane interface and typdef struct etc

[x]sane interface and typdef struct etc

Postby xProgrammer » 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
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Return to FiveLinux / FiveDroid (Android)

Who is online

Users browsing this forum: No registered users and 2 guests