mmi_get_interface
NAME
mmi_get_interface - Get interface pointer by name
SYNOPSIS
#include "mmi.h"
void * mmi_get_interface (module_t *module, const char *interface_name)
DESCRIPTION
Call the interface callback registered by module.
If the instance did not register a callback, then call the function registered by its parent module.
The definition of an interface is an agreement between clients of the interface and the provider.
If storage is allocated, the interface must define when it is freed.
RETURN VALUES
Returns an interface pointer corresponding to interface_name.
Returns NULL if:
the module does not support the interface,
or, the module and its parent did not register a callback.
ERRORS
USAGE
#include "mmi.h"
#include "pci.h"
// get interface to my PCI bus
PciBusIf*
ME::get_bus(const char *bus_name)
{
module_t *bus = mmi_get_module(bus_name);
PciBusIf *busif = (PciBusIf*) mmi_get_interface(bus, PCI_BUS_INTERFACE);
return busif;
}
SEE ALSO
mmi_register_interface_cb
WARNINGS