ctypes argument by reference

  • Thread starter bouleetbil (gaetan)
  • Start date
B

bouleetbil (gaetan)

Hi
I try to write a python backend for pamcan-g2, for that I should write a callback for *trans_cb_conv

In python I've write :
trans_cb_event = CFUNCTYPE(ctypes.c_char_p,ctypes.c_void_p,POINTER(ctypes.c_int)
....
def fpm_trans_conv(event,pkg,response):
foo...
response=1
and for call the callback
if trans_init(pm_trans,flags, trans_cb_event(fpm_progress_event), trans_cb_conv(fpm_trans_conv), None) == -1 :
foo...

Into libpacman response is a C int pointer :
....
QUESTION(trans, PM_TRANS_CONV_LOCAL_UPTODATE, local, NULL, NULL, &resp);
....

but resp=0 howto pass response by reference instead by value ?

If you would more informations/code :
the .h is here : http://git.frugalware.org/gitweb/gi...a=blob_plain;f=lib/libpacman/pacman.h;hb=HEAD
the python code here : http://git.frugalware.org/gitweb/gi...y;hb=4abed4ee445f009387a3a51957e231c010c123bb

trans_cb_event line 315
fpm_trans_conv line 676
pacman_trans_init callback 708
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top