Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<h2>Assemblies</h2>
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/assembly.h&gt;
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
@API_IDX@
</div>
<a name="cil_assembly_load"/>
<h3>Assembly Loading</h3>
<h4><a name="api:mono_assembly_open">mono_assembly_open</a></h4>
<h4><a name="api:mono_assembly_close">mono_assembly_close</a></h4>
<h4><a name="api:mono_assembly_load">mono_assembly_load</a></h4>
<h4><a name="api:mono_assembly_load_full">mono_assembly_load_full</a></h4>
<h4><a name="api:mono_assembly_loaded">mono_assembly_loaded</a></h4>
<h4><a name="api:mono_assembly_get_object">mono_assembly_get_object</a></h4>
<h3>Working with Assemblies</h3>
<h4><a name="api:mono_assembly_get_image">mono_assembly_get_image</a></h4>
<h4><a name="api:mono_assembly_get_main">mono_assembly_get_main</a></h4>
<h4><a name="api:mono_assembly_getrootdir">mono_assembly_getrootdir</a></h4>
<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.
<h4><a name="api:mono_assembly_name_free">mono_assembly_name_free</a></h4>
<h4><a name="api:mono_stringify_assembly_name">mono_stringify_assembly_name</a></h4>
<h4><a name="api:mono_assembly_names_equal">mono_assembly_names_equal</a></h4>
<h3>Modules</h3>
<p>An assembly is made up of one or more modules.
<h4><a name="api:mono_module_file_get_object">mono_module_file_get_object</a></h4>
<h4><a name="api:mono_module_get_object">mono_module_get_object</a></h4>

View File

@@ -0,0 +1,52 @@
<h2>Class Operations</h2>
<h4><a name="api:mono_class_array_element_size">mono_class_array_element_size</a></h4>
<h4><a name="api:mono_class_data_size">mono_class_data_size</a></h4>
<h4><a name="api:mono_class_enum_basetype">mono_class_enum_basetype</a></h4>
<h4><a name="api:mono_class_from_generic_parameter">mono_class_from_generic_parameter</a></h4>
<h4><a name="api:mono_class_from_mono_type">mono_class_from_mono_type</a></h4>
<h4><a name="api:mono_class_from_name_case">mono_class_from_name_case</a></h4>
<h4><a name="api:mono_class_from_name">mono_class_from_name</a></h4>
<h4><a name="api:mono_class_from_typeref">mono_class_from_typeref</a></h4>
<h4><a name="api:mono_class_get_byref_type">mono_class_get_byref_type</a></h4>
<h4><a name="api:mono_class_get_element_class">mono_class_get_element_class</a></h4>
<h4><a name="api:mono_class_get_events">mono_class_get_events</a></h4>
<h4><a name="api:mono_class_get_event_token">mono_class_get_event_token</a></h4>
<h4><a name="api:mono_class_get_field_from_name">mono_class_get_field_from_name</a></h4>
<h4><a name="api:mono_class_get_field">mono_class_get_field</a></h4>
<h4><a name="api:mono_class_get_fields">mono_class_get_fields</a></h4>
<h4><a name="api:mono_class_get_field_token">mono_class_get_field_token</a></h4>
<h4><a name="api:mono_class_get_flags">mono_class_get_flags</a></h4>
<h4><a name="api:mono_class_get_full">mono_class_get_full</a></h4>
<h4><a name="api:mono_class_get_image">mono_class_get_image</a></h4>
<h4><a name="api:mono_class_get_interfaces">mono_class_get_interfaces</a></h4>
<h4><a name="api:mono_class_get_method_from_name">mono_class_get_method_from_name</a></h4>
<h4><a name="api:mono_class_get_methods">mono_class_get_methods</a></h4>
<h4><a name="api:mono_class_get">mono_class_get</a></h4>
<h4><a name="api:mono_class_get_name">mono_class_get_name</a></h4>
<h4><a name="api:mono_class_get_namespace">mono_class_get_namespace</a></h4>
<h4><a name="api:mono_class_get_nested_types">mono_class_get_nested_types</a></h4>
<h4><a name="api:mono_class_get_nesting_type">mono_class_get_nesting_type</a></h4>
<h4><a name="api:mono_class_get_parent">mono_class_get_parent</a></h4>
<h4><a name="api:mono_class_get_properties">mono_class_get_properties</a></h4>
<h4><a name="api:mono_class_get_property_from_name">mono_class_get_property_from_name</a></h4>
<h4><a name="api:mono_class_get_property_token">mono_class_get_property_token</a></h4>
<h4><a name="api:mono_class_get_rank">mono_class_get_rank</a></h4>
<h4><a name="api:mono_class_get_type">mono_class_get_type</a></h4>
<h4><a name="api:mono_class_inflate_generic_method">mono_class_inflate_generic_method</a></h4>
<h4><a name="api:mono_class_inflate_generic_type">mono_class_inflate_generic_type</a></h4>
<h4><a name="api:mono_class_init">mono_class_init</a></h4>
<h4><a name="api:mono_class_instance_size">mono_class_instance_size</a></h4>
<h4><a name="api:mono_class_is_assignable_from">mono_class_is_assignable_from</a></h4>
<h4><a name="api:mono_class_is_enum">mono_class_is_enum</a></h4>
<h4><a name="api:mono_class_is_subclass_of">mono_class_is_subclass_of</a></h4>
<h4><a name="api:mono_class_is_valuetype">mono_class_is_valuetype</a></h4>
<h4><a name="api:mono_class_min_align">mono_class_min_align</a></h4>
<h4><a name="api:mono_class_num_events">mono_class_num_events</a></h4>
<h4><a name="api:mono_class_num_fields">mono_class_num_fields</a></h4>
<h4><a name="api:mono_class_num_methods">mono_class_num_methods</a></h4>
<h4><a name="api:mono_class_num_properties">mono_class_num_properties</a></h4>
<h4><a name="api:mono_class_value_size">mono_class_value_size</a></h4>
<h4><a name="api:mono_class_vtable">mono_class_vtable</a></h4>
<h4><a name="api:mono_class_get_method_from_name_flags">mono_class_get_method_from_name_flags</a></h4>
<h4><a name="api:mono_class_name_from_token">mono_class_name_from_token</a></h4>

View File

@@ -0,0 +1,10 @@
<h3>Code manager</h3>
<h4><a name="api:mono_code_manager_commit">mono_code_manager_commit</a></h4>
<h4><a name="api:mono_code_manager_destroy">mono_code_manager_destroy</a></h4>
<h4><a name="api:mono_code_manager_foreach">mono_code_manager_foreach</a></h4>
<h4><a name="api:mono_code_manager_invalidate">mono_code_manager_invalidate</a></h4>
<h4><a name="api:mono_code_manager_new_dynamic">mono_code_manager_new_dynamic</a></h4>
<h4><a name="api:mono_code_manager_new">mono_code_manager_new</a></h4>
<h4><a name="api:mono_code_manager_reserve">mono_code_manager_reserve</a></h4>

View File

@@ -0,0 +1,44 @@
<h2>Counters</h2>
<p>Counters is a Mono API for flexible statistics collection
and is used to track different events inside the JIT.
<p>You would typically register an address with the
<tt>mono_counters_register</tt> routine and increment the
counters from your application as you go. At the end of the
program you would call mono_counters_dump which will display
all the registered counters.
<p>If you need more complicated counter computation, a
function can be provided instead of an address. In that case
the <tt>MONO_COUNTER_CALLBACK</tt> flag must be ored in the
type request.
<p>The types that can be rendered are:
<pre>
MONO_COUNTER_INT
MONO_COUNTER_UINT
MONO_COUNTER_WORD
MONO_COUNTER_LONG
MONO_COUNTER_ULONG
MONO_COUNTER_DOUBLE
MONO_COUNTER_STRING
</pre>
<p>To organize the output, you register also a section where
the counter will be displayed, or one of the following values
when you register your counter:
<pre>
MONO_COUNTER_JIT
MONO_COUNTER_GC
MONO_COUNTER_METADATA
MONO_COUNTER_GENERICS
MONO_COUNTER_SECURITY
</pre>
<h4><a name="api:mono_counters_dump">mono_counters_dump</a></h4>
<h4><a name="api:mono_counters_enable">mono_counters_enable</a></h4>
<h4><a name="api:mono_counters_register">mono_counters_register</a></h4>

