Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <html> |
2 | <head> | |
3 | <title>SPARC Architectural Model: Device and Utility API</title> | |
4 | </head> | |
5 | <body bgcolor="#FFFFFF" LANG="en-US"> | |
6 | ||
7 | <div STYLE="margin-bottom: 0cm"></div> | |
8 | ||
9 | <h2> | |
10 | mmi_register_instance_creator | |
11 | </h2> | |
12 | ||
13 | <h4> | |
14 | NAME</h4> | |
15 | ||
16 | <ul> | |
17 | mmi_register_instance_creator - Register function to instantiate a module | |
18 | </ul> | |
19 | ||
20 | <h4>SYNOPSIS</h4> | |
21 | <tt> | |
22 | <ul><font color="#0000FF">#include "mmi.h"</font> | |
23 | <p>typedef int (*mmi_instance_creator)(const char* module_name, const char* instance_name) | |
24 | <p>mmi_bool_t mmi_register_instance_creator (const char* module_name, mmi_instance_creator creator) | |
25 | </ul> | |
26 | </tt> | |
27 | ||
28 | <h4> | |
29 | DESCRIPTION</h4> | |
30 | ||
31 | <ul><i>mmi_register_instance_creator()</i> registers | |
32 | with SAM the function that is to be called to instantiate a module. | |
33 | The call to <i>mmi_register_instance_creator</i> typically occurs from the | |
34 | <i>_init()</i> function when a shared library | |
35 | is loaded or from an initalization sequence for statically linked libraries. | |
36 | ||
37 | <p> | |
38 | The instance creator function that is registered is called by SAM whenever | |
39 | a new instance of the module is instantiated (for example, upon a <tt>sysconf</tt> directive) | |
40 | ||
41 | <p> | |
42 | <i>module_name</i> is the name of the module, and | |
43 | <i>creator</i> is a pointer to the instance creator function defined within the | |
44 | module. | |
45 | </ul> | |
46 | ||
47 | <h4> | |
48 | RETURN VALUES</h4> | |
49 | ||
50 | <ul><i>mmi_register_instance_creator()</i> returns true when successful | |
51 | and false when there is an error.</ul> | |
52 | ||
53 | <h4>ERRORS</h4> | |
54 | ||
55 | <ul><i>mmi_register_instance_creator()</i> will fail if the module_name is not recognized.</ul> | |
56 | ||
57 | <h4>SEE ALSO</h4> | |
58 | <ul><a href="intro.html">Introduction</a></ul> | |
59 | <ul><a href="mmi_register_instance.html">mmi_register_instance</a></ul> | |
60 | <p> | |
61 | ||
62 | <p> | |
63 | <hr> | |
64 | ||
65 | </body> | |
66 | </html> |