I am currently facing a problem with ctypes. I have a C function foo such that:
void** foo(int);
I have to define a callback function for the foo function. So:
FOO_FUNC = CFUNCTYPE(POINTER(c_void_p), c_int)
foo_c = lib.foo
foo.argtypes = [c_int]
foo.restype = POINTER(c_void_p)
Unfortunately, while calling a function taking this callback function as argument, it gives the error:
TypeError: invalid result type for callback function
I can't see the problem... Can anyone help me? Thanks