linux-packaging-mono/docs/deploy/mono-api-assembly.html
Xamarin Public Jenkins 3c6daee652 Imported Upstream version 4.2.2.29
Former-commit-id: f069081cc0821095435a845c961ae61cbbc95121
2016-01-18 21:29:19 -05:00

337 lines
11 KiB
HTML

<?xml version="1.0" encoding="utf-8"?><span>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-assembly.html</title>
<style type="text/css">
h3 {
font-size: 18px;
padding-bottom: 4pt;
border-bottom: 2px solid #dddddd;
}
.api {
border: 1px solid;
padding: 10pt;
margin: 10pt;
}
.api-entry {
border-bottom: none;
font-size: 18px;
}
.prototype {
border: 1px solid;
background-color: #f2f2f2;
padding: 5pt;
margin-top: 5pt;
margin-bottom: 5pt;
}
.header {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
.code {
border: 1px solid;
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
}
</style>
</head>
<body>
<h2>Assemblies</h2>
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/assembly.h&gt;
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
MonoAssembly* <a href="#api:mono_assembly_open">mono_assembly_open</a> (const char *filename,
MonoImageOpenStatus *status);
void <a href="#api:mono_assembly_close">mono_assembly_close</a> (MonoAssembly *assembly);
MonoAssembly* <a href="#api:mono_assembly_load">mono_assembly_load</a> (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status);
MonoAssembly* <a href="#api:mono_assembly_load_full">mono_assembly_load_full</a> (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status,
gboolean refonly);
MonoAssembly* <a href="#api:mono_assembly_loaded">mono_assembly_loaded</a> (MonoAssemblyName *aname);
<a href="#api:mono_assembly_get_object"></a>
MonoImage* <a href="#api:mono_assembly_get_image">mono_assembly_get_image</a> (MonoAssembly *assembly);
MonoAssembly* <a href="#api:mono_assembly_get_main">mono_assembly_get_main</a> (void);
G_CONST_RETURN gchar * <a href="#api:mono_assembly_getrootdir">mono_assembly_getrootdir</a> (void);
void <a href="#api:mono_assembly_name_free">mono_assembly_name_free</a> (MonoAssemblyName *aname);
char* <a href="#api:mono_stringify_assembly_name">mono_stringify_assembly_name</a> (MonoAssemblyName *aname);
gboolean <a href="#api:mono_assembly_names_equal">mono_assembly_names_equal</a> (MonoAssemblyName *l,
MonoAssemblyName *r);
<a href="#api:mono_module_file_get_object"></a>
<a href="#api:mono_module_get_object"></a>
</div>
<a name="cil_assembly_load"></a>
<h3>Assembly Loading</h3>
<a name="api:mono_assembly_open"></a>
<div class="api">
<div class="api-entry">mono_assembly_open</div>
<div class="prototype">MonoAssembly*
mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>filename:</i></dt><dd> Opens the assembly pointed out by this name</dd><dt><i>status:</i></dt><dd> where a status code can be returned</dd></blockquote>
<b>Returns</b>
<blockquote> a pointer to the MonoAssembly if <i>filename</i> contains a valid
assembly or NULL on error. Details about the error are stored in the
<i>status</i> variable.</blockquote>
<b>Remarks</b>
<p />
mono_assembly_open opens the PE-image pointed by <i>filename</i>, and
loads any external assemblies referenced by it.
</div> <a name="api:mono_assembly_close"></a>
<div class="api">
<div class="api-entry">mono_assembly_close</div>
<div class="prototype">void
mono_assembly_close (MonoAssembly *assembly)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>assembly:</i></dt><dd> the assembly to release.</dd></blockquote>
<b>Remarks</b>
<p />
This method releases a reference to the <i>assembly</i>. The assembly is
only released when all the outstanding references to it are released.
</div> <a name="api:mono_assembly_load"></a>
<div class="api">
<div class="api-entry">mono_assembly_load</div>
<div class="prototype">MonoAssembly*
mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>aname:</i></dt><dd> A MonoAssemblyName with the assembly name to load.</dd><dt><i>basedir:</i></dt><dd> A directory to look up the assembly at.</dd><dt><i>status:</i></dt><dd> a pointer to a MonoImageOpenStatus to return the status of the load operation</dd></blockquote>
<b>Returns</b>
<blockquote> the assembly referenced by <i>aname</i> loaded or NULL on error. On error the
value pointed by status is updated with an error code.</blockquote>
<b>Remarks</b>
<p />
Loads the assembly referenced by <i>aname</i>, if the value of <i>basedir</i> is not NULL, it
attempts to load the assembly from that directory before probing the standard locations.
</div> <a name="api:mono_assembly_load_full"></a>
<div class="api">
<div class="api-entry">mono_assembly_load_full</div>
<div class="prototype">MonoAssembly*
mono_assembly_load_full (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, gboolean refonly)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>aname:</i></dt><dd> A MonoAssemblyName with the assembly name to load.</dd><dt><i>basedir:</i></dt><dd> A directory to look up the assembly at.</dd><dt><i>status:</i></dt><dd> a pointer to a MonoImageOpenStatus to return the status of the load operation</dd><dt><i>refonly:</i></dt><dd> Whether this assembly is being opened in &quot;reflection-only&quot; mode.</dd></blockquote>
<b>Returns</b>
<blockquote> the assembly referenced by <i>aname</i> loaded or NULL on error. On error the
value pointed by status is updated with an error code.</blockquote>
<b>Remarks</b>
<p />
Loads the assembly referenced by <i>aname</i>, if the value of <i>basedir</i> is not NULL, it
attempts to load the assembly from that directory before probing the standard locations.
If the assembly is being opened in reflection-only mode (<i>refonly</i> set to TRUE) then no
assembly binding takes place.
</div> <a name="api:mono_assembly_loaded"></a>
<div class="api">
<div class="api-entry">mono_assembly_loaded</div>
<div class="prototype">MonoAssembly*
mono_assembly_loaded (MonoAssemblyName *aname)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>aname:</i></dt><dd> an assembly to look for.</dd></blockquote>
<b>Returns</b>
<blockquote> NULL If the given <i>aname</i> assembly has not been loaded, or a pointer to
a MonoAssembly that matches the MonoAssemblyName specified.</blockquote>
</div> <a name="api:mono_assembly_get_object"></a>
<div class="api">
<div class="api-entry">mono_assembly_get_object</div>
<div class="prototype">Prototype: mono_assembly_get_object</div>
<p />
</div><h3>Working with Assemblies</h3>
<a name="api:mono_assembly_get_image"></a>
<div class="api">
<div class="api-entry">mono_assembly_get_image</div>
<div class="prototype">MonoImage*
mono_assembly_get_image (MonoAssembly *assembly)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>assembly:</i></dt><dd> The assembly to retrieve the image from</dd></blockquote>
<b>Returns</b>
<blockquote> the MonoImage associated with this assembly.
</blockquote>
</div> <a name="api:mono_assembly_get_main"></a>
<div class="api">
<div class="api-entry">mono_assembly_get_main</div>
<div class="prototype">MonoAssembly*
mono_assembly_get_main (void)
</div>
<p />
<b>Returns</b>
<blockquote> the assembly for the application, the first assembly that is loaded by the VM
</blockquote>
</div> <a name="api:mono_assembly_getrootdir"></a>
<div class="api">
<div class="api-entry">mono_assembly_getrootdir</div>
<div class="prototype">G_CONST_RETURN gchar *
mono_assembly_getrootdir (void)
</div>
<p />
<b>Returns</b>
<blockquote> a string with the directory, this string should not be freed.
</blockquote>
<b>Remarks</b>
<p /> <p />
Obtains the root directory used for looking up assemblies.
</div><h3>Assembly Names</h3>
<p />The MonoAssemblyName contains the full identity of an
assembly (name, culture, public key, public key token,
version and any other flags).
<p />These unmanaged objects represent the <a href="http://www.mono-project.com/monodoc/T:System.Reflection.AssemblyName">System.Reflection.AssemblyName</a>
managed type.
<a name="api:mono_assembly_name_free"></a>
<div class="api">
<div class="api-entry">mono_assembly_name_free</div>
<div class="prototype">void
mono_assembly_name_free (MonoAssemblyName *aname)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>aname:</i></dt><dd> assembly name to free</dd></blockquote>
<b>Remarks</b>
<p /> <p />
Frees the provided assembly name object.
(it does not frees the object itself, only the name members).
</div> <a name="api:mono_stringify_assembly_name"></a>
<div class="api">
<div class="api-entry">mono_stringify_assembly_name</div>
<div class="prototype">char*
mono_stringify_assembly_name (MonoAssemblyName *aname)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>aname:</i></dt><dd> the assembly name.</dd></blockquote>
<b>Returns</b>
<blockquote> a newly allocated string with a string representation of
the assembly name.</blockquote>
<b>Remarks</b>
<p />
Convert <i>aname</i> into its string format. The returned string is dynamically
allocated and should be freed by the caller.
</div> <a name="api:mono_assembly_names_equal"></a>
<div class="api">
<div class="api-entry">mono_assembly_names_equal</div>
<div class="prototype">gboolean
mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r)
</div>
<p />
<b>Parameters</b>
<blockquote><dt><i>l:</i></dt><dd> first assembly</dd><dt><i>r:</i></dt><dd> second assembly.</dd></blockquote>
<b>Returns</b>
<blockquote> TRUE if both assembly names are equal.
</blockquote>
<b>Remarks</b>
<p />
Compares two MonoAssemblyNames and returns whether they are equal.
This compares the names, the cultures, the release version and their
public tokens.
</div><h3>Modules</h3>
<p />An assembly is made up of one or more modules.
<a name="api:mono_module_file_get_object"></a>
<div class="api">
<div class="api-entry">mono_module_file_get_object</div>
<div class="prototype">Prototype: mono_module_file_get_object</div>
<p />
</div> <a name="api:mono_module_get_object"></a>
<div class="api">
<div class="api-entry">mono_module_get_object</div>
<div class="prototype">Prototype: mono_module_get_object</div>
<p />
</div></body>
</html>
</span>