ctypes question about call by reference

Lawrence Oluyede rhymes at myself.com
Sun Sep 24 14:49:18 EDT 2006


Oliver Andrich <oliver.andrich at gmail.com> wrote:
> Well, what I learned so far from the documentation, which I already
> have read more then once today, is that there is no example for an
> enum in this situation. But looking at pygame-sdl and another project,
> it looks like the enum is just an c_int or c_long.

The documentation explains how to build an enum to pass to a function:
http://docs.python.org/lib/ctypes-structures-unions.html

See the first sentence.

class ExceptionType(Union):
    _fields_ = [list_of_tuples]

> Is it at all possbile to use a struct without defining it with ctypes?

If you want to use it you have to define it somewhere...

> Is it okay, to just use the int which is returned by default? Most of
> my library works with that configuration, so I thought it is working.

I see your functions returns a "char *" so I don't understand what are
you saying here...

> Based on this, can you give me some more hints?

It's not really clear :-)

-- 
Lawrence - http://www.oluyede.org/blog
"Nothing is more dangerous than an idea
if it's the only one you have" - E. A. Chartier



More information about the Python-list mailing list