typedef void * (*fn_interface_cb) ( void * cb_data, const char *interface_name);
bool_t mmi_register_interface_cb (module_t *module, fn_interface_cb fn);
// return pointer to interface void * Schizo::get_interface(const char *name) { if (!strcmp(name, SCHIZO_INTERFACE)) return this; if (!strcmp(name, PCI_BUS_INTERFACE)) return (PciBusIf*)this; if (!strcmp(name, PCI_DEV_INTERFACE)) return (PciDevIf*)this; return NULL; } static void *schizo_get_interface(void *cb_data, const char *name) { Schizo *schizo = (Schizo *) cb_data; return schizo->get_interface(name); } void Schizo::register_interface_callback(module_t *instance) { mmi_register_cb_data(instance, this); mmi_register_interface_cb(instance, schizo_get_interface); }