Re: ctypes - swig - pointer



On 30 Giu, 18:26, Jean-Paul Calderone <exar...@xxxxxxxxxx> wrote:
On Mon, 30 Jun 2008 09:13:42 -0700 (PDT), gianluca <geonom...@xxxxxxxxx> wrote:
I've a problem with dll function colled with python/ctypes. My
functions (C) requred a typedef int "value_type" in tree different
way:
same as value_type; - mydll.foo1(value_type)
same as *value_type; - mydll.foo2(*value_type)
same as **value_type; - mydll.foo3(**value_type)

How can pass it in python. If i do that:
rules=POINTER(value_type)
opr=rsl.StrengthOfRules(rules,10)
R=POINTER(rules)

POINTER takes a class and returns a new class which represents a pointer
to input class.

pointer takes an instance and returns a new object which represents a
pointer to that instance.

Jean-Paul

so,
if I write this:
p=pointer(value_type)
mydll.foo1(p)
could be correct but python say me:
TypeError: _type_ must have storage info
what does mean?

thank you

gima
.



Relevant Pages

  • Re: hacker challenge - traverse a list
    ... Here is a little challenge - print the contents of a binary tree ... I assume there are no up links, otherwise the algorithm is trivial. ... space hence unbounded number of bits in a pointer? ... Left branch *not* leaf, rotate: ...
    (comp.programming)
  • Re: question of style
    ... end of the day the quality of the code depends more on the quality of ... or the equivalent null pointer exceptions in Java, C, or whatever? ... But you have implemented a mutable tree. ...     def get: ...
    (comp.lang.python)
  • Re: Help me come up with a few and simple programming challenges
    ... >Dave Vandervies wrote: ... >> language, I'd probably pass around a pointer to the list's head pointer ... >(define (sublist tree lo hi) ...
    (comp.lang.scheme)
  • Re: Reading XML stream using unmanaged c++
    ... You don't need a back pointer to implement tree structures. ... but a back pointer is a handy thing to have when using a DOM node. ... XML is metadata, but an XML document is an XML metadata structure with actual data ...
    (microsoft.public.vc.mfc)
  • Re: hacker challenge - traverse a list
    ... void deleteEl; ... mangle and print the binary tree, then demangle it back to its ... node * tmptop = treetop; ... The basic idea is to convert the right pointer into a directly ordered ...
    (comp.programming)