Re: ctypes - swig - pointer



On Mon, 30 Jun 2008 09:13:42 -0700 (PDT), gianluca <geonomica@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
.



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: Help with PAM and ctypes
    ... addr is the memory address as a Python integer. ... the preferred way to create a NULL pointer in ctypes is to call the pointer type without an argument: ... My initial attempt to fix this involved wrapping strdup to allocate a ... copy of a string to send back to PAM. ...
    (comp.lang.python)