allocating an unsigned int memory buffer for C (swig) struct

N

njuk.njuk

i am using python (via swig) to interface with the comedi (http://
www.comedi.org/) library for some simple data acquisition. a general
category of problems i am having has to do with basic comedi structs
whose members require being set to a pointer of an allocated memory
buffer.

one specific example is the 'insn' struct that has a 'data' member
that should point to a buffer i have previously allocated. the comedi
type is 'lsampl_t*' but underneath this is simply an 'unsigned int*'.

for the life of me, i haven't been able to figure out how to
instantiate a memory buffer of the correct underlying type in python.
whatever i try always fails when i set the struct member.

TypeError: in method 'comedi_insn_struct_data_set', argument 2 of type
'lsampl_t *'

[the underlying swig code seems to be (correctly) checking for an
unsigned int pointer].

aside: i am currently running python v2.4.4 but could upgrade to a 2.5
version.

thanks for any help.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top