Re: ctypes & Wrapping Complex Datatypes



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
.



Relevant Pages

  • Re: ctypes & Wrapping Complex Datatypes
    ... I'm not sure how to wrap ... this needs wrapping, its just to show the handle definition for ... typedef struct DFFTSHandle_s *DFFTSHANDLE; ... structure you may just use a void pointer. ...
    (comp.lang.python)
  • Re: Accessing different structures via pointer
    ... void pointer. ... There may be something you could do with a union approach, but it would still need a switch. ... I think I'd look at a different data structure. ...
    (comp.lang.c)
  • typedef struct union question
    ... I am programming in MS Flight Simulator environment. ... header file called gauges.h in my C code. ... typedef struct that has some system variables that I would like to use in my ...
    (microsoft.public.vc.language)
  • struct & enum & :: visibility operator
    ... I have a header file like this: ... typedef struct _S S; ... I'm using the Microsoft 2005 environment and so its compiler. ...
    (microsoft.public.vc.language)
  • Minifilter driver problem with minifilters struct error C2039
    ... In the inc folder there is a header file named drv.h. ... In the drv folder there is the main driver source file, ...
    (microsoft.public.development.device.drivers)