[Dar-libdar_api] callback function context value
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Johnathan B. <jk...@us...> - 2004-04-27 15:59:25
|
Hi Denis, Apparently it is standard coding practice for API callback functions to=20 accept a "context value", which is a void *, that allows one to use a=20 class member function as a callback without resorting to a global pointer=20 variable. As I understand dar, it uses a regular function as the callback. Could you= =20 add perhaps a new set of callback setting functions to the libdar API that= =20 accept a void * context value to be passed. It would be easy to keep=20 backwards compatibility with earlier libdar versions by redefining the=20 standard callback setting functions to call the new ones with NULL for the= =20 void *. There is a good tutorial at http://www.function-pointer.org/callback.html #3: How to Implement Callbacks in C and C++ In the examples given, I currently use method B, but it would be better to= =20 use method A to avoid using the global variable. Cheers, JB =2D-=20 Johnathan K. Burchill, Ph.D. jk...@us... |