iotivity 0.9.0
[platform/upstream/iotivity.git] / service / protocol-plugin / lib / cpluff / doc / reference / c-api / group__cFuncsContext.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>C-Pluff C API: Plug-in context initialization</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 <link href="tabs.css" rel="stylesheet" type="text/css">
6 </head><body>
7 <!-- Generated by Doxygen 1.5.1 -->
8 <div class="tabs">
9   <ul>
10     <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11     <li><a href="modules.html"><span>Modules</span></a></li>
12     <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
13     <li><a href="files.html"><span>Files</span></a></li>
14     <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
15   </ul></div>
16 <h1>Plug-in context initialization<br>
17 <small>
18 [<a class="el" href="group__cFuncs.html">Functions</a>]</small>
19 </h1><hr><a name="_details"></a><h2>Detailed Description</h2>
20 These functions are used to manage plug-in contexts from the main program perspective. 
21 <p>
22 They are not intended to be used by a plug-in runtime. From the main program perspective a plug-in context is a container for installed plug-ins. There can be several plug-in context instances if there are several independent sets of plug-ins. However, different plug-in contexts are not very isolated from each other in practice because the global symbols exported by a plug-in runtime in one context are visible to all plug-ins in all context instances. 
23 <p>
24 <table border="0" cellpadding="0" cellspacing="0">
25 <tr><td></td></tr>
26 <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
27 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsContext.html#g7d239c4fc07cf7d3095a20900444ad62">cp_create_context</a> (<a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> *status)</td></tr>
28
29 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new plug-in context which can be used as a container for plug-ins.  <a href="#g7d239c4fc07cf7d3095a20900444ad62"></a><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsContext.html#g754ff895992fab0aae81a09c727e5868">cp_destroy_context</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx)</td></tr>
31
32 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroys the specified plug-in context and releases the associated resources.  <a href="#g754ff895992fab0aae81a09c727e5868"></a><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsContext.html#g998d8350e64a129101f9da687ff5713b">cp_register_pcollection</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *dir)</td></tr>
34
35 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Registers a plug-in collection with a plug-in context.  <a href="#g998d8350e64a129101f9da687ff5713b"></a><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsContext.html#g59817fdae1aeb28dbc7d3dcfc5568c15">cp_unregister_pcollection</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *dir)</td></tr>
37
38 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregisters a previously registered plug-in collection from a plug-in context.  <a href="#g59817fdae1aeb28dbc7d3dcfc5568c15"></a><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsContext.html#g0473208ccfde69e0c57ec1f2b4789781">cp_unregister_pcollections</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx)</td></tr>
40
41 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregisters all plug-in collections from a plug-in context.  <a href="#g0473208ccfde69e0c57ec1f2b4789781"></a><br></td></tr>
42 </table>
43 <hr><h2>Function Documentation</h2>
44 <a class="anchor" name="g7d239c4fc07cf7d3095a20900444ad62"></a><!-- doxytag: member="cpluff.h::cp_create_context" ref="g7d239c4fc07cf7d3095a20900444ad62" args="(cp_status_t *status)" -->
45 <div class="memitem">
46 <div class="memproto">
47       <table class="memname">
48         <tr>
49           <td class="memname"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a>* cp_create_context           </td>
50           <td>(</td>
51           <td class="paramtype"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> *&nbsp;</td>
52           <td class="paramname"> <em>status</em>          </td>
53           <td>&nbsp;)&nbsp;</td>
54           <td width="100%"></td>
55         </tr>
56       </table>
57 </div>
58 <div class="memdoc">
59
60 <p>
61 Creates a new plug-in context which can be used as a container for plug-ins. 
62 <p>
63 Plug-ins are loaded and installed into a specific context. The main program may have more than one plug-in context but the plug-ins that interact with each other should be placed in the same context. The resources associated with the context are released by calling <a class="el" href="group__cFuncsContext.html#g754ff895992fab0aae81a09c727e5868">cp_destroy_context</a> when the context is not needed anymore. Remaining contexts are automatically destroyed when the plug-in framework is destroyed.<p>
64 <dl compact><dt><b>Parameters:</b></dt><dd>
65   <table border="0" cellspacing="2" cellpadding="0">
66     <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>pointer to the location where status code is to be stored, or NULL </td></tr>
67   </table>
68 </dl>
69 <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created plugin context, or NULL on failure </dd></dl>
70
71 </div>
72 </div><p>
73 <a class="anchor" name="g754ff895992fab0aae81a09c727e5868"></a><!-- doxytag: member="cpluff.h::cp_destroy_context" ref="g754ff895992fab0aae81a09c727e5868" args="(cp_context_t *ctx)" -->
74 <div class="memitem">
75 <div class="memproto">
76       <table class="memname">
77         <tr>
78           <td class="memname">void cp_destroy_context           </td>
79           <td>(</td>
80           <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
81           <td class="paramname"> <em>ctx</em>          </td>
82           <td>&nbsp;)&nbsp;</td>
83           <td width="100%"></td>
84         </tr>
85       </table>
86 </div>
87 <div class="memdoc">
88
89 <p>
90 Destroys the specified plug-in context and releases the associated resources. 
91 <p>
92 Stops and uninstalls all plug-ins in the context. The context must not be accessed after calling this function.<p>
93 <dl compact><dt><b>Parameters:</b></dt><dd>
94   <table border="0" cellspacing="2" cellpadding="0">
95     <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the context to be destroyed </td></tr>
96   </table>
97 </dl>
98
99 </div>
100 </div><p>
101 <a class="anchor" name="g998d8350e64a129101f9da687ff5713b"></a><!-- doxytag: member="cpluff.h::cp_register_pcollection" ref="g998d8350e64a129101f9da687ff5713b" args="(cp_context_t *ctx, const char *dir)" -->
102 <div class="memitem">
103 <div class="memproto">
104       <table class="memname">
105         <tr>
106           <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_register_pcollection           </td>
107           <td>(</td>
108           <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
109           <td class="paramname"> <em>ctx</em>, </td>
110         </tr>
111         <tr>
112           <td class="paramkey"></td>
113           <td></td>
114           <td class="paramtype">const char *&nbsp;</td>
115           <td class="paramname"> <em>dir</em></td><td>&nbsp;</td>
116         </tr>
117         <tr>
118           <td></td>
119           <td>)</td>
120           <td></td><td></td><td width="100%"></td>
121         </tr>
122       </table>
123 </div>
124 <div class="memdoc">
125
126 <p>
127 Registers a plug-in collection with a plug-in context. 
128 <p>
129 A plug-in collection is a directory that has plug-ins as its immediate subdirectories. The plug-in context will scan the directory when <a class="el" href="group__cFuncsPlugin.html#ga9603cd8d153b0ce192ac7b6e56779af">cp_scan_plugins</a> is called. Returns <a class="el" href="group__cEnums.html#ggd6a8106d281ffa4b1f43fe8e3effc7da5ffbe0fe80af75e699e4b04909912f7a">CP_OK</a> if the directory has already been registered. A plug-in collection can be unregistered using <a class="el" href="group__cFuncsContext.html#g59817fdae1aeb28dbc7d3dcfc5568c15">cp_unregister_pcollection</a> or <a class="el" href="group__cFuncsContext.html#g0473208ccfde69e0c57ec1f2b4789781">cp_unregister_pcollections</a>.<p>
130 <dl compact><dt><b>Parameters:</b></dt><dd>
131   <table border="0" cellspacing="2" cellpadding="0">
132     <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
133     <tr><td valign="top"></td><td valign="top"><em>dir</em>&nbsp;</td><td>the directory </td></tr>
134   </table>
135 </dl>
136 <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__cEnums.html#ggd6a8106d281ffa4b1f43fe8e3effc7da5ffbe0fe80af75e699e4b04909912f7a">CP_OK</a> (zero) on success or <a class="el" href="group__cEnums.html#ggd6a8106d281ffa4b1f43fe8e3effc7dac4e31e28c38ba325fa7169da1a233950">CP_ERR_RESOURCE</a> if insufficient memory </dd></dl>
137
138 </div>
139 </div><p>
140 <a class="anchor" name="g59817fdae1aeb28dbc7d3dcfc5568c15"></a><!-- doxytag: member="cpluff.h::cp_unregister_pcollection" ref="g59817fdae1aeb28dbc7d3dcfc5568c15" args="(cp_context_t *ctx, const char *dir)" -->
141 <div class="memitem">
142 <div class="memproto">
143       <table class="memname">
144         <tr>
145           <td class="memname">void cp_unregister_pcollection           </td>
146           <td>(</td>
147           <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
148           <td class="paramname"> <em>ctx</em>, </td>
149         </tr>
150         <tr>
151           <td class="paramkey"></td>
152           <td></td>
153           <td class="paramtype">const char *&nbsp;</td>
154           <td class="paramname"> <em>dir</em></td><td>&nbsp;</td>
155         </tr>
156         <tr>
157           <td></td>
158           <td>)</td>
159           <td></td><td></td><td width="100%"></td>
160         </tr>
161       </table>
162 </div>
163 <div class="memdoc">
164
165 <p>
166 Unregisters a previously registered plug-in collection from a plug-in context. 
167 <p>
168 Plug-ins already loaded from the collection are not affected. Does nothing if the directory has not been registered. Plug-in collections can be registered using <a class="el" href="group__cFuncsContext.html#g998d8350e64a129101f9da687ff5713b">cp_register_pcollection</a>.<p>
169 <dl compact><dt><b>Parameters:</b></dt><dd>
170   <table border="0" cellspacing="2" cellpadding="0">
171     <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
172     <tr><td valign="top"></td><td valign="top"><em>dir</em>&nbsp;</td><td>the previously registered directory </td></tr>
173   </table>
174 </dl>
175
176 </div>
177 </div><p>
178 <a class="anchor" name="g0473208ccfde69e0c57ec1f2b4789781"></a><!-- doxytag: member="cpluff.h::cp_unregister_pcollections" ref="g0473208ccfde69e0c57ec1f2b4789781" args="(cp_context_t *ctx)" -->
179 <div class="memitem">
180 <div class="memproto">
181       <table class="memname">
182         <tr>
183           <td class="memname">void cp_unregister_pcollections           </td>
184           <td>(</td>
185           <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
186           <td class="paramname"> <em>ctx</em>          </td>
187           <td>&nbsp;)&nbsp;</td>
188           <td width="100%"></td>
189         </tr>
190       </table>
191 </div>
192 <div class="memdoc">
193
194 <p>
195 Unregisters all plug-in collections from a plug-in context. 
196 <p>
197 Plug-ins already loaded are not affected. Plug-in collections can be registered using <a class="el" href="group__cFuncsContext.html#g998d8350e64a129101f9da687ff5713b">cp_register_pcollection</a>.<p>
198 <dl compact><dt><b>Parameters:</b></dt><dd>
199   <table border="0" cellspacing="2" cellpadding="0">
200     <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
201   </table>
202 </dl>
203
204 </div>
205 </div><p>
206 <hr size="1">
207 <p class="footer">
208 <a href="http://www.c-pluff.org/">C-Pluff</a>, a plug-in framework for C<br>
209 Copyright 2007 <a href="http://www.jlehtinen.net/">Johannes Lehtinen</a>
210 </p>
211 <p class="generated-by">
212 Generated on Fri Apr 6 15:40:55 2007 for C-Pluff C API by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1
213 </p>
214 </body>
215 </html>