PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://gitlab.com/sloshedpuppie/LetsGoRetro
HTML | 186 lines | 176 code | 9 blank | 1 comment | 0 complexity | fe7230dcfaa02b289bd005952b6f9d2b 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: Dynamic symbols</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>Dynamic symbols<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 can be used to dynamically access symbols exported by the plug-ins.
  21. <p>
  22. They are intended to be used by a plug-in runtime or by the main program.
  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__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsSymbols.html#g9d128b52c0ffe2d4215026fe59f9abeb">cp_define_symbol</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *name, void *ptr)</td></tr>
  28. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Defines a context specific symbol. <a href="#g9d128b52c0ffe2d4215026fe59f9abeb"></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__cFuncsSymbols.html#g8bc3b7fcf4f4ed414837f5a3998d46b7">cp_resolve_symbol</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const char *id, const char *name, <a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> *status)</td></tr>
  30. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resolves a symbol provided by the specified plug-in. <a href="#g8bc3b7fcf4f4ed414837f5a3998d46b7"></a><br></td></tr>
  31. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cFuncsSymbols.html#g150629125a61ac9fa4e2095b0d9c7e57">cp_release_symbol</a> (<a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *ctx, const void *ptr)</td></tr>
  32. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Releases a previously obtained symbol. <a href="#g150629125a61ac9fa4e2095b0d9c7e57"></a><br></td></tr>
  33. </table>
  34. <hr><h2>Function Documentation</h2>
  35. <a class="anchor" name="g9d128b52c0ffe2d4215026fe59f9abeb"></a><!-- doxytag: member="cpluff.h::cp_define_symbol" ref="g9d128b52c0ffe2d4215026fe59f9abeb" args="(cp_context_t *ctx, const char *name, void *ptr)" -->
  36. <div class="memitem">
  37. <div class="memproto">
  38. <table class="memname">
  39. <tr>
  40. <td class="memname"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> cp_define_symbol </td>
  41. <td>(</td>
  42. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  43. <td class="paramname"> <em>ctx</em>, </td>
  44. </tr>
  45. <tr>
  46. <td class="paramkey"></td>
  47. <td></td>
  48. <td class="paramtype">const char *&nbsp;</td>
  49. <td class="paramname"> <em>name</em>, </td>
  50. </tr>
  51. <tr>
  52. <td class="paramkey"></td>
  53. <td></td>
  54. <td class="paramtype">void *&nbsp;</td>
  55. <td class="paramname"> <em>ptr</em></td><td>&nbsp;</td>
  56. </tr>
  57. <tr>
  58. <td></td>
  59. <td>)</td>
  60. <td></td><td></td><td width="100%"></td>
  61. </tr>
  62. </table>
  63. </div>
  64. <div class="memdoc">
  65. <p>
  66. Defines a context specific symbol.
  67. <p>
  68. If a plug-in has symbols which have a plug-in instance specific value then the plug-in should define those symbols when it is started. The defined symbols are cleared automatically when the plug-in instance is stopped. Symbols can not be redefined.<p>
  69. <dl compact><dt><b>Parameters:</b></dt><dd>
  70. <table border="0" cellspacing="2" cellpadding="0">
  71. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
  72. <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the symbol </td></tr>
  73. <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>pointer value for the symbol </td></tr>
  74. </table>
  75. </dl>
  76. <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 status code on failure </dd></dl>
  77. </div>
  78. </div><p>
  79. <a class="anchor" name="g8bc3b7fcf4f4ed414837f5a3998d46b7"></a><!-- doxytag: member="cpluff.h::cp_resolve_symbol" ref="g8bc3b7fcf4f4ed414837f5a3998d46b7" args="(cp_context_t *ctx, const char *id, const char *name, cp_status_t *status)" -->
  80. <div class="memitem">
  81. <div class="memproto">
  82. <table class="memname">
  83. <tr>
  84. <td class="memname">void* cp_resolve_symbol </td>
  85. <td>(</td>
  86. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  87. <td class="paramname"> <em>ctx</em>, </td>
  88. </tr>
  89. <tr>
  90. <td class="paramkey"></td>
  91. <td></td>
  92. <td class="paramtype">const char *&nbsp;</td>
  93. <td class="paramname"> <em>id</em>, </td>
  94. </tr>
  95. <tr>
  96. <td class="paramkey"></td>
  97. <td></td>
  98. <td class="paramtype">const char *&nbsp;</td>
  99. <td class="paramname"> <em>name</em>, </td>
  100. </tr>
  101. <tr>
  102. <td class="paramkey"></td>
  103. <td></td>
  104. <td class="paramtype"><a class="el" href="group__cEnums.html#gd6a8106d281ffa4b1f43fe8e3effc7da">cp_status_t</a> *&nbsp;</td>
  105. <td class="paramname"> <em>status</em></td><td>&nbsp;</td>
  106. </tr>
  107. <tr>
  108. <td></td>
  109. <td>)</td>
  110. <td></td><td></td><td width="100%"></td>
  111. </tr>
  112. </table>
  113. </div>
  114. <div class="memdoc">
  115. <p>
  116. Resolves a symbol provided by the specified plug-in.
  117. <p>
  118. The plug-in is started automatically if it is not already active. The symbol may be context specific or global. The framework first looks for a context specific symbol and then falls back to resolving a global symbol exported by the plug-in runtime library. The symbol can be released using <a class="el" href="group__cFuncsSymbols.html#g150629125a61ac9fa4e2095b0d9c7e57">cp_release_symbol</a> when it is not needed anymore. Pointers obtained from this function must not be passed on to other plug-ins or the main program.<p>
  119. When a plug-in runtime calls this function the plug-in framework creates a dynamic dependency from the symbol using plug-in to the symbol defining plug-in. The symbol using plug-in is stopped automatically if the symbol defining plug-in is about to be stopped. If the symbol using plug-in does not explicitly release the symbol then it is automatically released after a call to the stop function. It is not safe to refer to a dynamically resolved symbol in the stop function except to release it using <a class="el" href="group__cFuncsSymbols.html#g150629125a61ac9fa4e2095b0d9c7e57">cp_release_symbol</a>.<p>
  120. When the main program calls this function it is the responsibility of the main program to always release the symbol before the symbol defining plug-in is stopped. It is a fatal error if the symbol is not released before the symbol defining plug-in is stopped.<p>
  121. <dl compact><dt><b>Parameters:</b></dt><dd>
  122. <table border="0" cellspacing="2" cellpadding="0">
  123. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
  124. <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>the identifier of the symbol defining plug-in </td></tr>
  125. <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the symbol </td></tr>
  126. <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>a pointer to the location where the status code is to be stored, or NULL </td></tr>
  127. </table>
  128. </dl>
  129. <dl class="return" compact><dt><b>Returns:</b></dt><dd>the pointer associated with the symbol or NULL on failure </dd></dl>
  130. </div>
  131. </div><p>
  132. <a class="anchor" name="g150629125a61ac9fa4e2095b0d9c7e57"></a><!-- doxytag: member="cpluff.h::cp_release_symbol" ref="g150629125a61ac9fa4e2095b0d9c7e57" args="(cp_context_t *ctx, const void *ptr)" -->
  133. <div class="memitem">
  134. <div class="memproto">
  135. <table class="memname">
  136. <tr>
  137. <td class="memname">void cp_release_symbol </td>
  138. <td>(</td>
  139. <td class="paramtype"><a class="el" href="group__cTypedefsOpaque.html#gcb1aa0619dcefa746383c5e0833b62e7">cp_context_t</a> *&nbsp;</td>
  140. <td class="paramname"> <em>ctx</em>, </td>
  141. </tr>
  142. <tr>
  143. <td class="paramkey"></td>
  144. <td></td>
  145. <td class="paramtype">const void *&nbsp;</td>
  146. <td class="paramname"> <em>ptr</em></td><td>&nbsp;</td>
  147. </tr>
  148. <tr>
  149. <td></td>
  150. <td>)</td>
  151. <td></td><td></td><td width="100%"></td>
  152. </tr>
  153. </table>
  154. </div>
  155. <div class="memdoc">
  156. <p>
  157. Releases a previously obtained symbol.
  158. <p>
  159. The pointer must not be used after the symbol has been released. The symbol is released only after as many calls to this function as there have been for <a class="el" href="group__cFuncsSymbols.html#g8bc3b7fcf4f4ed414837f5a3998d46b7">cp_resolve_symbol</a> for the same plug-in and symbol.<p>
  160. <dl compact><dt><b>Parameters:</b></dt><dd>
  161. <table border="0" cellspacing="2" cellpadding="0">
  162. <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>the plug-in context </td></tr>
  163. <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>the pointer associated with the symbol </td></tr>
  164. </table>
  165. </dl>
  166. </div>
  167. </div><p>
  168. <hr size="1">
  169. <p class="footer">
  170. <a href="http://www.c-pluff.org/">C-Pluff</a>, a plug-in framework for C<br>
  171. Copyright 2007 <a href="http://www.jlehtinen.net/">Johannes Lehtinen</a>
  172. </p>
  173. <p class="generated-by">
  174. 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
  175. </p>
  176. </body>
  177. </html>