Regarding external binding of functions

muhammad waseem sarwar <[email protected]> Wed, 11 Dec 2013 22:44:05 -0800
Newsgroups gmane.comp.python.ctypes
Message-ID <CAECqTqQFOHmXhrs_CuxSM_+n13FOcm2AFMqh2U_Yo=Fep72DoQ@mail.gmail.com>
Hi,

I am new to ctypes and I have a questions regarding external binding
of function using ctypes. The question is as follows,

Q. I have a simple library that uses function pointer of
hello_printf(const char *format, ...) in one of its API. While using
this library in C, I point the function pointer of hello_printf to
printf and code works seamlessly.
hello_printf is not the API but is used in the implementation of one
of the API's. The reason for this is that I want external application
using the library to provide implementation of printf to provide
flexibility and is common practice in C/C++.

I want to know that how I can achieve this external binding of
function pointer using ctypes i.e. point hello_printf() to printf in
python so on calling the API, it gets the right printf implementation.

I am not sure if I explained it well and I can post the code if there
is ambiguity in question.

Help would be highly appreciated and thanks in advance.

Regards,
Waseem

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk