C function callbacks
Posted: Thu Jun 12, 2014 7:48 am
I have something very specific I wish to do with a C library's function callbacks. It has an object-like design, and I would like to make the user data pointer I feed to the library be able to take a pointer to a newLISP object.
I used the address function on the object's list of properties, but I cannot find a way to convert it back to a list from the pointer within the function callback for the object. I want to do this so I can provide better integration with newLISP by having the object's function callback call the list of registered user callbacks. Mainly I want do do this so the user of my object layer doesn't need to deal with the pointer directly, and is instead fed the newLISP argument to their callback function.
Any ideas for how I can solve this issue?
I used the address function on the object's list of properties, but I cannot find a way to convert it back to a list from the pointer within the function callback for the object. I want to do this so I can provide better integration with newLISP by having the object's function callback call the list of registered user callbacks. Mainly I want do do this so the user of my object layer doesn't need to deal with the pointer directly, and is instead fed the newLISP argument to their callback function.
Any ideas for how I can solve this issue?