View File

@@ -0,0 +1,23 @@
<h4><a name="api:mono_debug_il_offset_from_address">mono_debug_il_offset_from_address</a></h4>
<h4><a name="api:mono_debug_add_method">mono_debug_add_method</a></h4>
<h4><a name="api:mono_debug_close_mono_symbol_file">mono_debug_close_mono_symbol_file</a></h4>
<h4><a name="api:mono_debug_find_method">mono_debug_find_method</a></h4>
<h4><a name="api:mono_debug_using_mono_debugger">mono_debug_using_mono_debugger</a></h4>
<h3>Mono Debugger Interface</h3>
<p>These are methods that are invoked by the debugger at
runtime.
<h4><a name="api:mono_debugger_breakpoint_callback">mono_debugger_breakpoint_callback</a></h4>
<h4><a name="api:mono_debugger_check_runtime_version">mono_debugger_check_runtime_version</a></h4>
<h4><a name="api:mono_debugger_event">mono_debugger_event</a></h4>
<h4><a name="api:mono_debugger_handle_exception">mono_debugger_handle_exception</a></h4>
<h4><a name="api:mono_debugger_insert_breakpoint_full">mono_debugger_insert_breakpoint_full</a></h4>
<h4><a name="api:mono_debugger_insert_breakpoint">mono_debugger_insert_breakpoint</a></h4>
<h4><a name="api:mono_debugger_lock">mono_debugger_lock</a></h4>
<h4><a name="api:mono_debugger_method_has_breakpoint">mono_debugger_method_has_breakpoint</a></h4>
<h4><a name="api:mono_debugger_remove_breakpoint">mono_debugger_remove_breakpoint</a></h4>
<h4><a name="api:mono_debugger_runtime_invoke">mono_debugger_runtime_invoke</a></h4>
<h4><a name="api:mono_debugger_unlock">mono_debugger_unlock</a></h4>
<h4><a name="api:mono_debugger_run_finally">mono_debugger_run_finally</a></h4>

View File

@@ -0,0 +1,19 @@
<h1>Decimal Support</h1>
<p>You can use the mono_decimal functions to access and
manipulate <tt>System.Decimal</tt> types from C.
<h4><a name="api:mono_decimal2double">mono_decimal2double</a></h4>
<h4><a name="api:mono_decimal2Int64">mono_decimal2Int64</a></h4>
<h4><a name="api:mono_decimal2string">mono_decimal2string</a></h4>
<h4><a name="api:mono_decimal2UInt64">mono_decimal2UInt64</a></h4>
<h4><a name="api:mono_decimalCompare">mono_decimalCompare</a></h4>
<h4><a name="api:mono_decimalDiv">mono_decimalDiv</a></h4>
<h4><a name="api:mono_decimalFloorAndTrunc">mono_decimalFloorAndTrunc</a></h4>
<h4><a name="api:mono_decimalIncr">mono_decimalIncr</a></h4>
<h4><a name="api:mono_decimalIntDiv">mono_decimalIntDiv</a></h4>
<h4><a name="api:mono_decimalMult">mono_decimalMult</a></h4>
<h4><a name="api:mono_decimalRound">mono_decimalRound</a></h4>
<h4><a name="api:mono_decimalSetExponent">mono_decimalSetExponent</a></h4>
<h4><a name="api:mono_double2decimal">mono_double2decimal</a></h4>
<h4><a name="api:mono_string2decimal">mono_string2decimal</a></h4>

View File

@@ -0,0 +1,54 @@
<h2>Application Domains</h2>
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/appdomain.h&gt;
/* Managed AppDomain */
typedef struct _MonoAppDomain MonoAppDomain;
/* Unmanaged representation */
typedef struct _MonoDomain MonoDomain;
/* Represents System.Runtime.Remoting.Contexts.Context */
typedef struct _MonoAppContext MonoAppContext
@API_IDX@
</div>
<p>Application domains are used to isolate multiple
applications on a single Mono virtual machine. They are
conceptually similiar to processes, the difference is that
processes are managed by the operating system, while
application domains are managed by the Mono virtual machine.
<p>For more information on applications domains see the <a
href="http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx">AppDomain FAQ</a>.
<p>The <tt>MonoDomain</tt> is the unmanaged representation of
the <a
href="http://www.mono-project.com/monodoc/T:System.AppDomain">System.AppDomain</a>
managed type, while the <tt>MonoAppDomain</tt> type represents
the managed version (<tt>MonoAppDomain</tt> has a pointer to
a <tt>MonoDomain</tt>).
<h4><a name="api:mono_domain_assembly_open">mono_domain_assembly_open</a></h4>
<h4><a name="api:mono_domain_create">mono_domain_create</a></h4>
<h4><a name="api:mono_domain_finalize">mono_domain_finalize</a></h4>
<h4><a name="api:mono_domain_foreach">mono_domain_foreach</a></h4>
<h4><a name="api:mono_domain_free">mono_domain_free</a></h4>
<h4><a name="api:mono_domain_get_by_id">mono_domain_get_by_id</a></h4>
<h4><a name="api:mono_domain_get_id">mono_domain_get_id</a></h4>
<h4><a name="api:mono_domain_get">mono_domain_get</a></h4>
<h4><a name="api:mono_domain_has_type_resolve">mono_domain_has_type_resolve</a></h4>
<h4><a name="api:mono_domain_is_unloading">mono_domain_is_unloading</a></h4>
<h4><a name="api:mono_domain_set_internal">mono_domain_set_internal</a></h4>
<h4><a name="api:mono_domain_set">mono_domain_set</a></h4>
<h4><a name="api:mono_domain_try_type_resolve">mono_domain_try_type_resolve</a></h4>
<h4><a name="api:mono_domain_owns_vtable_slot">mono_domain_owns_vtable_slot</a></h4>
<h3>Contexts</h3>
<h4><a name="api:mono_context_get">mono_context_get</a></h4>
<h4><a name="api:mono_context_set">mono_context_set</a></h4>

View File

