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
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