1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>xmlmodule: dynamic module loading</title> 5<meta name="generator" content="Libxml2 devhelp stylesheet"> 6<link rel="start" href="index.html" title="libxml2 Reference Manual"> 7<link rel="up" href="general.html" title="API"> 8<link rel="stylesheet" href="style.css" type="text/css"> 9<link rel="chapter" href="general.html" title="API"> 10</head> 11<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 12<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"> 13<td><a accesskey="p" href="libxml2-xmlmemory.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> 14<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> 15<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> 16<td><a accesskey="n" href="libxml2-xmlreader.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> 17<th width="100%" align="center">libxml2 Reference Manual</th> 18</tr></table> 19<h2><span class="refentrytitle">xmlmodule</span></h2> 20<p>xmlmodule - dynamic module loading</p> 21<p>basic API for dynamic module loading, used by libexslt added in 2.6.17 </p> 22<p>Author(s): Joel W. Reed </p> 23<div class="refsynopsisdiv"> 24<h2>Synopsis</h2> 25<pre class="synopsis">typedef struct _xmlModule <a href="#xmlModule">xmlModule</a>; 26typedef enum <a href="#xmlModuleOption">xmlModuleOption</a>; 27typedef <a href="libxml2-xmlmodule.html#xmlModule">xmlModule</a> * <a href="#xmlModulePtr">xmlModulePtr</a>; 28int <a href="#xmlModuleClose">xmlModuleClose</a> (<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> module); 29int <a href="#xmlModuleFree">xmlModuleFree</a> (<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> module); 30<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> <a href="#xmlModuleOpen">xmlModuleOpen</a> (const char * name, <br> int options); 31int <a href="#xmlModuleSymbol">xmlModuleSymbol</a> (<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> module, <br> const char * name, <br> void ** symbol); 32</pre> 33</div> 34<div class="refsect1" lang="en"><h2>Description</h2></div> 35<div class="refsect1" lang="en"> 36<h2>Details</h2> 37<div class="refsect2" lang="en"> 38<div class="refsect2" lang="en"> 39<h3> 40<a name="xmlModule">Structure </a>xmlModule</h3> 41<pre class="programlisting">struct _xmlModule { 42The content of this structure is not made public by the API. 43} xmlModule; 44</pre> 45<p></p> 46</div> 47<hr> 48<div class="refsect2" lang="en"> 49<h3> 50<a name="xmlModuleOption">Enum </a>xmlModuleOption</h3> 51<pre class="programlisting">enum <a href="#xmlModuleOption">xmlModuleOption</a> { 52 <a name="XML_MODULE_LAZY">XML_MODULE_LAZY</a> = 1 /* lazy binding */ 53 <a name="XML_MODULE_LOCAL">XML_MODULE_LOCAL</a> = 2 /* local binding */ 54}; 55</pre> 56<p></p> 57</div> 58<hr> 59<div class="refsect2" lang="en"> 60<h3> 61<a name="xmlModulePtr">Typedef </a>xmlModulePtr</h3> 62<pre class="programlisting"><a href="libxml2-xmlmodule.html#xmlModule">xmlModule</a> * xmlModulePtr; 63</pre> 64<p>A handle to a dynamically loaded module</p> 65</div> 66<hr> 67<div class="refsect2" lang="en"> 68<h3> 69<a name="xmlModuleClose"></a>xmlModuleClose ()</h3> 70<pre class="programlisting">int xmlModuleClose (<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> module)<br> 71</pre> 72<p>The close operations unload the associated module and free the data associated to the module.</p> 73<div class="variablelist"><table border="0"> 74<col align="left"> 75<tbody> 76<tr> 77<td><span class="term"><i><tt>module</tt></i>:</span></td> 78<td>the module handle</td> 79</tr> 80<tr> 81<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 82<td>0 in case of success, -1 in case of argument error and -2 if the module could not be closed/unloaded.</td> 83</tr> 84</tbody> 85</table></div> 86</div> 87<hr> 88<div class="refsect2" lang="en"> 89<h3> 90<a name="xmlModuleFree"></a>xmlModuleFree ()</h3> 91<pre class="programlisting">int xmlModuleFree (<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> module)<br> 92</pre> 93<p>The free operations free the data associated to the module but does not unload the associated shared library which may still be in use.</p> 94<div class="variablelist"><table border="0"> 95<col align="left"> 96<tbody> 97<tr> 98<td><span class="term"><i><tt>module</tt></i>:</span></td> 99<td>the module handle</td> 100</tr> 101<tr> 102<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 103<td>0 in case of success, -1 in case of argument error</td> 104</tr> 105</tbody> 106</table></div> 107</div> 108<hr> 109<div class="refsect2" lang="en"> 110<h3> 111<a name="xmlModuleOpen"></a>xmlModuleOpen ()</h3> 112<pre class="programlisting"><a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> xmlModuleOpen (const char * name, <br> int options)<br> 113</pre> 114<p>Opens a module/shared library given its name or path NOTE: that due to portability issues, behaviour can only be guaranteed with @name using ASCII. We cannot guarantee that an UTF-8 string would work, which is why name is a const char * and not a const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * . TODO: options are not yet implemented.</p> 115<div class="variablelist"><table border="0"> 116<col align="left"> 117<tbody> 118<tr> 119<td><span class="term"><i><tt>name</tt></i>:</span></td> 120<td>the module name</td> 121</tr> 122<tr> 123<td><span class="term"><i><tt>options</tt></i>:</span></td> 124<td>a set of <a href="libxml2-xmlmodule.html#xmlModuleOption">xmlModuleOption</a> 125</td> 126</tr> 127<tr> 128<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 129<td>a handle for the module or NULL in case of error</td> 130</tr> 131</tbody> 132</table></div> 133</div> 134<hr> 135<div class="refsect2" lang="en"> 136<h3> 137<a name="xmlModuleSymbol"></a>xmlModuleSymbol ()</h3> 138<pre class="programlisting">int xmlModuleSymbol (<a href="libxml2-xmlmodule.html#xmlModulePtr">xmlModulePtr</a> module, <br> const char * name, <br> void ** symbol)<br> 139</pre> 140<p>Lookup for a symbol address in the given module NOTE: that due to portability issues, behaviour can only be guaranteed with @name using ASCII. We cannot guarantee that an UTF-8 string would work, which is why name is a const char * and not a const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * .</p> 141<div class="variablelist"><table border="0"> 142<col align="left"> 143<tbody> 144<tr> 145<td><span class="term"><i><tt>module</tt></i>:</span></td> 146<td>the module</td> 147</tr> 148<tr> 149<td><span class="term"><i><tt>name</tt></i>:</span></td> 150<td>the name of the symbol</td> 151</tr> 152<tr> 153<td><span class="term"><i><tt>symbol</tt></i>:</span></td> 154<td>the resulting symbol address</td> 155</tr> 156<tr> 157<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 158<td>0 if the symbol was found, or -1 in case of error</td> 159</tr> 160</tbody> 161</table></div> 162</div> 163<hr> 164</div> 165</div> 166</body> 167</html> 168