By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,258 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,258 IT Pros & Developers. It's quick & easy.

ctypes & Wrapping Complex Datatypes

P: n/a
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?

Oct 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 16 Oct 2007 06:47:06 -0700, gamename wrote:
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
Oct 16 '07 #2

P: n/a
On Oct 16, 6:52 am, Marc 'BlackJack' Rintsch <bj_...@gmx.netwrote:
On Tue, 16 Oct 2007 06:47:06 -0700, gamename wrote:
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
OK. Thanks.
-T

Oct 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.