@@ -0,0 +1,150 @@
<h2>Dynamic Code Generation</h2>
<p>The dynamic code generation interface inside the Mono
runtime is similar to the API exposed by
System.Reflection.Emit.
<p>This interface is used by Mono internally to generate code
on the flight in a cross-platform fashion. For example,
P/Invoke marshalling in Mono is implemented in terms of this
interface, but it is also used in various other parts of the
runtime.
<p>Unlike Reflection.Emit, the dynamic code generation
interface does not start with an assembly builder. The code
generation interface starts directly at the method level,
which is represented by a pointer to the MonoMethodBuilder
structure.
<p>To JIT this method, the process is this:
<ul>
<li>Create a <tt>MonoMethodBuilder</tt> object using
the <tt>mono_mb_new</tt> method. The method's class
is specified as the first argument.
<li>Create the method signature, using
<tt>mono_metadata_signature_alloc</tt>. The call
takes the number of arguments that the method takes.
Then you must initialize the types for each one of the
parameters.
<li>Emit the CIL code, using one of the
<tt>mono_mb_emit_*</tt> functions. There are some
helper routines that you can use.
<li>Create the <tt>MonoMethod</tt> from the
<tt>MethodBuilder</tt> using
<tt>mono_mb_create_method</tt>.
<li>Release the <tt>MonoMethodBuilder</tt> resources
using mono_mb_free.
</ul>
<p>The result of this process is a <tt>MonoMethod</tt> which
can be called using <tt><a
href="api:mono_create_jit_trampoline">mono_create_jit_trampoline</a></tt>
routine or can be passed to any other functions that require
the MonoMethod.
<p>Example:
<pre>
MonoMethod *adder ()
{
MonoMethodBuilder *mb;
MonoMethodSignature *sig;
MonoMethod *method;
mb = mono_mb_new (mono_defaults.object_class, "adder", MONO_WRAPPER_NONE);
/* Setup method signature */
sig = mono_metadata_signature_alloc (2);
sig->ret = &amp;mono_get_int32_class ()->byval_arg;
sig->params [0] = &amp;mono_get_int32_class ()->byval_arg;
sig->params [1] = &amp;mono_defaults.int32_class->byval_arg;
/* Emit CIL code */
mono_mb_emit_ldarg (mb, 0);
mono_mb_emit_ldarg (mb, 1);
mono_mb_emit_byte (mb, CEE_ADD);
mono_mb_emit_byte (mb, CEE_RET);
/* Get the method */
method = mono_mb_create_method (mb, sig, max_stack);
/* Cleanup */
mono_mb-free (mb);
return method;
}
</pre>
<h4><a name="api:mono_mb_new">mono_mb_new</a></h4>
<p>The possible values for the <i>type</i> argument are:
<pre>
MONO_WRAPPER_NONE
MONO_WRAPPER_DELEGATE_INVOKE
MONO_WRAPPER_DELEGATE_BEGIN_INVOKE
MONO_WRAPPER_DELEGATE_END_INVOKE
MONO_WRAPPER_RUNTIME_INVOKE
MONO_WRAPPER_NATIVE_TO_MANAGED
MONO_WRAPPER_MANAGED_TO_NATIVE
MONO_WRAPPER_REMOTING_INVOKE
MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK
MONO_WRAPPER_XDOMAIN_INVOKE
MONO_WRAPPER_XDOMAIN_DISPATCH
MONO_WRAPPER_LDFLD
MONO_WRAPPER_STFLD
MONO_WRAPPER_LDFLD_REMOTE
MONO_WRAPPER_STFLD_REMOTE
MONO_WRAPPER_SYNCHRONIZED
MONO_WRAPPER_DYNAMIC_METHOD
MONO_WRAPPER_ISINST
MONO_WRAPPER_CASTCLASS
MONO_WRAPPER_PROXY_ISINST
MONO_WRAPPER_STELEMREF
MONO_WRAPPER_UNBOX
MONO_WRAPPER_LDFLDA
MONO_WRAPPER_UNKNOWN
</pre>
<h3>Emitting IL</h3>
<p>Functions that can be used to generate IL on the flight,
similar in spirit to System.Reflection.Emit.ILGenerator.
<h4><a name="api:mono_mb_emit_add_to_local">mono_mb_emit_add_to_local</a></h4>
<h4><a name="api:mono_mb_emit_branch">mono_mb_emit_branch</a></h4>
<h4><a name="api:mono_mb_emit_byte">mono_mb_emit_byte</a></h4>
<h4><a name="api:mono_mb_emit_exception">mono_mb_emit_exception</a></h4>
<h4><a name="api:mono_mb_emit_i2">mono_mb_emit_i2</a></h4>
<h4><a name="api:mono_mb_emit_i4">mono_mb_emit_i4</a></h4>
<h4><a name="api:mono_mb_emit_icon">mono_mb_emit_icon</a></h4>
<h4><a name="api:mono_mb_emit_ldarg_addr">mono_mb_emit_ldarg_addr</a></h4>
<h4><a name="api:mono_mb_emit_ldarg">mono_mb_emit_ldarg</a></h4>
<h4><a name="api:mono_mb_emit_ldflda">mono_mb_emit_ldflda</a></h4>
<h4><a name="api:mono_mb_emit_ldloc_addr">mono_mb_emit_ldloc_addr</a></h4>
<h4><a name="api:mono_mb_emit_ldloc">mono_mb_emit_ldloc</a></h4>
<h4><a name="api:mono_mb_emit_ldstr">mono_mb_emit_ldstr</a></h4>
<h4><a name="api:mono_mb_emit_managed_call">mono_mb_emit_managed_call</a></h4>
<h4><a name="api:mono_mb_emit_native_call">mono_mb_emit_native_call</a></h4>
<h4><a name="api:mono_mb_emit_stloc">mono_mb_emit_stloc</a></h4>
<h3>Local variables and Methods</h3>
<h4><a name="api:mono_mb_create_method">mono_mb_create_method</a></h4>
<h4><a name="api:mono_mb_add_data">mono_mb_add_data</a></h4>
<h4><a name="api:mono_mb_add_local">mono_mb_add_local</a></h4>
<h4><a name="api:mono_mb_free">mono_mb_free</a></h4>
<h3>Patching Addresses</h3>
<h4><a name="api:mono_mb_patch_addr">mono_mb_patch_addr</a></h4>
<h4><a name="api:mono_mb_patch_addr_s">mono_mb_patch_addr_s</a></h4>
<h3>Method Signatures</h3>
<h4><a name="api:mono_metadata_signature_alloc">mono_metadata_signature_alloc</a></h4>
<h4><a name="api:mono_metadata_signature_dup">mono_metadata_signature_dup</a></h4>
<h4><a name="api:mono_metadata_signature_equal">mono_metadata_signature_equal</a></h4>

View File

