<title>SPARC Architectural Model: Device and Utility API
</title>
<body bgcolor=
"#FFFFFF" LANG=
"en-US">
<div STYLE=
"margin-bottom: 0cm"></div>
mmi_register_instance_creator
mmi_register_instance_creator - Register function to instantiate a module
<ul><font color=
"#0000FF">#include
"mmi.h"</font>
<p>typedef int (*mmi_instance_creator)(const char* module_name, const char* instance_name)
<p>mmi_bool_t mmi_register_instance_creator (const char* module_name, mmi_instance_creator creator)
<ul><i>mmi_register_instance_creator()
</i> registers
with SAM the function that is to be called to instantiate a module.
The call to
<i>mmi_register_instance_creator
</i> typically occurs from the
<i>_init()
</i> function when a shared library
is loaded or from an initalization sequence for statically linked libraries.
The instance creator function that is registered is called by SAM whenever
a new instance of the module is instantiated (for example, upon a
<tt>sysconf
</tt> directive)
<i>module_name
</i> is the name of the module, and
<i>creator
</i> is a pointer to the instance creator function defined within the
<ul><i>mmi_register_instance_creator()
</i> returns true when successful
and false when there is an error.
</ul>
<ul><i>mmi_register_instance_creator()
</i> will fail if the module_name is not recognized.
</ul>
<ul><a href=
"intro.html">Introduction
</a></ul>
<ul><a href=
"mmi_register_instance.html">mmi_register_instance
</a></ul>