Issue 49 in ctypesgen: Structures change type from python readable!

7 views
Skip to first unread message

codesite...@google.com

unread,
Jun 30, 2014, 4:51:34 PM6/30/14
to ctyp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 49 by cool.tes...@gmail.com: Structures change type from python
readable!
http://code.google.com/p/ctypesgen/issues/detail?id=49

Well I took a library called libdlo and produced a wrapper. Here is the
code I ran...

>>> info = dlo_mode_t()
>>> info
<dlo.struct_dlo_mode_s object at 0xb6c4df80>
>>> info = dlo_get_mode(uid)
>>> info
<dlo.LP_struct_dlo_mode_s object at 0xb692d030>

Now the C code is...

dlo_mode_t *mode_info;
info = dlo_get_mode(uid);

I am on Debian 7.0 Wheezy armhf Raspberry Pi, but this doesn't really have
to do with my issue.

So it seems that the structures produced by ctypes is not compatible with
those made by the wrapper!
I tried doing something like
`LP_struct_dlo_mode_s = struct_dlo_mode_s`
Yet it didn't work, It's really hard to jerry-rig this stuff hahaha

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

unread,
Sep 15, 2014, 7:46:04 AM9/15/14
to ctyp...@googlegroups.com

Comment #1 on issue 49 by l...@segv.dk: Structures change type from python
readable!
https://code.google.com/p/ctypesgen/issues/detail?id=49

This is not a bug. In C you create a pointer to the type so the same in
python would be:

info = ctypes.POINTER(dlo_mode_t)
Reply all
Reply to author
Forward
0 new messages