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 management</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 <link href="tabs.css" rel="stylesheet" type="text/css">
7 <!-- Generated by Doxygen 1.5.1 -->
10 <li><a href="index.html"><span>Main Page</span></a></li>
11 <li><a href="modules.html"><span>Modules</span></a></li>
12 <li><a href="annotated.html"><span>Data Structures</span></a></li>
13 <li><a href="files.html"><span>Files</span></a></li>
14 <li><a href="pages.html"><span>Related Pages</span></a></li>
16 <h1>Plug-in management<br>
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 can be used to manage plug-ins.
22 They are intended to be used by the main program.
24 <table border="0" cellpadding="0" cellspacing="0">
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="structcp__plugin__info__t.html">cp_plugin_info_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#gcb92588ad3b48dab5e9487698f6ef437">cp_load_plugin_descriptor</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *path, <a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> *status)</td></tr>
29 <tr><td class="mdescLeft"> </td><td class="mdescRight">Loads a plug-in descriptor from the specified plug-in installation path and returns information about the plug-in. <a href="#gcb92588ad3b48dab5e9487698f6ef437"></a><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#gc862fd9be2bad2e0dfaafa6216ad34d4">cp_install_plugin</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, <a class="el" href="structcp__plugin__info__t.html">cp_plugin_info_t</a> *pi)</td></tr>
32 <tr><td class="mdescLeft"> </td><td class="mdescRight">Installs the plug-in described by the specified plug-in information structure to the specified plug-in context. <a href="#gc862fd9be2bad2e0dfaafa6216ad34d4"></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> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#ga9603cd8d153b0ce192ac7b6e56779af">cp_scan_plugins</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, int flags)</td></tr>
35 <tr><td class="mdescLeft"> </td><td class="mdescRight">Scans for plug-ins in the registered plug-in directories, installing new plug-ins and upgrading installed plug-ins. <a href="#ga9603cd8d153b0ce192ac7b6e56779af"></a><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#g2456b7740351c2530376ffb3a5ab7d92">cp_start_plugin</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *id)</td></tr>
38 <tr><td class="mdescLeft"> </td><td class="mdescRight">Starts a plug-in. <a href="#g2456b7740351c2530376ffb3a5ab7d92"></a><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#g7bdc861d480c6c9addafbb0f481323fa">cp_stop_plugin</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *id)</td></tr>
41 <tr><td class="mdescLeft"> </td><td class="mdescRight">Stops a plug-in. <a href="#g7bdc861d480c6c9addafbb0f481323fa"></a><br></td></tr>
42 <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#g4dec7d61518adfa01da3f2892eaea20a">cp_stop_plugins</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx)</td></tr>
44 <tr><td class="mdescLeft"> </td><td class="mdescRight">Stops all active plug-ins. <a href="#g4dec7d61518adfa01da3f2892eaea20a"></a><br></td></tr>
45 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#g2249552dc67bb7893f81babee4a27454">cp_uninstall_plugin</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *id)</td></tr>
47 <tr><td class="mdescLeft"> </td><td class="mdescRight">Uninstalls the specified plug-in. <a href="#g2249552dc67bb7893f81babee4a27454"></a><br></td></tr>
48 <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsPlugin.html#g01a607d9ae7f9fdb7e91a1845b0e5e99">cp_uninstall_plugins</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx)</td></tr>
50 <tr><td class="mdescLeft"> </td><td class="mdescRight">Uninstalls all plug-ins. <a href="#g01a607d9ae7f9fdb7e91a1845b0e5e99"></a><br></td></tr>
52 <hr><h2>Function Documentation</h2>
53 <a class="anchor" name="gcb92588ad3b48dab5e9487698f6ef437"></a><!-- doxytag: member="cpluff.h::cp_load_plugin_descriptor" ref="gcb92588ad3b48dab5e9487698f6ef437" args="(cp_context_t *ctx, const char *path, cp_status_t *status)" -->
55 <div class="memproto">
56 <table class="memname">
58 <td class="memname"><a class="el" href="structcp__plugin__info__t.html">cp_plugin_info_t</a>* cp_load_plugin_descriptor </td>
60 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
61 <td class="paramname"> <em>ctx</em>, </td>
64 <td class="paramkey"></td>
66 <td class="paramtype">const char * </td>
67 <td class="paramname"> <em>path</em>, </td>
70 <td class="paramkey"></td>
72 <td class="paramtype"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> * </td>
73 <td class="paramname"> <em>status</em></td><td> </td>
78 <td></td><td></td><td width="100%"></td>
85 Loads a plug-in descriptor from the specified plug-in installation path and returns information about the plug-in.
87 The plug-in descriptor is validated during loading. Possible loading errors are reported via the specified plug-in context. The plug-in is not installed to the context. If operation fails or the descriptor is invalid then NULL is returned. The caller must release the returned information by calling cp_release_plugin_info when it does not need the information anymore, typically after installing the plug-in. The returned plug-in information must not be modified.<p>
88 <dl compact><dt><b>Parameters:</b></dt><dd>
89 <table border="0" cellspacing="2" cellpadding="0">
90 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
91 <tr><td valign="top"></td><td valign="top"><em>path</em> </td><td>the installation path of the plug-in </td></tr>
92 <tr><td valign="top"></td><td valign="top"><em>status</em> </td><td>a pointer to the location where status code is to be stored, or NULL </td></tr>
95 <dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to the information structure or NULL if error occurs </dd></dl>
99 <a class="anchor" name="gc862fd9be2bad2e0dfaafa6216ad34d4"></a><!-- doxytag: member="cpluff.h::cp_install_plugin" ref="gc862fd9be2bad2e0dfaafa6216ad34d4" args="(cp_context_t *ctx, cp_plugin_info_t *pi)" -->
100 <div class="memitem">
101 <div class="memproto">
102 <table class="memname">
104 <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_install_plugin </td>
106 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
107 <td class="paramname"> <em>ctx</em>, </td>
110 <td class="paramkey"></td>
112 <td class="paramtype"><a class="el" href="structcp__plugin__info__t.html">cp_plugin_info_t</a> * </td>
113 <td class="paramname"> <em>pi</em></td><td> </td>
118 <td></td><td></td><td width="100%"></td>
125 Installs the plug-in described by the specified plug-in information structure to the specified plug-in context.
127 The plug-in information must have been loaded using <a class="el" href="group__cFuncsPlugin.html#gcb92588ad3b48dab5e9487698f6ef437">cp_load_plugin_descriptor</a> with the same plug-in context. The installation fails on <a class="el" href="group__cEnums.html#ggd6a8106d281ffa4b1f43fe8e3effc7dab07cfdc96a5dbc3a3e359bae2534c9d2">CP_ERR_CONFLICT</a> if the context already has an installed plug-in with the same plug-in identifier. Installation also fails if the plug-in tries to install an extension point which conflicts with an already installed extension point. The plug-in information must not be modified but it is safe to call cp_release_plugin_info after the plug-in has been installed.<p>
128 <dl compact><dt><b>Parameters:</b></dt><dd>
129 <table border="0" cellspacing="2" cellpadding="0">
130 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
131 <tr><td valign="top"></td><td valign="top"><em>pi</em> </td><td>plug-in information structure </td></tr>
134 <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 an error code on failure </dd></dl>
138 <a class="anchor" name="ga9603cd8d153b0ce192ac7b6e56779af"></a><!-- doxytag: member="cpluff.h::cp_scan_plugins" ref="ga9603cd8d153b0ce192ac7b6e56779af" args="(cp_context_t *ctx, int flags)" -->
139 <div class="memitem">
140 <div class="memproto">
141 <table class="memname">
143 <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_scan_plugins </td>
145 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
146 <td class="paramname"> <em>ctx</em>, </td>
149 <td class="paramkey"></td>
151 <td class="paramtype">int </td>
152 <td class="paramname"> <em>flags</em></td><td> </td>
157 <td></td><td></td><td width="100%"></td>
164 Scans for plug-ins in the registered plug-in directories, installing new plug-ins and upgrading installed plug-ins.
166 This function can be used to initially load the plug-ins and to later rescan for new plug-ins.<p>
167 When several versions of the same plug-in is available the most recent version will be installed. The upgrade behavior depends on the specified <a class="el" href="group__cScanFlags.html">flags</a>. If <a class="el" href="group__cScanFlags.html#g1d4b72334d60f1401e6616da54e4d6f1">CP_SP_UPGRADE</a> is set then upgrades to installed plug-ins are allowed. The old version is unloaded and the new version installed instead. If <a class="el" href="group__cScanFlags.html#g72cdcd1181d60fd3caf5d0e0dd59c33c">CP_SP_STOP_ALL_ON_UPGRADE</a> is set then all active plug-ins are stopped if any plug-ins are to be upgraded. If <a class="el" href="group__cScanFlags.html#gb5996fbc57c7ec3bb538bc80a3ebfc40">CP_SP_STOP_ALL_ON_INSTALL</a> is set then all active plug-ins are stopped if any plug-ins are to be installed or upgraded. Finally, if <a class="el" href="group__cScanFlags.html#g7ca04507561932ae293e81c3636768b7">CP_SP_RESTART_ACTIVE</a> is set all currently active plug-ins will be restarted after the changes (if they were stopped).<p>
168 When removing plug-in files from the plug-in directories, the plug-ins to be removed must be first unloaded. Therefore this function does not check for removed plug-ins.<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> </td><td>the plug-in context </td></tr>
172 <tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>the bitmask of flags </td></tr>
175 <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 an error code on failure </dd></dl>
179 <a class="anchor" name="g2456b7740351c2530376ffb3a5ab7d92"></a><!-- doxytag: member="cpluff.h::cp_start_plugin" ref="g2456b7740351c2530376ffb3a5ab7d92" args="(cp_context_t *ctx, const char *id)" -->
180 <div class="memitem">
181 <div class="memproto">
182 <table class="memname">
184 <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_start_plugin </td>
186 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
187 <td class="paramname"> <em>ctx</em>, </td>
190 <td class="paramkey"></td>
192 <td class="paramtype">const char * </td>
193 <td class="paramname"> <em>id</em></td><td> </td>
198 <td></td><td></td><td width="100%"></td>
207 Also starts any imported plug-ins. If the plug-in is already starting then this function blocks until the plug-in has started or failed to start. If the plug-in is already active then this function returns immediately. If the plug-in is stopping then this function blocks until the plug-in has stopped and then starts the plug-in.<p>
208 <dl compact><dt><b>Parameters:</b></dt><dd>
209 <table border="0" cellspacing="2" cellpadding="0">
210 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
211 <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>identifier of the plug-in to be started </td></tr>
214 <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 an error code on failure </dd></dl>
218 <a class="anchor" name="g7bdc861d480c6c9addafbb0f481323fa"></a><!-- doxytag: member="cpluff.h::cp_stop_plugin" ref="g7bdc861d480c6c9addafbb0f481323fa" args="(cp_context_t *ctx, const char *id)" -->
219 <div class="memitem">
220 <div class="memproto">
221 <table class="memname">
223 <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_stop_plugin </td>
225 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
226 <td class="paramname"> <em>ctx</em>, </td>
229 <td class="paramkey"></td>
231 <td class="paramtype">const char * </td>
232 <td class="paramname"> <em>id</em></td><td> </td>
237 <td></td><td></td><td width="100%"></td>
246 First stops any dependent plug-ins that are currently active. Then stops the specified plug-in. If the plug-in is already stopping then this function blocks until the plug-in has stopped. If the plug-in is already stopped then this function returns immediately. If the plug-in is starting then this function blocks until the plug-in has started (or failed to start) and then stops the plug-in.<p>
247 <dl compact><dt><b>Parameters:</b></dt><dd>
248 <table border="0" cellspacing="2" cellpadding="0">
249 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
250 <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>identifier of the plug-in to be stopped </td></tr>
253 <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#ggd6a8106d281ffa4b1f43fe8e3effc7da6418acb9f17c3a00ea350684bff9782e">CP_ERR_UNKNOWN</a> if unknown plug-in </dd></dl>
257 <a class="anchor" name="g4dec7d61518adfa01da3f2892eaea20a"></a><!-- doxytag: member="cpluff.h::cp_stop_plugins" ref="g4dec7d61518adfa01da3f2892eaea20a" args="(cp_context_t *ctx)" -->
258 <div class="memitem">
259 <div class="memproto">
260 <table class="memname">
262 <td class="memname">void cp_stop_plugins </td>
264 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
265 <td class="paramname"> <em>ctx</em> </td>
266 <td> ) </td>
267 <td width="100%"></td>
274 Stops all active plug-ins.
276 <dl compact><dt><b>Parameters:</b></dt><dd>
277 <table border="0" cellspacing="2" cellpadding="0">
278 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
284 <a class="anchor" name="g2249552dc67bb7893f81babee4a27454"></a><!-- doxytag: member="cpluff.h::cp_uninstall_plugin" ref="g2249552dc67bb7893f81babee4a27454" args="(cp_context_t *ctx, const char *id)" -->
285 <div class="memitem">
286 <div class="memproto">
287 <table class="memname">
289 <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_uninstall_plugin </td>
291 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
292 <td class="paramname"> <em>ctx</em>, </td>
295 <td class="paramkey"></td>
297 <td class="paramtype">const char * </td>
298 <td class="paramname"> <em>id</em></td><td> </td>
303 <td></td><td></td><td width="100%"></td>
310 Uninstalls the specified plug-in.
312 The plug-in is first stopped if it is active. Then uninstalls the plug-in and any dependent plug-ins.<p>
313 <dl compact><dt><b>Parameters:</b></dt><dd>
314 <table border="0" cellspacing="2" cellpadding="0">
315 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
316 <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>identifier of the plug-in to be unloaded </td></tr>
319 <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#ggd6a8106d281ffa4b1f43fe8e3effc7da6418acb9f17c3a00ea350684bff9782e">CP_ERR_UNKNOWN</a> if unknown plug-in </dd></dl>
323 <a class="anchor" name="g01a607d9ae7f9fdb7e91a1845b0e5e99"></a><!-- doxytag: member="cpluff.h::cp_uninstall_plugins" ref="g01a607d9ae7f9fdb7e91a1845b0e5e99" args="(cp_context_t *ctx)" -->
324 <div class="memitem">
325 <div class="memproto">
326 <table class="memname">
328 <td class="memname">void cp_uninstall_plugins </td>
330 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
331 <td class="paramname"> <em>ctx</em> </td>
332 <td> ) </td>
333 <td width="100%"></td>
340 Uninstalls all plug-ins.
342 All plug-ins are first stopped and then uninstalled.<p>
343 <dl compact><dt><b>Parameters:</b></dt><dd>
344 <table border="0" cellspacing="2" cellpadding="0">
345 <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
353 <a href="http://www.c-pluff.org/">C-Pluff</a>, a plug-in framework for C<br>
354 Copyright 2007 <a href="http://www.jlehtinen.net/">Johannes Lehtinen</a>
356 <p class="generated-by">
357 Generated on Fri Apr 6 15:40:55 2007 for C-Pluff C API by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1