ctypes & Wrapping Complex Datatypes

G

gamename

Hi,

I've just started using ctypes and so far, its great. But I'm running
to some problems with complex datatypes. I'm not sure how to wrap
something like this:

/* This defines the Handle type in a header file. I don't think
this needs wrapping, its just to show the handle definition for
context*/
typedef struct DFFTSHandle_s *DFFTSHANDLE;
....
/* Then, the handle is used like this later on. This *is* what I
want to wrap.*/
status = DFFTSCreateSession(&Handle);
status = DFFTSSetSessionOption(Handle, DFFTSOPT_ITERATIONS,
&iteration, sizeof(iteration));


Any ideas?
 
M

Marc 'BlackJack' Rintsch

I've just started using ctypes and so far, its great. But I'm running
to some problems with complex datatypes. I'm not sure how to wrap
something like this:

/* This defines the Handle type in a header file. I don't think
this needs wrapping, its just to show the handle definition for
context*/
typedef struct DFFTSHandle_s *DFFTSHANDLE;
...
/* Then, the handle is used like this later on. This *is* what I
want to wrap.*/
status = DFFTSCreateSession(&Handle);
status = DFFTSSetSessionOption(Handle, DFFTSOPT_ITERATIONS,
&iteration, sizeof(iteration));

If this "handle" is always just treated as a pointer to an opaque data
structure you may just use a void pointer.

Ciao,
Marc 'BlackJack' Rintsch
 
G

gamename

If this "handle" is always just treated as a pointer to an opaque data
structure you may just use a void pointer.

Ciao,
Marc 'BlackJack' Rintsch

OK. Thanks.
-T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top