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">
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 context initialization<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 are used to manage plug-in contexts from the main program perspective.
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.
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="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </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>
29 <tr><td class="mdescLeft"> </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 </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>
32 <tr><td class="mdescLeft"> </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> </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>
35 <tr><td class="mdescLeft"> </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 </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>
38 <tr><td class="mdescLeft"> </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 </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>
41 <tr><td class="mdescLeft"> </td><td class="mdescRight">Unregisters all plug-in collections from a plug-in context. <a href="#g0473208ccfde69e0c57ec1f2b4789781"></a><br></td></tr>
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)" -->
46 <div class="memproto">
47 <table class="memname">
49 <td class="memname"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a>* cp_create_context </td>
51 <td class="paramtype"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> * </td>
52 <td class="paramname"> <em>status</em> </td>
53 <td> ) </td>
54 <td width="100%"></td>
61 Creates a new plug-in context which can be used as a container for plug-ins.
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> </td><td>pointer to the location where status code is to be stored, or NULL </td></tr>
69 <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created plugin context, or NULL on failure </dd></dl>
73 <a class="anchor" name="g754ff895992fab0aae81a09c727e5868"></a><!-- doxytag: member="cpluff.h::cp_destroy_context" ref="g754ff895992fab0aae81a09c727e5868" args="(cp_context_t *ctx)" -->
75 <div class="memproto">
76 <table class="memname">
78 <td class="memname">void cp_destroy_context </td>
80 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
81 <td class="paramname"> <em>ctx</em> </td>
82 <td> ) </td>
83 <td width="100%"></td>
90 Destroys the specified plug-in context and releases the associated resources.
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> </td><td>the context to be destroyed </td></tr>
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">
106 <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_register_pcollection </td>
108 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
109 <td class="paramname"> <em>ctx</em>, </td>
112 <td class="paramkey"></td>
114 <td class="paramtype">const char * </td>
115 <td class="paramname"> <em>dir</em></td><td> </td>
120 <td></td><td></td><td width="100%"></td>
127 Registers a plug-in collection with a plug-in context.
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> </td><td>the plug-in context </td></tr>
133 <tr><td valign="top"></td><td valign="top"><em>dir</em> </td><td>the directory </td></tr>
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>
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">
145 <td class="memname">void cp_unregister_pcollection </td>
147 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
148 <td class="paramname"> <em>ctx</em>, </td>
151 <td class="paramkey"></td>
153 <td class="paramtype">const char * </td>
154 <td class="paramname"> <em>dir</em></td><td> </td>
159 <td></td><td></td><td width="100%"></td>
166 Unregisters a previously registered plug-in collection from a plug-in context.
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> </td><td>the plug-in context </td></tr>
172 <tr><td valign="top"></td><td valign="top"><em>dir</em> </td><td>the previously registered directory </td></tr>
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">
183 <td class="memname">void cp_unregister_pcollections </td>
185 <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
186 <td class="paramname"> <em>ctx</em> </td>
187 <td> ) </td>
188 <td width="100%"></td>
195 Unregisters all plug-in collections from a plug-in context.
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> </td><td>the plug-in context </td></tr>
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>
211 <p class="generated-by">
212 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