c++ code
namespace Reaper
{
class IReaperFactoryCallback {
public:
virtual ~IReaperFactoryCallback() {};
virtual bool register_reaper(int action, void *handler) = 0;
virtual void unregister_reaper(int action) = 0;
};
}
i want to give IReaperFactoryCallback *cb
to rust, but i don't know how to get it and call register_reaper
function
on c++
bool action_register_callback(IReaperFactoryCallback *cb)
{
return cb->register_reaper(2, (void *)monitor);
}
typedef bool (*action_register_func_t)(IReaperFactoryCallback *cb);
action_register_func_t pf = (action_register_func_t)dlsym(handle, "action_register_callback");
pf(cb);