PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/cpluff/doc/reference/c-api/group__cFuncsContext.html

https://gitlab.com/sloshedpuppie/LetsGoRetro
HTML | 215 lines | 199 code | 15 blank | 1 comment | 0 complexity | e34d83dead697963926c78e4ee942a6a MD5 | raw file
  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. <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>
  29. <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>
  30. <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>
  31. <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>
  32. <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>
  33. <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>
  34. <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>
  35. <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>
  36. <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>
  37. </table>
  38. <hr><h2>Function Documentation</h2>
  39. <a class="anchor" name="g7d239c4fc07cf7d3095a20900444ad62"></a><!-- doxytag: member="cpluff.h::cp_create_context" ref="g7d239c4fc07cf7d3095a20900444ad62" args="(cp_status_t *status)" -->
  40. <div class="memitem">
  41. <div class="memproto">
  42. <table class="memname">
  43. <tr>
  44. <td class="memname"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a>* cp_create_context </td>
  45. <td>(</td>
  46. <td class="paramtype"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> *&nbsp;</td>
  47. <td class="paramname"> <em>status</em> </td>
  48. <td>&nbsp;)&nbsp;</td>
  49. <td width="100%"></td>
  50. </tr>
  51. </table>
  52. </div>
  53. <div class="memdoc">
  54. <p>
  55. Creates a new plug-in context which can be used as a container for plug-ins.
  56. <p>
  57. 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>
  58. <dl compact><dt><b>Parameters:</b></dt><dd>
  59. <table border="0" cellspacing="2" cellpadding="0">
  60. <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>
  61. </table>
  62. </dl>
  63. <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created plugin context, or NULL on failure </dd></dl>
  64. </div>
  65. </div><p>
  66. <a class="anchor" name="g754ff895992fab0aae81a09c727e5868"></a><!-- doxytag: member="cpluff.h::cp_destroy_context" ref="g754ff895992fab0aae81a09c727e5868" args="(cp_context_t *ctx)" -->
  67. <div class="memitem">
  68. <div class="memproto">
  69. <table class="memname">
  70. <tr>
  71. <td class="memname">void cp_destroy_context </td>
  72. <td>(</td>
  73. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  74. <td class="paramname"> <em>ctx</em> </td>
  75. <td>&nbsp;)&nbsp;</td>
  76. <td width="100%"></td>
  77. </tr>
  78. </table>
  79. </div>
  80. <div class="memdoc">
  81. <p>
  82. Destroys the specified plug-in context and releases the associated resources.
  83. <p>
  84. Stops and uninstalls all plug-ins in the context. The context must not be accessed after calling this function.<p>
  85. <dl compact><dt><b>Parameters:</b></dt><dd>
  86. <table border="0" cellspacing="2" cellpadding="0">
  87. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the context to be destroyed </td></tr>
  88. </table>
  89. </dl>
  90. </div>
  91. </div><p>
  92. <a class="anchor" name="g998d8350e64a129101f9da687ff5713b"></a><!-- doxytag: member="cpluff.h::cp_register_pcollection" ref="g998d8350e64a129101f9da687ff5713b" args="(cp_context_t *ctx, const char *dir)" -->
  93. <div class="memitem">
  94. <div class="memproto">
  95. <table class="memname">
  96. <tr>
  97. <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_register_pcollection </td>
  98. <td>(</td>
  99. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  100. <td class="paramname"> <em>ctx</em>, </td>
  101. </tr>
  102. <tr>
  103. <td class="paramkey"></td>
  104. <td></td>
  105. <td class="paramtype">const char *&nbsp;</td>
  106. <td class="paramname"> <em>dir</em></td><td>&nbsp;</td>
  107. </tr>
  108. <tr>
  109. <td></td>
  110. <td>)</td>
  111. <td></td><td></td><td width="100%"></td>
  112. </tr>
  113. </table>
  114. </div>
  115. <div class="memdoc">
  116. <p>
  117. Registers a plug-in collection with a plug-in context.
  118. <p>
  119. 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>
  120. <dl compact><dt><b>Parameters:</b></dt><dd>
  121. <table border="0" cellspacing="2" cellpadding="0">
  122. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
  123. <tr><td valign="top"></td><td valign="top"><em>dir</em>&nbsp;</td><td>the directory </td></tr>
  124. </table>
  125. </dl>
  126. <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>
  127. </div>
  128. </div><p>
  129. <a class="anchor" name="g59817fdae1aeb28dbc7d3dcfc5568c15"></a><!-- doxytag: member="cpluff.h::cp_unregister_pcollection" ref="g59817fdae1aeb28dbc7d3dcfc5568c15" args="(cp_context_t *ctx, const char *dir)" -->
  130. <div class="memitem">
  131. <div class="memproto">
  132. <table class="memname">
  133. <tr>
  134. <td class="memname">void cp_unregister_pcollection </td>
  135. <td>(</td>
  136. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  137. <td class="paramname"> <em>ctx</em>, </td>
  138. </tr>
  139. <tr>
  140. <td class="paramkey"></td>
  141. <td></td>
  142. <td class="paramtype">const char *&nbsp;</td>
  143. <td class="paramname"> <em>dir</em></td><td>&nbsp;</td>
  144. </tr>
  145. <tr>
  146. <td></td>
  147. <td>)</td>
  148. <td></td><td></td><td width="100%"></td>
  149. </tr>
  150. </table>
  151. </div>
  152. <div class="memdoc">
  153. <p>
  154. Unregisters a previously registered plug-in collection from a plug-in context.
  155. <p>
  156. 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>
  157. <dl compact><dt><b>Parameters:</b></dt><dd>
  158. <table border="0" cellspacing="2" cellpadding="0">
  159. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
  160. <tr><td valign="top"></td><td valign="top"><em>dir</em>&nbsp;</td><td>the previously registered directory </td></tr>
  161. </table>
  162. </dl>
  163. </div>
  164. </div><p>
  165. <a class="anchor" name="g0473208ccfde69e0c57ec1f2b4789781"></a><!-- doxytag: member="cpluff.h::cp_unregister_pcollections" ref="g0473208ccfde69e0c57ec1f2b4789781" args="(cp_context_t *ctx)" -->
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">void cp_unregister_pcollections </td>
  171. <td>(</td>
  172. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  173. <td class="paramname"> <em>ctx</em> </td>
  174. <td>&nbsp;)&nbsp;</td>
  175. <td width="100%"></td>
  176. </tr>
  177. </table>
  178. </div>
  179. <div class="memdoc">
  180. <p>
  181. Unregisters all plug-in collections from a plug-in context.
  182. <p>
  183. 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>
  184. <dl compact><dt><b>Parameters:</b></dt><dd>
  185. <table border="0" cellspacing="2" cellpadding="0">
  186. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
  187. </table>
  188. </dl>
  189. </div>
  190. </div><p>
  191. <hr size="1">
  192. <p class="footer">
  193. <a href="http://www.c-pluff.org/">C-Pluff</a>, a plug-in framework for C<br>
  194. Copyright 2007 <a href="http://www.jlehtinen.net/">Johannes Lehtinen</a>
  195. </p>
  196. <p class="generated-by">
  197. 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
  198. </p>
  199. </body>
  200. </html>