[ctypes-users] Regarding external binding of functions
Brought to you by:
theller
From: muhammad w. s. <was...@gm...> - 2013-12-12 06:44:11
|
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 |