title: Ctypes Multiple Function callback
body: <p>I am facing an issue with registering multiple callbacks with ctypes to interact with my C library. </p>
  
  <p>I am using two different types of <code>CFUNCTYPE</code> objects to register two distinct callbacks at the same time with different API's, but my library gets the same function pointer in both of the API's, and consequently one callback is called twice. </p>
  
  <p>I am trying to do something like below:</p>
  
  <pre><code>callback_type_1 = ctypes.CFUNCTYPE(ctypes.c_int, 
                                     ctypes.c_int, 
                                     ctypes.c_void_p, 
                                     ctypes.c_int,
                                     ctypes.c_void_p, 
                                     ctypes.c_void_p, 
                                     ctypes.c_int)
  
  callback_type_2 = ctypes.CFUNCTYPE(None, 
                                     ctypes.c_int, 
                                     ctypes.c_void_p, 
                                     ctypes.c_int, 
                                     ctypes.c_int,
                                     ctypes.c_void_p, 
                                     ctypes.c_int, 
                                     ctypes.c_void_p)
  
  classify_callback_ptr_1 = callback_type_1(callback_1)
  _lib.api_1(ctypes.c_int(handle),  classify_callback_ptr_1)
  
  classify_callback_ptr_2 = callback_type_2(callback_2) 
  _lib.api_2(ctypes.c_int(handle), classify_callback_ptr_2)
  </code></pre>
  
  <p>If I print the function pointer inside api_1 and api_2, I get the same pointer value. </p>
  
  <p>Does ctypes just allow one callback to be registered at a time ? Or is there anything else that I'm missing.</p>