@@ -0,0 +1,168 @@
<h2>Embedding Mono</h2>
<p>The simplest way of embedding Mono is illustrated here:
<pre>
int main (int argc, char *argv)
{
/*
* Load the default Mono configuration file, this is needed
* if you are planning on using the dllmaps defined on the
* system configuration
*/
mono_config_parse (NULL);
/*
* mono_jit_init() creates a domain: each assembly is
* loaded and run in a MonoDomain.
*/
MonoDomain *domain = mono_jit_init ("startup.exe");
/*
* Optionally, add an internal call that your startup.exe
* code can call, this will bridge startup.exe to Mono
*/
mono_add_internal_call ("Sample::GetMessage", getMessage);
/*
* Open the executable, and run the Main method declared
* in the executable
*/
MonoAssembly *assembly = mono_domain_assembly_open (domain, "startup.exe");
if (!assembly)
exit (2);
/*
* mono_jit_exec() will run the Main() method in the assembly.
* The return value needs to be looked up from
* System.Environment.ExitCode.
*/
mono_jit_exec (domain, assembly, argc, argv);
}
/* The C# signature for this method is: string GetMessage () in class Sample */
MonoString*
getMessage ()
{
return mono_string_new (mono_domain_get (), "Hello, world");
}
</pre>
<h4><a name="api:mono_jit_init">mono_jit_init</a></h4>
<h4><a name="api:mono_jit_exec">mono_jit_exec</a></h4>
<h4><a name="api:mono_set_dirs">mono_set_dirs</a></h4>
<h4><a name="api:mono_main">mono_main</a></h4>
<h4><a name="api:mono_parse_default_optimizations">mono_parse_default_optimizations</a></h4>
<h4><a name="api:mono_jit_cleanup">mono_jit_cleanup</a></h4>
<h4><a name="api:mono_set_defaults">mono_set_defaults</a></h4>
<h3>Internal Calls</h3>
<p>The Mono runtime provides two mechanisms to expose C code
to the CIL universe: internal calls and native C
code. Internal calls are tightly integrated with the runtime,
and have the least overhead, as they use the same data types
that the runtime uses.
<p>The other option is to use the Platform Invoke (P/Invoke)
to call C code from the CIL universe, using the standard
<a href="http://www.mono-project.com/Interop_with_Native_Libraries">P/Invoke</a>
mechanisms.
<p>To register an internal call, use this call you use the
<a href="#api:mono_add_internal_call"><tt>mono_add_internal_call</tt>
routine.
<h4><a name="api:mono_add_internal_call">mono_add_internal_call</a></h4>
<h3>P/Invoke with embedded applications</h3>
<p>Unlike internal calls, Platform/Invoke is easier to use and
more portable. It allows you to share code with Windows and
.NET that have a different setup for internal calls to their
own runtime.
<p>Usually P/Invoke declarations reference external libraries
like:
<pre>
[DllImport ("opengl")]
void glBegin (GLEnum mode)
</pre>
<p>Mono extends P/Invoke to support looking up symbols not in
an external library, but looking up those symbols into the
same address space as your program, to do this, use the
special library name "__Internal". This will direct Mono to
lookup the method in your own process.
<p>There are situations where the host operating system does
not support looking up symbols on the process address space.
For situations like this you can use
the <a href="#api:mono_dl_register_library">mono_dl_register_library</a>.
<h4><a name="api:mono_dl_register_library">mono_dl_register_library</h4>
<h3>Data Marshalling</h3>
<p>Managed objects are represented as <tt>MonoObject*</tt>
types. Those objects that the runtime consumes directly have
more specific C definitions (for example strings are of type
<tt>MonoString *</tt>, delegates are of type
<tt>MonoDelegate*</tt> but they are still <tt>MonoObject
*</tt>s).
<p>As of Mono 1.2.x types defined in mscorlib.dll do not have
their fields reordered in any way. But other libraries might
have their fields reordered. In these cases, Managed
structures and objects have the same layout in the C# code as
they do in the unmanaged world.
<p>Structures defined outside corlib must have a specific
StructLayout definition, and have it set as sequential if you
plan on accessing these fields directly from C code.
<p><b>Important</B> Internal calls do not provide support for
marshalling structures. This means that any API calls that
take a structure (excluding the system types like int32,
int64, etc) must be passed as a pointer, in C# this means
passing the value as a "ref" or "out" parameter.
<h3>Mono Runtime Configuration</h3>
<p>Certain features of the Mono runtime, like DLL mapping, are
available through a configuration file that is loaded at
runtime. The default Mono implementation loads the
configuration file from <tt>$sysconfig/mono/config</tt>
(typically this is <tt>/etc/mono/config</tt>).
<p>See the <tt>mono-config(5)</tt> man page for more details
on what goes in this file.
<p>The following APIs expose this functionality:
<h4><a name="api:mono_config_parse">mono_config_parse</a></h4>
<h4><a name="api:mono_config_parse_memory">mono_config_parse_memory</a></h4>
<h4><a name="api:mono_get_config_dir">mono_get_config_dir</a></h4>
<h3>Function Pointers</h3>
<p>To wrap a function pointer into something that the Mono
runtime can consume, you should use the mono_create_ftnptr.
This is only important if you plan on running on the IA64
architecture. Otherwise you can just use the function
pointer address.
<h4><a name="api:mono_create_ftnptr">mono_create_ftnptr</a></h4>
<h3>Advanced Execution Setups</h3>
<p>These are not recommended ways of initializing Mono, they
are done internally by mono_jit_init, but are here to explain
what happens internally.
<h4><a name="api:mono_runtime_exec_managed_code">mono_runtime_exec_managed_code</a></h4>
<h4><a name="api:mono_runtime_exec_main">mono_runtime_exec_main</a></h4>
<h4><a name="api:mono_init_from_assembly">mono_init_from_assembly</a></h4>
<h4><a name="api:mono_init">mono_init</a></h4>
<h4><a name="api:mono_init_version">mono_init_version</a></h4>

View File

@@ -0,0 +1,58 @@
<h2>Exception Handling</h2>
<div class="header">
@API_IDX@
</div>
<h3>Raising and Catching exceptions</h3>
<h4><a name="api:mono_raise_exception">mono_raise_exception</a></h4>
<h4><a name="api:mono_unhandled_exception">mono_unhandled_exception</a></h4>
<h4><a name="api:mono_print_unhandled_exception">mono_print_unhandled_exception</a></h4>
<h3>Exception Types: General API</h3>
<h4><a name="api:mono_exception_from_name_domain">mono_exception_from_name_domain</a></h4>
<h4><a name="api:mono_exception_from_name">mono_exception_from_name</a></h4>
<h4><a name="api:mono_exception_from_name_msg">mono_exception_from_name_msg</a></h4>
<h4><a name="api:mono_exception_from_name_two_strings">mono_exception_from_name_two_strings</a></h4>
<h3>Obtaining Common Exceptions</h3>
<p>There are a number of common exceptions that are used by
the runtime, use the routines in this section to get a copy of
those exceptions.
<h4><a name="api:mono_get_exception_appdomain_unloaded">mono_get_exception_appdomain_unloaded</a></h4>
<h4><a name="api:mono_get_exception_argument">mono_get_exception_argument</a></h4>
<h4><a name="api:mono_get_exception_argument_null">mono_get_exception_argument_null</a></h4>
<h4><a name="api:mono_get_exception_argument_out_of_range">mono_get_exception_argument_out_of_range</a></h4>
<h4><a name="api:mono_get_exception_arithmetic">mono_get_exception_arithmetic</a></h4>
<h4><a name="api:mono_get_exception_array_type_mismatch">mono_get_exception_array_type_mismatch</a></h4>
<h4><a name="api:mono_get_exception_bad_image_format">mono_get_exception_bad_image_format</a></h4>
<h4><a name="api:mono_get_exception_cannot_unload_appdomain">mono_get_exception_cannot_unload_appdomain</a></h4>
<h4><a name="api:mono_get_exception_class">mono_get_exception_class</a></h4>
<h4><a name="api:mono_get_exception_divide_by_zero">mono_get_exception_divide_by_zero</a></h4>
<h4><a name="api:mono_get_exception_execution_engine">mono_get_exception_execution_engine</a></h4>
<h4><a name="api:mono_get_exception_file_not_found2">mono_get_exception_file_not_found2</a></h4>
<h4><a name="api:mono_get_exception_file_not_found">mono_get_exception_file_not_found</a></h4>
<h4><a name="api:mono_get_exception_index_out_of_range">mono_get_exception_index_out_of_range</a></h4>
<h4><a name="api:mono_get_exception_invalid_cast">mono_get_exception_invalid_cast</a></h4>
<h4><a name="api:mono_get_exception_io">mono_get_exception_io</a></h4>
<h4><a name="api:mono_get_exception_missing_method">mono_get_exception_missing_method</a></h4>
<h4><a name="api:mono_get_exception_not_implemented">mono_get_exception_not_implemented</a></h4>
<h4><a name="api:mono_get_exception_null_reference">mono_get_exception_null_reference</a></h4>
<h4><a name="api:mono_get_exception_overflow">mono_get_exception_overflow</a></h4>
<h4><a name="api:mono_get_exception_security">mono_get_exception_security</a></h4>
<h4><a name="api:mono_get_exception_serialization">mono_get_exception_serialization</a></h4>
<h4><a name="api:mono_get_exception_stack_overflow">mono_get_exception_stack_overflow</a></h4>
<h4><a name="api:mono_get_exception_synchronization_lock">mono_get_exception_synchronization_lock</a></h4>
<h4><a name="api:mono_get_exception_thread_abort">mono_get_exception_thread_abort</a></h4>
<h4><a name="api:mono_get_exception_thread_state">mono_get_exception_thread_state</a></h4>
<h4><a name="api:mono_get_exception_type_initialization">mono_get_exception_type_initialization</a></h4>
<h4><a name="api:mono_get_exception_type_load">mono_get_exception_type_load</a></h4>
<h4><a name="api:mono_get_exception_invalid_operation">mono_get_exception_invalid_operation</a></h4>
<h4><a name="api:mono_get_exception_missing_field">mono_get_exception_missing_field</a></h4>
<h4><a name="api:mono_get_exception_not_supported">mono_get_exception_not_supported</a></h4>
<h4><a name="api:mono_get_exception_reflection_type_load">mono_get_exception_reflection_type_load</a></h4>

