LoadLibrary and extern ctype
bouleetbil bouleetbil
bouleetbil at gmail.com
Thu Dec 15 15:36:07 EST 2011
Hi,
I've a little problem for define this :
extern enum __pmerrno_t {
PM_ERR_MEMORY = 1,
PM_ERR_SYSTEM,
....
PM_ERR_WRONG_ARCH
} pm_errno;
I've write :
pacman=cdll.LoadLibrary("libpacman.so")
...
#errors
( PM_ERR_MEMORY ,
PM_ERR_SYSTEM,
...
PM_ERR_WRONG_ARCH )=map(ctypes.c_int, xrange(1,63))
I would use pacman.pm_errno. That should be a integer but if I print the
value it I've :
<_FuncPtr object at 0xb73ce984>
Howto find the value (or define ) pacman.pm_errno ?
The complete code can be find here :
http://dors.frugalware.org/tmpgit/frugal-tweak/py-pacman/py-pacman.py
and the .h is here
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=blob_plain;f=lib/libpacman/pacman.h;h=0f2a191681085dee99f485bad43a620043528904;hb=HEAD
--
#---------------------------------------------------------------------------
# Bouleetbil
#
#---------------------------------------------------------------------------
# _ _
# (o)--(o)
# /.______.\
# \_______/
# ./ \.
# ( . , )
# \ \_\\//_/ /
# ~~ ~~ ~~
#---------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111215/f9b5b3d4/attachment-0001.html>
More information about the Python-list
mailing list