/lib/cpluff/doc/reference/c-api/group__cFuncsContext.html
HTML | 215 lines | 199 code | 15 blank | 1 comment | 0 complexity | e34d83dead697963926c78e4ee942a6a MD5 | raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
- <title>C-Pluff C API: Plug-in context initialization</title>
- <link href="doxygen.css" rel="stylesheet" type="text/css">
- <link href="tabs.css" rel="stylesheet" type="text/css">
- </head><body>
- <!-- Generated by Doxygen 1.5.1 -->
- <div class="tabs">
- <ul>
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="modules.html"><span>Modules</span></a></li>
- <li><a href="annotated.html"><span>Data Structures</span></a></li>
- <li><a href="files.html"><span>Files</span></a></li>
- <li><a href="pages.html"><span>Related Pages</span></a></li>
- </ul></div>
- <h1>Plug-in context initialization<br>
- <small>
- [<a class="el" href="group__cFuncs.html">Functions</a>]</small>
- </h1><hr><a name="_details"></a><h2>Detailed Description</h2>
- These functions are used to manage plug-in contexts from the main program perspective.
- <p>
- 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.
- <p>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr><td></td></tr>
- <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- </table>
- <hr><h2>Function Documentation</h2>
- <a class="anchor" name="g7d239c4fc07cf7d3095a20900444ad62"></a><!-- doxytag: member="cpluff.h::cp_create_context" ref="g7d239c4fc07cf7d3095a20900444ad62" args="(cp_status_t *status)" -->
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a>* cp_create_context </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> * </td>
- <td class="paramname"> <em>status</em> </td>
- <td> ) </td>
- <td width="100%"></td>
- </tr>
- </table>
- </div>
- <div class="memdoc">
- <p>
- Creates a new plug-in context which can be used as a container for plug-ins.
- <p>
- 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>
- <dl compact><dt><b>Parameters:</b></dt><dd>
- <table border="0" cellspacing="2" cellpadding="0">
- <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>
- </table>
- </dl>
- <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created plugin context, or NULL on failure </dd></dl>
- </div>
- </div><p>
- <a class="anchor" name="g754ff895992fab0aae81a09c727e5868"></a><!-- doxytag: member="cpluff.h::cp_destroy_context" ref="g754ff895992fab0aae81a09c727e5868" args="(cp_context_t *ctx)" -->
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void cp_destroy_context </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
- <td class="paramname"> <em>ctx</em> </td>
- <td> ) </td>
- <td width="100%"></td>
- </tr>
- </table>
- </div>
- <div class="memdoc">
- <p>
- Destroys the specified plug-in context and releases the associated resources.
- <p>
- Stops and uninstalls all plug-ins in the context. The context must not be accessed after calling this function.<p>
- <dl compact><dt><b>Parameters:</b></dt><dd>
- <table border="0" cellspacing="2" cellpadding="0">
- <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the context to be destroyed </td></tr>
- </table>
- </dl>
- </div>
- </div><p>
- <a class="anchor" name="g998d8350e64a129101f9da687ff5713b"></a><!-- doxytag: member="cpluff.h::cp_register_pcollection" ref="g998d8350e64a129101f9da687ff5713b" args="(cp_context_t *ctx, const char *dir)" -->
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_register_pcollection </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
- <td class="paramname"> <em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const char * </td>
- <td class="paramname"> <em>dir</em></td><td> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td><td width="100%"></td>
- </tr>
- </table>
- </div>
- <div class="memdoc">
- <p>
- Registers a plug-in collection with a plug-in context.
- <p>
- 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>
- <dl compact><dt><b>Parameters:</b></dt><dd>
- <table border="0" cellspacing="2" cellpadding="0">
- <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
- <tr><td valign="top"></td><td valign="top"><em>dir</em> </td><td>the directory </td></tr>
- </table>
- </dl>
- <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>
- </div>
- </div><p>
- <a class="anchor" name="g59817fdae1aeb28dbc7d3dcfc5568c15"></a><!-- doxytag: member="cpluff.h::cp_unregister_pcollection" ref="g59817fdae1aeb28dbc7d3dcfc5568c15" args="(cp_context_t *ctx, const char *dir)" -->
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void cp_unregister_pcollection </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
- <td class="paramname"> <em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const char * </td>
- <td class="paramname"> <em>dir</em></td><td> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td><td width="100%"></td>
- </tr>
- </table>
- </div>
- <div class="memdoc">
- <p>
- Unregisters a previously registered plug-in collection from a plug-in context.
- <p>
- 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>
- <dl compact><dt><b>Parameters:</b></dt><dd>
- <table border="0" cellspacing="2" cellpadding="0">
- <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
- <tr><td valign="top"></td><td valign="top"><em>dir</em> </td><td>the previously registered directory </td></tr>
- </table>
- </dl>
- </div>
- </div><p>
- <a class="anchor" name="g0473208ccfde69e0c57ec1f2b4789781"></a><!-- doxytag: member="cpluff.h::cp_unregister_pcollections" ref="g0473208ccfde69e0c57ec1f2b4789781" args="(cp_context_t *ctx)" -->
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void cp_unregister_pcollections </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> * </td>
- <td class="paramname"> <em>ctx</em> </td>
- <td> ) </td>
- <td width="100%"></td>
- </tr>
- </table>
- </div>
- <div class="memdoc">
- <p>
- Unregisters all plug-in collections from a plug-in context.
- <p>
- 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>
- <dl compact><dt><b>Parameters:</b></dt><dd>
- <table border="0" cellspacing="2" cellpadding="0">
- <tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>the plug-in context </td></tr>
- </table>
- </dl>
- </div>
- </div><p>
- <hr size="1">
- <p class="footer">
- <a href="http://www.c-pluff.org/">C-Pluff</a>, a plug-in framework for C<br>
- Copyright 2007 <a href="http://www.jlehtinen.net/">Johannes Lehtinen</a>
- </p>
- <p class="generated-by">
- 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
- </p>
- </body>
- </html>