View File

@@ -0,0 +1,12 @@
<h1>Garbage Collector Interface</h1>
<h1>Public Interface</h1>
<p>The public interface of the Mono GC is fairly limited, and
its the only one that embedders should be using:
<h4><a name="api:mono_gc_collect">mono_gc_collect</a></h4>
<h4><a name="api:mono_gc_max_generation">mono_gc_max_generation</a></h4>
<h4><a name="api:mono_gc_get_heap_size">mono_gc_get_heap_size</a></h4>
<h4><a name="api:mono_gc_get_used_size">mono_gc_get_used_size</a></h4>

View File

@@ -0,0 +1,94 @@
<h1>GC Handles</h1>
<h3>Synopsys</h3>
<div class="header">
@API_IDX@
</div>
<p>GC handles are wrappers that are used to keep references to
managed objects in the unmanaged space and preventing the
object from being disposed.
<p>These are the C equivalents of the <tt>System.GCHandle</tt>
structure.
<p>There are two kinds of GCHandles that can be created:
<ul>
<li>Handles to objects (use <tt><a
href="#api:mono_gchandle_new">mono_gchandle_new</a></tt>).
<li>Weak handles to objects (use <tt><a
href="#api:mono_gchandle_new_weakref">mono_gchandle_new_weakref</a></tt>).
Weak handles can have the objects reclaimed by the
garbage collector.
</ul>
<p>To retrieve the target address of an object pointed to by a
<tt>GCHandle</tt> you should use
<tt>mono_gchandle_get_target</tt>.
<p>For example, consider the following C code:
<div class="code">
static MonoObject* o = NULL;
</div>
<p>The object in `o' will *NOT* be scanned.
<p>If you need to store an object in a C variable and prevent
it from being collected, you need to acquire a GC handle for
it.
<div class="code">
guint32 handle = mono_gchandle_new (my_object, TRUE);
</div>
<p>TRUE means the object will be pinned, so it won't move in
memory when we'll use a moving GC. You can access the
MonoObject* referenced by a handle with:
<div class="code">
MonoObject* obj = mono_gchandle_get_target (handle);
</div>
<p>When you don't need the handle anymore you need to call:
<div class="code">
mono_gchandle_free (handle);
</div>
<p>Note that if you assign a new object to the C var, you need
to get a new handle, it's not enough to store a new object in
the C var.
<p>So code that looked like this:
<div class="code">
static MonoObject* o = NULL;
...
o = mono_object_new (...);
/* use o */
...
/* when done to allow the GC to collect o */
o = NULL;
</div>
<p>should now be changed to:
<div class="code">
static guint32 o_handle;
...
MonoObject *o = mono_object_new (...);
o_handle = mono_gchandle_new (o, TRUE);
/* use o or mono_gchandle_get_target (o_handle) */
...
/* when done to allow the GC to collect o */
mono_gchandle_free (o_handle);
</div>
<h4><a name="api:mono_gchandle_new">mono_gchandle_new</a></h4>
<h4><a name="api:mono_gchandle_new_weakref">mono_gchandle_new_weakref</a></h4>
<h4><a name="api:mono_gchandle_get_target">mono_gchandle_get_target</a></h4>
<h4><a name="api:mono_gchandle_free">mono_gchandle_free</a></h4>

View File

@@ -0,0 +1,66 @@
<h2>Image Manipulation</h2>
<p>Images are the component of assemblies that actually hold
the CIL code and <a href="mono-api-metadata.html">metadata</a>
in the extended PE/COFF file.
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/image.h&gt;
typedef struct _MonoImage MonoImage;
typedef enum {
MONO_IMAGE_OK,
MONO_IMAGE_ERROR_ERRNO,
MONO_IMAGE_MISSING_ASSEMBLYREF,
MONO_IMAGE_IMAGE_INVALID
} MonoImageOpenStatus;
@API_IDX@
</div>
<h3>Image APIs</h3>
<p>Images are the actual elements in the runtime that contain
the actual code being executed.
<a name="cil_image_open"/>
<h3>Opening and closing MonoImages</h3>
<h4><a name="api:mono_image_open">mono_image_open</a></h4>
<h4><a name="api:mono_image_open_full">mono_image_open_full</a></h4>
<h4><a name="api:mono_image_open_from_data">mono_image_open_from_data</a></h4>
<h4><a name="api:mono_image_open_from_data_full">mono_image_open_from_data_full</a></h4>
<h4><a name="api:mono_image_close">mono_image_close</a></h4>
<h4><a name="api:mono_image_addref">mono_image_addref</a></h4>
<h4><a name="api:mono_image_load_file_for_image">mono_image_load_file_for_image</a></h4>
<h3>Image Information</h3>
<h4><a name="api:mono_image_get_guid">mono_image_get_guid</a></h4>
<h4><a name="api:mono_image_get_assembly">mono_image_get_assembly</a></h4>
<h4><a name="api:mono_image_get_entry_point">mono_image_get_entry_point</a></h4>
<h4><a name="api:mono_image_get_filename">mono_image_get_filename</a></h4>
<h4><a name="api:mono_image_get_name">mono_image_get_name</a></h4>
<h4><a name="api:mono_image_get_resource">mono_image_get_resource</a></h4>
<h4><a name="api:mono_image_get_table_info">mono_image_get_table_info</a></h4>
<h4><a name="api:mono_image_get_table_rows">mono_image_get_table_rows</a></h4>
<h4><a name="api:mono_image_is_dynamic">mono_image_is_dynamic</a></h4>
<h4><a name="api:mono_image_loaded_by_guid">mono_image_loaded_by_guid</a></h4>
<h4><a name="api:mono_image_loaded">mono_image_loaded</a></h4>
<h4><a name="api:mono_image_lookup_resource">mono_image_lookup_resource</a></h4>
<h4><a name="api:mono_image_strerror">mono_image_strerror</a></h4>
<h3>Public Keys, Strong Names and Certificates</h3>
<h4><a name="api:mono_image_strong_name_position">mono_image_strong_name_position</a></h4>
<h4><a name="api:mono_image_get_public_key">mono_image_get_public_key</a></h4>
<h4><a name="api:mono_image_get_strong_name">mono_image_get_strong_name</a></h4>
<h4><a name="api:mono_image_has_authenticode_entry">mono_image_has_authenticode_entry</a></h4>
<h3>Low-level features</h3>
<h4><a name="api:mono_image_rva_map">mono_image_rva_map</a></h4>
<h4><a name="api:mono_image_ensure_section_idx">mono_image_ensure_section_idx</a></h4>
<h4><a name="api:mono_image_ensure_section">mono_image_ensure_section</a></h4>

View File

@@ -0,0 +1,114 @@
<h1>Mono Internals</h1>
<p>This section documents some of the internal APIs used
inside Mono that developers extending or altering Mono might
want to use.
<h2>Marshalling functions</h2>
<h4><a name="api:mono_marshal_alloc">mono_marshal_alloc</a></h4>
<h4><a name="api:mono_marshal_asany">mono_marshal_asany</a></h4>
<h4><a name="api:mono_marshal_free_array">mono_marshal_free_array</a></h4>
<h4><a name="api:mono_marshal_free_asany">mono_marshal_free_asany</a></h4>
<h4><a name="api:mono_marshal_free">mono_marshal_free</a></h4>
<h4><a name="api:mono_marshal_get_castclass">mono_marshal_get_castclass</a></h4>
<h4><a name="api:mono_marshal_get_delegate_begin_invoke">mono_marshal_get_delegate_begin_invoke</a></h4>
<h4><a name="api:mono_marshal_get_delegate_end_invoke">mono_marshal_get_delegate_end_invoke</a></h4>
<h4><a name="api:mono_marshal_get_delegate_invoke">mono_marshal_get_delegate_invoke</a></h4>
<h4><a name="api:mono_marshal_get_icall_wrapper">mono_marshal_get_icall_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_isinst">mono_marshal_get_isinst</a></h4>
<h4><a name="api:mono_marshal_get_ldfld_remote_wrapper">mono_marshal_get_ldfld_remote_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_ldfld_wrapper">mono_marshal_get_ldfld_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_managed_wrapper">mono_marshal_get_managed_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_native_wrapper">mono_marshal_get_native_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_proxy_cancast">mono_marshal_get_proxy_cancast</a></h4>
<h4><a name="api:mono_marshal_get_ptr_to_struct">mono_marshal_get_ptr_to_struct</a></h4>
<h4><a name="api:mono_marshal_get_remoting_invoke_for_target">mono_marshal_get_remoting_invoke_for_target</a></h4>
<h4><a name="api:mono_marshal_get_remoting_invoke">mono_marshal_get_remoting_invoke</a></h4>
<h4><a name="api:mono_marshal_get_remoting_invoke_with_check">mono_marshal_get_remoting_invoke_with_check</a></h4>
<h4><a name="api:mono_marshal_get_runtime_invoke">mono_marshal_get_runtime_invoke</a></h4>
<h4><a name="api:mono_marshal_get_stelemref">mono_marshal_get_stelemref</a></h4>
<h4><a name="api:mono_marshal_get_stfld_remote_wrapper">mono_marshal_get_stfld_remote_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_stfld_wrapper">mono_marshal_get_stfld_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_struct_to_ptr">mono_marshal_get_struct_to_ptr</a></h4>
<h4><a name="api:mono_marshal_get_synchronized_wrapper">mono_marshal_get_synchronized_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_unbox_wrapper">mono_marshal_get_unbox_wrapper</a></h4>
<h4><a name="api:mono_marshal_get_xappdomain_invoke">mono_marshal_get_xappdomain_invoke</a></h4>
<h4><a name="api:mono_marshal_load_type_info">mono_marshal_load_type_info</a></h4>
<h4><a name="api:mono_marshal_method_from_wrapper">mono_marshal_method_from_wrapper</a></h4>
<h4><a name="api:mono_marshal_realloc">mono_marshal_realloc</a></h4>
<h4><a name="api:mono_marshal_set_last_error">mono_marshal_set_last_error</a></h4>
<h4><a name="api:mono_marshal_type_size">mono_marshal_type_size</a></h4>
<h2>Metadata Loading Errors</h2>
<p>The routines in this section are used to cope with errors
during metadata loading. Errors in metadata handling can
happen for many reason, and these include (this is not an
exhaustive list).
<ul>
<li>An assembly referenced is missing.
<li>Fields referenced are missing.
<li>Methods referenced are missing.
</ul>
<p>The <tt>mono_loader_set_*</tt> routines are invoked during
metadata loading to flag that an error has happened. The
class loading errros are flagged in a per-thread basis.
<P>In various spots in the runtime the
<tt>mono_loader_get_last_error</tt> routine is called to check
if there was a problem, and then errors are propagated upwards
on the stack until we reach a point where an exception can be
raised and no runtime locks are held.
<p>The <tt>mono_loader_error_prepare_exception</tt> takes a
<tt>MonoLoaderError</tt> structure (the value returned from
<tt>mono_loader_get_last_error</tt>), turns that into an
exception and clears the error condition from the current
thread.
<h4><a name="api:mono_loader_set_error_field_load">mono_loader_set_error_field_load</a></h4>
<h4><a name="api:mono_loader_set_error_method_load">mono_loader_set_error_method_load</a></h4>
<h4><a name="api:mono_loader_set_error_type_load">mono_loader_set_error_type_load</a></h4>
<h4><a name="api:mono_loader_get_last_error">mono_loader_get_last_error</a></h4>
<h4><a name="api:mono_loader_clear_error">mono_loader_clear_error</a></h4>
<h4><a name="api:mono_loader_error_prepare_exception">mono_loader_error_prepare_exception</a></h4>
<h2>Metadata Loader Locking: Internals</h2>
<p>The locking functions here are used by code in class.c and
metadata.c to lock access to the shared hashtables inside the
MonoImage.
<h4><a name="api:mono_loader_lock">mono_loader_lock</a></h4>
<h4><a name="api:mono_loader_unlock">mono_loader_unlock</a></h4>
<h2>Garbage Collector Internal Interface</h2>
<p>The internal interface of the Mono GC is the interface used
between the runtime engine and the garbage collector.
<h4><a name="api:mono_gc_disable">mono_gc_disable</a></h4>
<h4><a name="api:mono_gc_enable">mono_gc_enable</a></h4>
<h4><a name="api:mono_gc_is_finalizer_thread">mono_gc_is_finalizer_thread</a></h4>
<h4><a name="api:mono_gc_out_of_memory">mono_gc_out_of_memory</a></h4>
<h4><a name="api:mono_gc_start_world">mono_gc_start_world</a></h4>
<h4><a name="api:mono_gc_stop_world">mono_gc_stop_world</a></h4>
<h4><a name="api:mono_gc_alloc_fixed">mono_gc_alloc_fixed</a></h4>
<h4><a name="api:mono_gc_enable_events">mono_gc_enable_events</a></h4>
<h4><a name="api:mono_gc_free_fixed">mono_gc_free_fixed</a></h4>
<h4><a name="api:mono_gc_make_descr_from_bitmap">mono_gc_make_descr_from_bitmap</a></h4>
<h4><a name="api:mono_gc_base_init">mono_gc_base_init</a></h4>
<h4><a name="api:mono_gc_invoke_finalizers">mono_gc_invoke_finalizers</a></h4>
<h4><a name="api:mono_gc_is_gc_thread">mono_gc_is_gc_thread</a></h4>
<h4><a name="api:mono_gc_pending_finalizers">mono_gc_pending_finalizers</a></h4>
<h4><a name="api:mono_gc_register_thread">mono_gc_register_thread</a></h4>
<h4><a name="api:mono_gc_finalize_notify">mono_gc_finalize_notify</a></h4>

View File

@@ -0,0 +1,20 @@
<h2>Synopsis</h2>
<div class="header">
@API_IDX@
</div>
<h3>Useful Debugging Functions</h3>
<p>These functions are useful when running the Mono VM inside
a debugger.
<h4><a name="api:mono_pmip">mono_pmip</a></h4>
<h4><a name="api:mono_print_method_from_ip">mono_print_method_from_ip</a></h4>
<h4><a name="api:mono_print_thread_dump">mono_print_thread_dump</a></h4>
<h4><a name="api:mono_threads_request_thread_dump">mono_threads_request_thread_dump</a></h4>
<h3>Helper Tools For Native Ports</h3>
<h4><a name="api:mono_inst_name">mono_inst_name</a></h4>

View File

@@ -0,0 +1,37 @@
<h1>Notification Interface</h1>
<p>This is an internal profiler interface. In general, users
would not be using this interface, but would be using the
profiler interface.
<p>These methods must be called to notify the profiler of an
event that must be recorded. Mono's JIT engine currently
calls these routines, but if you are extending Mono in some
way these are the methods that you might invoke to notify the
profiler of an event.
<h4><a name="api:mono_profiler_load">mono_profiler_load</a></h4>
<h4><a name="api:mono_profiler_allocation">mono_profiler_allocation</a></h4>
<h4><a name="api:mono_profiler_stat_hit">mono_profiler_stat_hit</a></h4>
<h4><a name="api:mono_profiler_thread_start">mono_profiler_thread_start</a></h4>
<h4><a name="api:mono_profiler_thread_end">mono_profiler_thread_end</a></h4>
<h4><a name="api:mono_profiler_appdomain_event">mono_profiler_appdomain_event</a></h4>
<h4><a name="api:mono_profiler_appdomain_loaded">mono_profiler_appdomain_loaded</a></h4>
<h4><a name="api:mono_profiler_assembly_event">mono_profiler_assembly_event</a></h4>
<h4><a name="api:mono_profiler_assembly_loaded">mono_profiler_assembly_loaded</a></h4>
<h4><a name="api:mono_profiler_class_event">mono_profiler_class_event</a></h4>
<h4><a name="api:mono_profiler_class_loaded">mono_profiler_class_loaded</a></h4>
<h4><a name="api:mono_profiler_code_transition">mono_profiler_code_transition</a></h4>
<h4><a name="api:mono_profiler_method_end_jit">mono_profiler_method_end_jit</a></h4>
<h4><a name="api:mono_profiler_method_enter">mono_profiler_method_enter</a></h4>
<h4><a name="api:mono_profiler_method_jit">mono_profiler_method_jit</a></h4>
<h4><a name="api:mono_profiler_method_leave">mono_profiler_method_leave</a></h4>
<h4><a name="api:mono_profiler_module_event">mono_profiler_module_event</a></h4>
<h4><a name="api:mono_profiler_module_loaded">mono_profiler_module_loaded</a></h4>
<h4><a name="api:mono_profiler_shutdown">mono_profiler_shutdown</a></h4>
<h4><a name="api:mono_profiler_startup">mono_profiler_startup</a></h4>
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
<h4><a name="api:mono_profiler_stat_hit">mono_profiler_stat_hit</a></h4>

View File

@@ -0,0 +1,6 @@
<h4><a name="api:mono_delegate_free_ftnptr">mono_delegate_free_ftnptr</a></h4>
<h4><a name="api:mono_delegate_to_ftnptr">mono_delegate_to_ftnptr</a></h4>
<h4><a name="api:mono_ftnptr_to_delegate">mono_ftnptr_to_delegate</a></h4>
<h4><a name="api:mono_marshal_string_to_utf16">mono_marshal_string_to_utf16</a></h4>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,77 @@
<h3>Methods</h3>
<h3>Invoking Methods</h3>
<h4><a name="api:mono_runtime_invoke">mono_runtime_invoke</a></h4>
If you want to invoke generic methods, you must call the method on the
"inflated" class, which you can obtain from the
<tt>mono_object_get_class()</tt>
<div class="code">
MonoClass *clazz;
MonoMethod *method;
clazz = mono_object_get_class (obj);
/*
* If there are more Add methods declared, you
* may use mono_method_desc_search_in_class (clazz, ":Add(T)"),
* you must substitute ":Add(T)" with the correct type, for example
* for List&lt;int&gt;, you would use ":Add(int)".
*/
method = mono_class_get_method_from_name (clazz, "Add", 1);
mono_runtime_invoke (method, obj, args, &amp;exception);
</div>
<h4><a name="api:mono_runtime_invoke_array">mono_runtime_invoke_array</a></h4>
<h4><a name="api:mono_runtime_delegate_invoke">mono_runtime_delegate_invoke</a></h4>
<h4><a name="api:mono_method_body_get_object">mono_method_body_get_object</a></h4>
<h4><a name="api:mono_method_desc_free">mono_method_desc_free</a></h4>
<h4><a name="api:mono_method_desc_from_method">mono_method_desc_from_method</a></h4>
<h4><a name="api:mono_method_desc_full_match">mono_method_desc_full_match</a></h4>
<h4><a name="api:mono_method_desc_match">mono_method_desc_match</a></h4>
<h4><a name="api:mono_method_desc_new">mono_method_desc_new</a></h4>
<h4><a name="api:mono_method_desc_search_in_class">mono_method_desc_search_in_class</a></h4>
<h4><a name="api:mono_method_desc_search_in_image">mono_method_desc_search_in_image</a></h4>
<h4><a name="api:mono_method_full_name">mono_method_full_name</a></h4>
<h4><a name="api:mono_method_get_class">mono_method_get_class</a></h4>
<h4><a name="api:mono_method_get_flags">mono_method_get_flags</a></h4>
<h4><a name="api:mono_method_get_last_managed">mono_method_get_last_managed</a></h4>
<h4><a name="api:mono_method_get_marshal_info">mono_method_get_marshal_info</a></h4>
<h4><a name="api:mono_method_get_name">mono_method_get_name</a></h4>
<h4><a name="api:mono_method_get_object">mono_method_get_object</a></h4>
<h4><a name="api:mono_method_get_param_names">mono_method_get_param_names</a></h4>
<h4><a name="api:mono_method_get_param_token">mono_method_get_param_token</a></h4>
<h4><a name="api:mono_method_get_signature">mono_method_get_signature</a></h4>
<h4><a name="api:mono_method_get_index">mono_method_get_index</a></h4>
<h4><a name="api:mono_method_get_signature_full">mono_method_get_signature_full</a></h4>
<h4><a name="api:mono_method_get_token">mono_method_get_token</a></h4>
<h4><a name="api:mono_method_has_marshal_info">mono_method_has_marshal_info</a></h4>
<h4><a name="api:mono_method_verify">mono_method_verify</a></h4>
<h3>Method Signatures</h3>
<h4><a name="api:mono_method_signature">mono_method_signature</a></h4>
<h4><a name="api:mono_signature_explicit_this">mono_signature_explicit_this</a></h4>
<h4><a name="api:mono_signature_get_call_conv">mono_signature_get_call_conv</a></h4>
<h4><a name="api:mono_signature_get_desc">mono_signature_get_desc</a></h4>
<h4><a name="api:mono_signature_get_param_count">mono_signature_get_param_count</a></h4>
<h4><a name="api:mono_signature_get_params">mono_signature_get_params</a></h4>
<h4><a name="api:mono_signature_get_return_type">mono_signature_get_return_type</a></h4>
<h4><a name="api:mono_signature_hash">mono_signature_hash</a></h4>
<h4><a name="api:mono_signature_is_instance">mono_signature_is_instance</a></h4>
<h4><a name="api:mono_signature_vararg_start">mono_signature_vararg_start</a></h4>
<h4><a name="api:mono_param_get_objects">mono_param_get_objects</a></h4>
<h4><a name="api:mono_get_method_full">mono_get_method_full</a></h4>
<h4><a name="api:mono_get_method">mono_get_method</a></h4>
<h3>Methods Header Operations</h3>
<h4><a name="api:mono_method_get_header">mono_method_get_header</a></h4>
<h4><a name="api:mono_method_header_get_clauses">mono_method_header_get_clauses</a></h4>
<h4><a name="api:mono_method_header_get_code">mono_method_header_get_code</a></h4>
<h4><a name="api:mono_method_header_get_locals">mono_method_header_get_locals</a></h4>
<h4><a name="api:mono_method_header_get_num_clauses">mono_method_header_get_num_clauses</a></h4>

View File

@@ -0,0 +1,193 @@
<h1>Object API</h1>
<p>The object API deals with all the operations shared by
<a href="#objects">objects</a>, <a href="#valuetypes">value
types</a>, <a href="#arrays">arrays</a>.
<p>The object API has methods for accessing <a
href="#fields">fields</a>, <a
href="#properties">properties</a>, <a
href="#events">events</a>, <a href="#delegates">delegates</a>.
<p>There are some advanced uses that are useful to document
here dealing with <a href="#remote">remote fields</a>.
<h2>Synopsis</h2>
<div class="header">
#include &lt;metadata/object.h&gt;
typedef struct MonoVTable MonoVTable;
typedef struct _MonoThreadsSync MonoThreadsSync;
typedef struct {
MonoVTable *vtable;
MonoThreadsSync *synchronisation;
} MonoObject;
typedef struct {
guint32 length;
guint32 lower_bound;
} MonoArrayBounds;
typedef struct {
MonoObject obj;
/* bounds is NULL for szarrays */
MonoArrayBounds *bounds;
/* total number of elements of the array */
guint32 max_length;
/* we use double to ensure proper alignment on platforms that need it */
double vector [MONO_ZERO_LEN_ARRAY];
} MonoArray;
@API_IDX@
</div>
<p>MonoObject is the base definition for all managed objects
in the Mono runtime, it represents the <a
href="http://www.mono-project.com/monodoc/T:System.Object">System.Object</a>
managed type.
<p>All objects that derive from <a
href="http://www.mono-project.com/monodoc/T:System.Object">System.Object</a>
do have this base definition. Derived objects are declared
following the pattern where the parent class is the first
field of a structure definition, for example:
<div class="code">
typedef struct {
MonoObject parent;
int my_new_field;
} MyNewObject
</div>
<a name="objects"></a>
<h2>Core Object Methods</h2>
<h4><a name="api:mono_object_new">mono_object_new</a></h4>
<p>For example, if you wanted to create an object of type
System.Version, you would use a piece of code like this:
<div class="code">
MonoClass *version_class;
MonoObject *result;
/* Get the class from mscorlib */
version_class = mono_class_from_name (mono_get_corlib (),
"System", "Version");
/* Create an object of that class */
result = mono_object_new (mono_domain_get (), version_class);
</div>
<h4><a name="api:mono_object_new_alloc_specific">mono_object_new_alloc_specific</a></h4>
<h4><a name="api:mono_object_new_fast">mono_object_new_fast</a></h4>
<h4><a name="api:mono_object_new_from_token">mono_object_new_from_token</a></h4>
<h4><a name="api:mono_object_new_specific">mono_object_new_specific</a></h4>
<h4><a name="api:mono_object_clone">mono_object_clone</a></h4>
<h4><a name="api:mono_object_get_class">mono_object_get_class</a></h4>
<h4><a name="api:mono_object_get_domain">mono_object_get_domain</a></h4>
<h4><a name="api:mono_object_get_virtual_method">mono_object_get_virtual_method</a></h4>
<h4><a name="api:mono_object_isinst_mbyref">mono_object_isinst_mbyref</a></h4>
<h4><a name="api:mono_object_isinst">mono_object_isinst</a></h4>
<h4><a name="api:mono_object_unbox">mono_object_unbox</a></h4>
<h4><a name="api:mono_object_castclass_mbyref">mono_object_castclass_mbyref</a></h4>
<h4><a name="api:mono_object_is_alive">mono_object_is_alive</a></h4>
<h4><a name="api:mono_object_get_size">mono_object_get_size</a></h4>
<a name="valuetypes"></a>
<h2>Value Types</h2>
<h4><a name="api:mono_value_box">mono_value_box</a></h4>
<h4><a name="api:mono_value_copy">mono_value_copy</a></h4>
<h4><a name="api:mono_value_copy_array">mono_value_copy_array</a></h4>
<a name="arrays"></a>
<h2>Array Methods</h2>
<p>Use the <tt>mono_array_new_*</tt> methods to create arrays
of a given type.
<p>For example, the following code creates an array with two
elements of type <tt>System.Byte</tt>, and sets the values
0xca and 0xfe on it:
<pre class="code">
MonoArray *CreateByteArray (MonoDomain *domain)
{
MonoArray *data;
data = mono_array_new (domain, mono_get_byte_class (), 2);
mono_array_set (data, guint8, 0, 0xca);
mono_array_set (data, guint8, 0, 0xfe);
return data;
}
</pre>
<h3>Creating Arrays</h3>
<h4><a name="api:mono_array_new">mono_array_new</a></h4>
<h4><a name="api:mono_array_new_full">mono_array_new_full</a></h4>
<h4><a name="api:mono_array_new_specific">mono_array_new_specific</a></h4>
<h4><a name="api:mono_array_class_get">mono_array_class_get</a></h4>
<h4><a name="api:mono_array_clone">mono_array_clone</a></h4>
<h3>Using Arrays</h3>
<h4><a name="api:mono_array_set">mono_array_set</a></h4>
<h4><a name="api:mono_array_setref">mono_array_setref</a></h4>
<h4><a name="api:mono_array_length">mono_array_length</a></h4>
<h4><a name="api:mono_array_addr">mono_array_addr</a></h4>
<h4><a name="api:mono_array_addr_with_size">mono_array_addr_with_size</a></h4>
<h4><a name="api:mono_array_get">mono_array_get</a></h4>
<h4><a name="api:mono_array_element_size">mono_array_element_size</a></h4>
<a name="fields"></a>
<h2>Fields</h2>
<h4><a name="api:mono_field_from_token">mono_field_from_token</a></h4>
<h4><a name="api:mono_field_get_flags">mono_field_get_flags</a></h4>
<h4><a name="api:mono_field_get_name">mono_field_get_name</a></h4>
<h4><a name="api:mono_field_get_parent">mono_field_get_parent</a></h4>
<h4><a name="api:mono_field_get_type">mono_field_get_type</a></h4>
<h4><a name="api:mono_field_get_value">mono_field_get_value</a></h4>
<h4><a name="api:mono_field_get_value_object">mono_field_get_value_object</a></h4>
<h4><a name="api:mono_field_set_value">mono_field_set_value</a></h4>
<h4><a name="api:mono_field_static_get_value">mono_field_static_get_value</a></h4>
<h4><a name="api:mono_field_static_set_value">mono_field_static_set_value</a></h4>
<h4><a name="api:mono_field_get_object">mono_field_get_object</a></h4>
<a name="properties"></a>
<h2>Properties</h2>
<h4><a name="api:mono_property_get_object">mono_property_get_object</a></h4>
<h4><a name="api:mono_property_get_flags">mono_property_get_flags</a></h4>
<h4><a name="api:mono_property_get_get_method">mono_property_get_get_method</a></h4>
<h4><a name="api:mono_property_get_name">mono_property_get_name</a></h4>
<h4><a name="api:mono_property_get_parent">mono_property_get_parent</a></h4>
<h4><a name="api:mono_property_get_set_method">mono_property_get_set_method</a></h4>
<h4><a name="api:mono_property_get_value">mono_property_get_value</a></h4>
<h4><a name="api:mono_property_set_value">mono_property_set_value</a></h4>
<a name="events"></a>
<h2>Events</h2>
<h4><a name="api:mono_event_get_object">mono_event_get_object</a></h4>
<h4><a name="api:mono_event_get_add_method">mono_event_get_add_method</a></h4>
<h4><a name="api:mono_event_get_flags">mono_event_get_flags</a></h4>
<h4><a name="api:mono_event_get_name">mono_event_get_name</a></h4>
<h4><a name="api:mono_event_get_parent">mono_event_get_parent</a></h4>
<h4><a name="api:mono_event_get_raise_method">mono_event_get_raise_method</a></h4>
<h4><a name="api:mono_event_get_remove_method">mono_event_get_remove_method</a></h4>
<a name="remote"></a>
<h2>Remote Fields</h2>
<h4><a name="api:mono_load_remote_field">mono_load_remote_field</a></h4>
<h4><a name="api:mono_load_remote_field_new">mono_load_remote_field_new</a></h4>
<h4><a name="api:mono_store_remote_field">mono_store_remote_field</a></h4>
<h4><a name="api:mono_store_remote_field_new">mono_store_remote_field_new</a></h4>

Some files were not shown because too many files have changed in this diff Show More