You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -1,33 +1,75 @@
|
||||
<h2>Assemblies</h2>
|
||||
|
||||
<p>Code in .NET and Mono is distributed in assemblies, there
|
||||
are shipped typically in files with the extension .exe or
|
||||
.dll, and they are files that extend
|
||||
the <a href="https://en.wikipedia.org/wiki/Portable_Executable">Portable
|
||||
Executable</a> file format to include the Common Intermediate
|
||||
Language metadata and portable code.
|
||||
|
||||
<p>Assemblies are typically loaded either from a given file
|
||||
path, or using an <a href="#assembly-name">Assembly Name</a>
|
||||
to load them from the Global Assembly Cache.
|
||||
|
||||
<p>The Mono Assembly API contains method for dealing with
|
||||
<a href="#assembly-name">assembly
|
||||
names</a>, <a href="cil_assembly_load">loading assemblies</a>,
|
||||
<a href="#working">accessing assembly
|
||||
components</a>, <a href="#modules">modules</a> and
|
||||
some <a href="#advanced">advanced</a> features.
|
||||
|
||||
<p>Assemblies contain one or
|
||||
more images, the actual vessels for your code.
|
||||
The <a href="mono-api-image.html">Image API</a> documents the
|
||||
functions that operate on <code>MonoImage *</code>.
|
||||
|
||||
<h3>Synopsis</h3>
|
||||
|
||||
<div class="header">
|
||||
<div class="mapi-header">
|
||||
#include <metadata/assembly.h>
|
||||
|
||||
typedef struct _MonoImage MonoImage;
|
||||
typedef struct _MonoAssembly MonoAssembly;
|
||||
|
||||
@API_IDX@
|
||||
|
||||
</div>
|
||||
|
||||
<a name="cil_assembly_load"/>
|
||||
<a name="cil_assembly_load"/></a>
|
||||
<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_get_object">mono_assembly_get_object</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>
|
||||
<h4><a name="api:mono_assembly_load_from">mono_assembly_load_from</a></h4>
|
||||
<h4><a name="api:mono_assembly_load_from_full">mono_assembly_load_from_full</a></h4>
|
||||
<h4><a name="api:mono_assembly_load_with_partial_name">mono_assembly_load_with_partial_name</a></h4>
|
||||
<h4><a name="api:mono_assembly_open">mono_assembly_open</a></h4>
|
||||
<h4><a name="api:mono_assembly_open_full">mono_assembly_open_full</a></h4>
|
||||
<h4><a name="api:mono_set_assemblies_path">mono_set_assemblies_path</a></h4>
|
||||
<h4><a name="api:mono_set_rootdir">mono_set_rootdir</a></h4>
|
||||
|
||||
<a name="working"/>
|
||||
<h3>Working with Assemblies</h3>
|
||||
|
||||
<h4><a name="api:mono_assembly_fill_assembly_name">mono_assembly_fill_assembly_name</a></h4>
|
||||
<h4><a name="api:mono_assembly_foreach">mono_assembly_foreach</a></h4>
|
||||
<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_get_name">mono_assembly_get_name</a></h4>
|
||||
<h4><a name="api:mono_assembly_getrootdir">mono_assembly_getrootdir</a></h4>
|
||||
<h4><a name="api:mono_assembly_get_assemblyref">mono_assembly_get_assemblyref</a></h4>
|
||||
<h4><a name="api:mono_assembly_loaded_full">mono_assembly_loaded_full</a></h4>
|
||||
<h4><a name="api:mono_assembly_load_reference">mono_assembly_load_reference</a></h4>
|
||||
<h4><a name="api:mono_assembly_load_references">mono_assembly_load_references</a></h4>
|
||||
<h4><a name="api:mono_assembly_load_module">mono_assembly_load_module</a></h4>
|
||||
<h4><a name="api:mono_assembly_invoke_load_hook">mono_assembly_invoke_load_hook</a></h4>
|
||||
<h4><a name="api:mono_assembly_invoke_search_hook">mono_assembly_invoke_search_hook</a></h4>
|
||||
<h4><a name="api:mono_assembly_set_main">mono_assembly_set_main</a></h4>
|
||||
<h4><a name="api:mono_assembly_setrootdir">mono_assembly_setrootdir</a></h4>
|
||||
<h4><a name="api:mono_register_config_for_assembly">mono_register_config_for_assembly</a></h4>
|
||||
<h4><a name="api:mono_register_symfile_for_assembly">mono_register_symfile_for_assembly</a></h4>
|
||||
|
||||
<a name="assembly-name"></a>
|
||||
<h3>Assembly Names</h3>
|
||||
|
||||
<p>The MonoAssemblyName contains the full identity of an
|
||||
@@ -38,10 +80,16 @@ typedef struct _MonoAssembly MonoAssembly;
|
||||
href="http://www.mono-project.com/monodoc/T:System.Reflection.AssemblyName">System.Reflection.AssemblyName</a>
|
||||
managed type.
|
||||
|
||||
<h4><a name="api:mono_assembly_name_new">mono_assembly_name_new</a></h4>
|
||||
<h4><a name="api:mono_assembly_name_get_name">mono_assembly_name_get_name</a></h4>
|
||||
<h4><a name="api:mono_assembly_name_get_culture">mono_assembly_name_get_culture</a></h4>
|
||||
<h4><a name="api:mono_assembly_name_get_version">mono_assembly_name_get_version</a></h4>
|
||||
<h4><a name="api:mono_assembly_name_get_pubkeytoken">mono_assembly_name_get_pubkeytoken</a></h4>
|
||||
<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>
|
||||
|
||||
<a href="modules"/>
|
||||
<h3>Modules</h3>
|
||||
|
||||
<p>An assembly is made up of one or more modules.
|
||||
@@ -49,3 +97,14 @@ typedef struct _MonoAssembly MonoAssembly;
|
||||
<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>
|
||||
|
||||
|
||||
<a href="advanced"/>
|
||||
<h3>Advanced</h3>
|
||||
|
||||
<h4><a name="api:mono_install_assembly_load_hook">mono_install_assembly_load_hook</a></h4>
|
||||
<h4><a name="api:mono_install_assembly_search_hook">mono_install_assembly_search_hook</a></h4>
|
||||
<h4><a name="api:mono_install_assembly_refonly_search_hook">mono_install_assembly_refonly_search_hook</a></h4>
|
||||
<h4><a name="api:mono_install_assembly_preload_hook">mono_install_assembly_preload_hook</a></h4>
|
||||
<h4><a name="api:mono_install_assembly_refonly_preload_hook">mono_install_assembly_refonly_preload_hook</a></h4>
|
||||
<h4><a name="api:mono_install_assembly_postload_search_hook">mono_install_assembly_postload_search_hook</a></h4>
|
||||
<h4><a name="api:mono_install_assembly_postload_refonly_search_hook">mono_install_assembly_postload_refonly_search_hook</a></h4>
|
||||
|
||||
@@ -1,52 +1,108 @@
|
||||
<h2>Class Operations</h2>
|
||||
|
||||
<p>The operations on <code>MonoClass*</code> allow you to
|
||||
query a number of properties of a .NET class from the C API.
|
||||
|
||||
<p>This page contains information
|
||||
for <a href="#class-getting">how to obtain a MonoClass*</a>,
|
||||
how to <a href="#class-work">probe for different
|
||||
features of a MonoClass*</a> and APIs
|
||||
to <a href="#class-members">access class members</a> and
|
||||
<a href="#class-fields">access fields</a>. To access
|
||||
methods, see the <a href="mono-api-methods.html">method
|
||||
documentation API</a>.
|
||||
|
||||
<a name="class-getting"></a>
|
||||
<h3>Getting a MonoClass</h3>
|
||||
|
||||
<p>You typically would obtain a <code>MonoClass*</code>
|
||||
pointer by using a combination of the <code>MonoImage*</code>
|
||||
where the type is located, the namespace and name using the
|
||||
<code><a href="api:mono_class_from_name">mono_class_from_name</a></code>
|
||||
or
|
||||
the <code><a href="api:mono_class_from_name_case">mono_class_from_name_case</a></code>
|
||||
APIs or by using
|
||||
the <code><a href="api:mono_class_from_typeref">mono_class_from_typeref</a></code>
|
||||
or <code><a href="api:mono_class_from_typeref">mono_class_from_typeref_checked</a></code>
|
||||
methods.
|
||||
|
||||
<p>For low-level access, you can get the <code>MonoClass
|
||||
*</code> from an image and an ECMA type token relative to
|
||||
the <code>MonoImage*</code> by using <a href="api:mono_class_get">mono_class_get</a>.
|
||||
|
||||
|
||||
<h4><a name="api:mono_class_get">mono_class_get</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">mono_class_from_name</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_typeref">mono_class_from_typeref</a></h4>
|
||||
<h4><a name="api:mono_class_from_typeref_checked">mono_class_from_typeref_checked</a></h4>
|
||||
<h4><a name="api:mono_class_from_generic_parameter">mono_class_from_generic_parameter</a></h4>
|
||||
|
||||
<h3>Working with a MonoClass</h3>
|
||||
|
||||
<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_get_type_token">mono_class_get_type_token</a></h4>
|
||||
<h4><a name="api:mono_class_implements_interface">mono_class_implements_interface</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_delegate">mono_class_is_delegate</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_name_from_token">mono_class_name_from_token</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>
|
||||
|
||||
<a name="class-members"></a>
|
||||
<h3>Getting Class Members</h3>
|
||||
|
||||
<h4><a name="api:mono_class_get_fields">mono_class_get_fields</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_methods">mono_class_get_methods</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_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>
|
||||
<h4><a name="api:mono_class_get_nested_types">mono_class_get_nested_types</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_events">mono_class_get_events</a></h4>
|
||||
|
||||
<a name="class-fields"></a>
|
||||
<h3>Fields</h3>
|
||||
|
||||
<h4><a name="api:mono_field_get_data">mono_field_get_data</a></h4>
|
||||
<h4><a name="api:mono_field_get_offset">mono_field_get_offset</a></h4>
|
||||
<h4><a name="api:mono_field_full_name">mono_field_full_name</a></h4>
|
||||
|
||||
<h3>Method Accessibility</h3>
|
||||
|
||||
<h4><a name="api:mono_method_can_access_field">mono_method_can_access_field</a></h4>
|
||||
<h4><a name="api:mono_method_can_access_method">mono_method_can_access_method</a></h4>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<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>
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
<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>
|
||||
|
||||
<h3>Debugging Symbols</h3>
|
||||
<h4><a name="api:mono_debug_open_mono_symbols">mono_debug_open_mono_symbols</a></h4>
|
||||
<h4><a name="api:mono_debug_symfile_free_location">mono_debug_symfile_free_location</a></h4>
|
||||
<h4><a name="api:mono_debug_symfile_is_loaded">mono_debug_symfile_is_loaded</a></h4>
|
||||
<h4><a name="api:mono_debug_symfile_lookup_locals">mono_debug_symfile_lookup_locals</a></h4>
|
||||
<h4><a name="api:mono_debug_symfile_lookup_location">mono_debug_symfile_lookup_location</a></h4>
|
||||
<h4><a name="api:mono_debug_symfile_lookup_method">mono_debug_symfile_lookup_method</a></h4>
|
||||
|
||||
<h3>Internal Debugging </h3>
|
||||
|
||||
<h4><a name="api:mono_debug_add_delegate_trampoline">mono_debug_add_delegate_trampoline</a></h4>
|
||||
<h4><a name="api:mono_debug_close_image">mono_debug_close_image</a></h4>
|
||||
<h4><a name="api:mono_debug_domain_create">mono_debug_domain_create</a></h4>
|
||||
<h4><a name="api:mono_debug_domain_unload">mono_debug_domain_unload</a></h4>
|
||||
<h4><a name="api:mono_debug_enabled">mono_debug_enabled</a></h4>
|
||||
<h4><a name="api:mono_debug_free_method_jit_info">mono_debug_free_method_jit_info</a></h4>
|
||||
<h4><a name="api:mono_debug_free_source_location">mono_debug_free_source_location</a></h4>
|
||||
<h4><a name="api:mono_debug_lookup_locals">mono_debug_lookup_locals</a></h4>
|
||||
<h4><a name="api:mono_debug_lookup_method">mono_debug_lookup_method</a></h4>
|
||||
<h4><a name="api:mono_debug_lookup_method_addresses">mono_debug_lookup_method_addresses</a></h4>
|
||||
<h4><a name="api:mono_debug_lookup_source_location">mono_debug_lookup_source_location</a></h4>
|
||||
<h4><a name="api:mono_debug_open_image_from_memory">mono_debug_open_image_from_memory</a></h4>
|
||||
<h4><a name="api:mono_debug_print_stack_frame">mono_debug_print_stack_frame</a></h4>
|
||||
<h4><a name="api:mono_debug_remove_method">mono_debug_remove_method</a></h4>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<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>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<h3>Synopsis</h3>
|
||||
|
||||
<div class="header">
|
||||
<div class="mapi-header">
|
||||
#include <metadata/appdomain.h>
|
||||
|
||||
/* Managed AppDomain */
|
||||
@@ -34,21 +34,30 @@ typedef struct _MonoAppContext MonoAppContext
|
||||
|
||||
<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_create_appdomain">mono_domain_create_appdomain</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_from_appdomain">mono_domain_from_appdomain</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_friendly_name">mono_domain_get_friendly_name</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_owns_vtable_slot">mono_domain_owns_vtable_slot</a></h4>
|
||||
<h4><a name="api:mono_domain_set_config">mono_domain_set_config</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>
|
||||
<h4><a name="api:mono_domain_try_unload">mono_domain_try_unload</a></h4>
|
||||
<h4><a name="api:mono_domain_unload">mono_domain_unload</a></h4>
|
||||
|
||||
<h3>Contexts</h3>
|
||||
|
||||
<h4><a name="api:mono_context_init">mono_context_init</a></h4>
|
||||
<h4><a name="api:mono_context_get">mono_context_get</a></h4>
|
||||
<h4><a name="api:mono_context_get_domain_id">mono_context_get_domain_id</a></h4>
|
||||
<h4><a name="api:mono_context_get_id">mono_context_get_id</a></h4>
|
||||
<h4><a name="api:mono_context_set">mono_context_set</a></h4>
|
||||
|
||||
<h4><a name="api:mono_context_get_desc">mono_context_get_desc</a></h4>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h2>Dynamic Code Generation</h2>
|
||||
<h2>Internal: Dynamic Code Generation</h2>
|
||||
|
||||
<p>The dynamic code generation interface inside the Mono
|
||||
runtime is similar to the API exposed by
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
<h2>Embedding Mono</h2>
|
||||
|
||||
<p>The Mono runtime can be embedded into C and C++
|
||||
applications. Your C/C++ code can invoke managed code
|
||||
running in the Mono/.NET world and you can also surface your
|
||||
internal application APIs to Mono and .NET.
|
||||
|
||||
<p>For an overview of how to embed Mono into your application
|
||||
and the strategies that you can use to embed Mono, check the
|
||||
Mono
|
||||
website's <a href="http://www.mono-project.com/docs/advanced/embedding/">Embedding
|
||||
Mono</a> page.
|
||||
|
||||
<p>This page is the companion API reference for the above guide.
|
||||
|
||||
<p>The simplest way of embedding Mono is illustrated here:
|
||||
<pre>
|
||||
int main (int argc, char *argv)
|
||||
@@ -48,13 +61,14 @@ getMessage ()
|
||||
</pre>
|
||||
|
||||
<h4><a name="api:mono_jit_init">mono_jit_init</a></h4>
|
||||
<h4><a name="api:mono_jit_parse_options">mono_jit_parse_options</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_runtime_set_main_args">mono_runtime_set_main_args</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>
|
||||
<h4><a name="api:mono_jit_set_trace_options">mono_jit_set_trace_options</a></h4>
|
||||
|
||||
|
||||
<h3>Internal Calls</h3>
|
||||
|
||||
@@ -141,19 +155,16 @@ getMessage ()
|
||||
|
||||
<p>The following APIs expose this functionality:
|
||||
|
||||
<h4><a name="api:mono_config_cleanup">mono_config_cleanup</a></h4>
|
||||
<h4><a name="api:mono_config_is_server_mode">mono_config_is_server_mode</a></h4>
|
||||
<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_config_set_server_mode">mono_config_set_server_mode</a></h4>
|
||||
<h4><a name="api:mono_config_string_for_assembly_file">mono_config_string_for_assembly_file</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>
|
||||
<h4><a name="api:mono_get_machine_config">mono_get_machine_config</a></h4>
|
||||
<h4><a name="api:mono_register_machine_config">mono_register_machine_config</a></h4>
|
||||
<h4><a name="api:mono_set_config_dir">mono_set_config_dir</a></h4>
|
||||
|
||||
<h3>Advanced Execution Setups</h3>
|
||||
|
||||
@@ -163,6 +174,15 @@ getMessage ()
|
||||
|
||||
<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_from_assembly">mono_init_from_assembly</a></h4>
|
||||
<h4><a name="api:mono_init_version">mono_init_version</a></h4>
|
||||
<h4><a name="api:mono_jit_exec">mono_jit_exec</a></h4>
|
||||
<h4><a name="api:mono_jit_set_aot_mode">mono_jit_set_aot_mode</a></h4>
|
||||
<h4><a name="api:mono_set_break_policy">mono_set_break_policy</a></h4>
|
||||
<h4><a name="api:mono_get_runtime_build_info">mono_get_runtime_build_info</a></h4>
|
||||
|
||||
<h3>Signal Chaining</h3>
|
||||
|
||||
<h4><a name="api:mono_set_signal_chaining">mono_set_signal_chaining</a></h4>
|
||||
<h4><a name="api:mono_set_crash_chaining">mono_set_crash_chaining</a></h4>
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
<h2>Exception Handling</h2>
|
||||
|
||||
<div class="header">
|
||||
@API_IDX@
|
||||
</div>
|
||||
<p>Mono's exception handling contains methods
|
||||
to <a href="#creating">create `MonoException*` objects</a>
|
||||
that can be <a href="api:mono_raise_exception">raised</a>.
|
||||
|
||||
<p>Alternatively, you can obtain an exception that you can
|
||||
raise from some of the most <a href="#common">common</a>
|
||||
exceptions in the .NET Runtime.
|
||||
|
||||
<h3>Raising and Catching exceptions</h3>
|
||||
|
||||
<p>If you plan on running your code in Mono's Cooperative mode
|
||||
for the Garbage Collector (for example, if you are using pure
|
||||
Bitcode code generation), it you should avoid raising an
|
||||
exception from any method that is not the entry point to the
|
||||
internal call.
|
||||
|
||||
<p>It is recommended that if you need to raise an error
|
||||
condition from nested parts of your code, surface this error
|
||||
to the topmost method that is surfaced as an internal call and
|
||||
raise the exception there.
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<a name="creating"/>
|
||||
<h3>Exception Types: General API</h3>
|
||||
|
||||
<h4><a name="api:mono_exception_from_name_domain">mono_exception_from_name_domain</a></h4>
|
||||
@@ -18,6 +34,7 @@
|
||||
<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>
|
||||
|
||||
<a name="common"/>
|
||||
<h3>Obtaining Common Exceptions</h3>
|
||||
|
||||
<p>There are a number of common exceptions that are used by
|
||||
@@ -56,3 +73,10 @@
|
||||
<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>
|
||||
<h4><a name="api:mono_exception_from_token_two_strings">mono_exception_from_token_two_strings</a></h4>
|
||||
<h4><a name="api:mono_get_exception_bad_image_format2">mono_get_exception_bad_image_format2</a></h4>
|
||||
<h4><a name="api:mono_get_exception_field_access">mono_get_exception_field_access</a></h4>
|
||||
<h4><a name="api:mono_get_exception_method_access">mono_get_exception_method_access</a></h4>
|
||||
<h4><a name="api:mono_get_exception_out_of_memory">mono_get_exception_out_of_memory</a></h4>
|
||||
<h4><a name="api:mono_get_exception_runtime_wrapped">mono_get_exception_runtime_wrapped</a></h4>
|
||||
<h4><a name="api:mono_get_exception_thread_interrupted">mono_get_exception_thread_interrupted</a></h4>
|
||||
|
||||
@@ -4,9 +4,118 @@
|
||||
|
||||
<p>The public interface of the Mono GC is fairly limited, and
|
||||
its the only one that embedders should be using:
|
||||
|
||||
|
||||
<h3>Garbage Collector</h3>
|
||||
|
||||
<h4><a name="api:mono_gc_collect">mono_gc_collect</a></h4>
|
||||
<h4><a name="api:mono_gc_collection_count">mono_gc_collection_count</a></h4>
|
||||
<h4><a name="api:mono_gc_max_generation">mono_gc_max_generation</a></h4>
|
||||
<h4><a name="api:mono_gc_get_generation">mono_gc_get_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>
|
||||
<h4><a name="api:mono_gc_walk_heap">mono_gc_walk_heap</a></h4>
|
||||
|
||||
<h3>Reference Queues</h3>
|
||||
|
||||
<h4><a name="api:mono_gc_reference_queue_add">mono_gc_reference_queue_add</a></h4>
|
||||
<h4><a name="api:mono_gc_reference_queue_free">mono_gc_reference_queue_free</a></h4>
|
||||
<h4><a name="api:mono_gc_reference_queue_new">mono_gc_reference_queue_new</a></h4>
|
||||
|
||||
<h3>SGen Bridge</h3>
|
||||
|
||||
<p>The bridge is a mechanism for SGen to let clients override
|
||||
the death of some unreachable objects. We use it in monodroid
|
||||
to do garbage collection across the Mono and Java heaps.
|
||||
|
||||
<p>The client can designate some objects as "bridged", which
|
||||
means that they participate in the bridge processing step once
|
||||
SGen considers them unreachable, i.e., dead. Bridged objects
|
||||
must be registered for finalization.
|
||||
|
||||
<p>When SGen is done marking, it puts together a list of all
|
||||
dead bridged objects and then does a strongly connected
|
||||
component analysis over their object graph. That graph will
|
||||
usually contain non-bridged objects, too.
|
||||
|
||||
<p>The output of the SCC analysis is passed to the
|
||||
`cross_references()` callback. It is expected to set the
|
||||
`is_alive` flag on those strongly connected components that it
|
||||
wishes to be kept alive. Only bridged objects will be
|
||||
reported to the callback, i.e., non-bridged objects are
|
||||
removed from the callback graph.
|
||||
|
||||
<p>In monodroid each bridged object has a corresponding Java
|
||||
mirror object. In the bridge callback it reifies the Mono
|
||||
object graph in the Java heap so that the full, combined
|
||||
object graph is now instantiated on the Java side. Then it
|
||||
triggers a Java GC, waits for it to finish, and checks which
|
||||
of the Java mirror objects are still alive. For those it sets
|
||||
the `is_alive` flag and returns from the callback.
|
||||
|
||||
<p>The SCC analysis is done while the world is stopped, but
|
||||
the callback is made with the world running again. Weak links
|
||||
to bridged objects and other objects reachable from them are
|
||||
kept until the callback returns, at which point all links to
|
||||
bridged objects that don't have `is_alive` set are nulled.
|
||||
Note that weak links to non-bridged objects reachable from
|
||||
bridged objects are not nulled. This might be considered a
|
||||
bug.
|
||||
|
||||
<div class="mapi-header">
|
||||
enum {
|
||||
SGEN_BRIDGE_VERSION = 4
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
/* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List of object*/
|
||||
GC_BRIDGE_TRANSPARENT_CLASS,
|
||||
/* Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/
|
||||
GC_BRIDGE_OPAQUE_CLASS,
|
||||
/* Instances of this class should be bridged and have their dependency computed. */
|
||||
GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS,
|
||||
/* Instances of this class should be bridged but no dependencies should not be calculated. */
|
||||
GC_BRIDGE_OPAQUE_BRIDGE_CLASS,
|
||||
} MonoGCBridgeObjectKind;
|
||||
|
||||
typedef struct {
|
||||
mono_bool is_alive; /* to be set by the cross reference callback */
|
||||
int num_objs;
|
||||
MonoObject *objs [MONO_ZERO_LEN_ARRAY];
|
||||
} MonoGCBridgeSCC;
|
||||
|
||||
typedef struct {
|
||||
int src_scc_index;
|
||||
int dst_scc_index;
|
||||
} MonoGCBridgeXRef;
|
||||
|
||||
typedef struct {
|
||||
int bridge_version;
|
||||
/*
|
||||
* Tells the runtime which classes to even consider when looking for
|
||||
* bridged objects. If subclasses are to be considered as well, the
|
||||
* subclass check must be done in the callback.
|
||||
*/
|
||||
MonoGCBridgeObjectKind (*bridge_class_kind) (MonoClass *klass);
|
||||
/*
|
||||
* This is only called on objects for whose classes
|
||||
* `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`.
|
||||
*/
|
||||
mono_bool (*is_bridge_object) (MonoObject *object);
|
||||
void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs);
|
||||
} MonoGCBridgeCallbacks;
|
||||
</div>
|
||||
|
||||
<h4><a name="api:mono_gc_register_bridge_callbacks">mono_gc_register_bridge_callbacks</a></h4>
|
||||
<h4><a name="api:mono_gc_wait_for_bridge_processing">mono_gc_wait_for_bridge_processing</a></h4>
|
||||
|
||||
<h3>Write Barriers</h3>
|
||||
|
||||
<h4><a name="api:mono_gc_wbarrier_arrayref_copy">mono_gc_wbarrier_arrayref_copy</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_generic_nostore">mono_gc_wbarrier_generic_nostore</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_generic_store">mono_gc_wbarrier_generic_store</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_generic_store_atomic">mono_gc_wbarrier_generic_store_atomic</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_object_copy">mono_gc_wbarrier_object_copy</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_set_arrayref">mono_gc_wbarrier_set_arrayref</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_set_field">mono_gc_wbarrier_set_field</a></h4>
|
||||
<h4><a name="api:mono_gc_wbarrier_value_copy">mono_gc_wbarrier_value_copy</a></h4>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<h3>Synopsys</h3>
|
||||
|
||||
<div class="header">
|
||||
<div class="mapi-header">
|
||||
@API_IDX@
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
<tt>mono_gchandle_get_target</tt>.
|
||||
|
||||
<p>For example, consider the following C code:
|
||||
<div class="code">
|
||||
|
||||
<div class="mapi-code">
|
||||
static MonoObject* o = NULL;
|
||||
</div>
|
||||
|
||||
@@ -41,22 +42,22 @@ static MonoObject* o = NULL;
|
||||
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 class="mapi-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 class="mapi-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 class="mapi-code">
|
||||
mono_gchandle_free (handle);
|
||||
</div>
|
||||
|
||||
<p>Note that if you assign a new object to the C var, you need
|
||||
@@ -65,27 +66,27 @@ static MonoObject* o = NULL;
|
||||
|
||||
<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 class="mapi-code">
|
||||
static MonoObject* obj = NULL;
|
||||
...
|
||||
obj = mono_object_new (...);
|
||||
// use obj
|
||||
...
|
||||
// when done to allow the GC to collect obj
|
||||
obj = 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 class="mapi-code">
|
||||
static guint32 o_handle;
|
||||
...
|
||||
MonoObject *obj = mono_object_new (...);
|
||||
o_handle = mono_gchandle_new (obj, TRUE);
|
||||
// use o or mono_gchandle_get_target (o_handle)
|
||||
...
|
||||
// when done to allow the GC to collect obj
|
||||
mono_gchandle_free (o_handle);
|
||||
</div>
|
||||
|
||||
<h4><a name="api:mono_gchandle_new">mono_gchandle_new</a></h4>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<h3>Synopsis</h3>
|
||||
|
||||
<div class="header">
|
||||
<div class="mapi-header">
|
||||
#include <metadata/image.h>
|
||||
|
||||
typedef struct _MonoImage MonoImage;
|
||||
@@ -25,9 +25,9 @@ typedef enum {
|
||||
<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_load_image">mono_load_image</a></h4>
|
||||
<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>
|
||||
@@ -35,6 +35,8 @@ typedef enum {
|
||||
<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>
|
||||
<h4><a name="api:mono_image_open_from_data_with_name">mono_image_open_from_data_with_name</a></h4>
|
||||
<h4><a name="api:mono_image_load_module">mono_image_load_module</a></h4>
|
||||
|
||||
<h3>Image Information</h3>
|
||||
|
||||
@@ -51,6 +53,7 @@ typedef enum {
|
||||
<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>
|
||||
<h4><a name="api:mono_get_method_constrained">mono_get_method_constrained</a></h4>
|
||||
|
||||
<h3>Public Keys, Strong Names and Certificates</h3>
|
||||
|
||||
@@ -64,3 +67,11 @@ typedef enum {
|
||||
<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>
|
||||
<h4><a name="api:mono_image_init">mono_image_init</a></h4>
|
||||
<h4><a name="api:mono_images_init">mono_images_init</a></h4>
|
||||
<h4><a name="api:mono_images_cleanup">mono_images_cleanup</a></h4>
|
||||
<h4><a name="api:mono_image_add_to_name_cache">mono_image_add_to_name_cache</a></h4>
|
||||
<h4><a name="api:mono_image_fixup_vtable">mono_image_fixup_vtable</a></h4>
|
||||
<h4><a name="api:mono_image_loaded_by_guid_full">mono_image_loaded_by_guid_full</a></h4>
|
||||
<h4><a name="api:mono_image_loaded_full">mono_image_loaded_full</a></h4>
|
||||
<h4><a name="api:mono_lookup_icall_symbol">mono_lookup_icall_symbol</a></h4>
|
||||
|
||||
@@ -4,6 +4,29 @@
|
||||
inside Mono that developers extending or altering Mono might
|
||||
want to use.
|
||||
|
||||
<h2>Strings</h2>
|
||||
|
||||
<h3>Other Encodings</h3>
|
||||
|
||||
<p>These routines are used when coping with strings that come
|
||||
from Mono's environment, and might be encoded in one or more
|
||||
of the external encodings.
|
||||
|
||||
<p>For example, some file systems might historically contain a
|
||||
mix of file names with both old and new encodings, typically
|
||||
UTF8 for new files, and the old files would be encoded in an 8
|
||||
bit character set (ISO-8859-1 for example).
|
||||
|
||||
<p>These routines try a number of encodings, those specified
|
||||
in the <tt>MONO_ENCODINGS</tt> environment variable and return
|
||||
unicode strings that can be used internally.
|
||||
|
||||
<p>See the mono(1) man page for more details.
|
||||
|
||||
<h4><a name="api:mono_unicode_from_external">mono_unicode_from_external</a></h4>
|
||||
<h4><a name="api:mono_unicode_to_external">mono_unicode_to_external</a></h4>
|
||||
<h4><a name="api:mono_utf8_from_external">mono_utf8_from_external</a></h4>
|
||||
|
||||
<h2>Marshalling functions</h2>
|
||||
|
||||
<h4><a name="api:mono_marshal_alloc">mono_marshal_alloc</a></h4>
|
||||
|
||||
@@ -1,9 +1,26 @@
|
||||
<h2>Synopsis</h2>
|
||||
|
||||
<div class="header">
|
||||
<p>These functions are used to get some runtime information
|
||||
from the Just in Time compiler and also to control some
|
||||
aspects of the initialization and shutdown of the runtime.
|
||||
|
||||
<div class="mapi-header">
|
||||
typedef struct _MonoJitInfo MonoJitInfo;
|
||||
|
||||
@API_IDX@
|
||||
</div>
|
||||
|
||||
<h3>Just-in-Time Compiled Method Information</h3>
|
||||
|
||||
<p>Use the `MonoJitInfo` API to get data about a JITed
|
||||
method. These APIs are typically used by profiler modules
|
||||
added to Mono.
|
||||
|
||||
<h4><a name="api:mono_jit_info_table_find">mono_jit_info_table_find</a></h4>
|
||||
<h4><a name="api:mono_jit_info_get_code_size">mono_jit_info_get_code_size</a></h4>
|
||||
<h4><a name="api:mono_jit_info_get_code_start">mono_jit_info_get_code_start</a></h4>
|
||||
<h4><a name="api:mono_jit_info_get_method">mono_jit_info_get_method</a></h4>
|
||||
|
||||
<h3>Useful Debugging Functions</h3>
|
||||
|
||||
<p>These functions are useful when running the Mono VM inside
|
||||
@@ -14,7 +31,12 @@
|
||||
<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>
|
||||
<h3>Advanced</h3></h4>
|
||||
|
||||
<h4><a name="api:mono_assemblies_init">mono_assemblies_init</a></h4>
|
||||
<h4><a name="api:mono_assemblies_cleanup">mono_assemblies_cleanup</a></h4>
|
||||
<h4><a name="api:mono_environment_exitcode_get">mono_environment_exitcode_get</a></h4>
|
||||
<h4><a name="api:mono_environment_exitcode_set">mono_environment_exitcode_set</a></h4>
|
||||
<h4><a name="api:mono_install_runtime_cleanup">mono_install_runtime_cleanup</a></h4>
|
||||
<h4><a name="api:mono_runtime_set_shutting_down">mono_runtime_set_shutting_down</a></h4>
|
||||
<h4><a name="api:mono_security_set_core_clr_platform_callback">mono_security_set_core_clr_platform_callback</a></h4>
|
||||
|
||||
@@ -1,4 +1,125 @@
|
||||
<h1>Notification Interface</h1>
|
||||
<h2>Internal Runtime Utility Functions</h2>
|
||||
|
||||
<h3>SHA1 Signatures</h3>
|
||||
|
||||
<h4><a name="api:mono_sha1_init">mono_sha1_init</a></h4>
|
||||
<h4><a name="api:mono_sha1_update">mono_sha1_update</a></h4>
|
||||
<h4><a name="api:mono_sha1_get_digest_from_file">mono_sha1_get_digest_from_file</a></h4>
|
||||
<h4><a name="api:mono_sha1_get_digest">mono_sha1_get_digest</a></h4>
|
||||
<h4><a name="api:mono_sha1_final">mono_sha1_final</a></h4>
|
||||
|
||||
<h3>MD5 Signatures</h3>
|
||||
|
||||
<h4><a name="api:mono_md5_init">mono_md5_init</a></h4>
|
||||
<h4><a name="api:mono_md5_update">mono_md5_update</a></h4>
|
||||
<h4><a name="api:mono_md5_get_digest_from_file">mono_md5_get_digest_from_file</a></h4>
|
||||
<h4><a name="api:mono_md5_get_digest">mono_md5_get_digest</a></h4>
|
||||
<h4><a name="api:mono_md5_final">mono_md5_final</a></h4>
|
||||
|
||||
<h4><a name="api:mono_digest_get_public_token">mono_digest_get_public_token</a></h4>
|
||||
|
||||
<h3>Hashtables</h3>
|
||||
|
||||
<p><tt>GHashTable</tt> is used when you need to store object
|
||||
references into a hashtable, objects stored in a
|
||||
<tt>MonoGHashTable</tt> are properly tracked by the garbage
|
||||
collector.
|
||||
|
||||
<p>The <tt>MonoGHashTable</tt> data type has the same API as
|
||||
the GLIB.
|
||||
|
||||
<h4><a name="api:mono_g_hash_table_destroy">mono_g_hash_table_destroy</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_foreach">mono_g_hash_table_foreach</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_foreach_remove">mono_g_hash_table_foreach_remove</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_foreach_steal">mono_g_hash_table_foreach_steal</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_insert">mono_g_hash_table_insert</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_lookup">mono_g_hash_table_lookup</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_lookup_extended">mono_g_hash_table_lookup_extended</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_new">mono_g_hash_table_new</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_new_full">mono_g_hash_table_new_full</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_remap">mono_g_hash_table_remap</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_remove">mono_g_hash_table_remove</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_replace">mono_g_hash_table_replace</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_size">mono_g_hash_table_size</a></h4>
|
||||
<h4><a name="api:mono_g_hash_table_steal">mono_g_hash_table_steal</a></h4>
|
||||
|
||||
|
||||
<h3>Memory Pools</h3>
|
||||
|
||||
<p>Memory pools are a convenient way of tracking memory
|
||||
allocations that are used for one specific task, they are also
|
||||
faster than using the standard memory allocation procedures,
|
||||
as they are designed to be used only by a single thread at a
|
||||
time.
|
||||
|
||||
<p><tt>MonoMemPool</tt> objects are not thread safe, which
|
||||
means that you should not share the objects across multiple
|
||||
threads without providing proper locking around it (unlike
|
||||
<tt>malloc</tt> and <tt>free</tt> which are thread safe).
|
||||
|
||||
<p>When a <tt>MonoMemPool</tt> is released with
|
||||
<tt>mono_mempool_destroy</tt> all of the of the memory
|
||||
allocated from that memory pool with
|
||||
<tt>mono_mempool_alloc</tt> and <tt>mono_mempool_alloc0</tt>
|
||||
is released.
|
||||
|
||||
<h4><a name="api:mono_mempool_new">mono_mempool_new</a></h4>
|
||||
<h4><a name="api:mono_mempool_destroy">mono_mempool_destroy</a></h4>
|
||||
<h4><a name="api:mono_mempool_alloc">mono_mempool_alloc</a></h4>
|
||||
<h4><a name="api:mono_mempool_alloc0">mono_mempool_alloc0</a></h4>
|
||||
<h4><a name="api:mono_mempool_empty">mono_mempool_empty</a></h4>
|
||||
<h4><a name="api:mono_mempool_invalidate">mono_mempool_invalidate</a></h4>
|
||||
<h4><a name="api:mono_mempool_stats">mono_mempool_stats</a></h4>
|
||||
<h4><a name="api:mono_mempool_contains_addr">mono_mempool_contains_addr</a></h4>
|
||||
|
||||
<h3>Bitsets</h3>
|
||||
|
||||
<p>MonoBitsets are a set of routines used to manipulate sets
|
||||
of bits.
|
||||
|
||||
<h4><a name="api:mono_bitset_alloc_size">mono_bitset_alloc_size</a></h4>
|
||||
<h4><a name="api:mono_bitset_clear">mono_bitset_clear</a></h4>
|
||||
<h4><a name="api:mono_bitset_clear_all">mono_bitset_clear_all</a></h4>
|
||||
<h4><a name="api:mono_bitset_clone">mono_bitset_clone</a></h4>
|
||||
<h4><a name="api:mono_bitset_copyto">mono_bitset_copyto</a></h4>
|
||||
<h4><a name="api:mono_bitset_count">mono_bitset_count</a></h4>
|
||||
<h4><a name="api:mono_bitset_equal">mono_bitset_equal</a></h4>
|
||||
<h4><a name="api:mono_bitset_find_first">mono_bitset_find_first</a></h4>
|
||||
<h4><a name="api:mono_bitset_find_last">mono_bitset_find_last</a></h4>
|
||||
<h4><a name="api:mono_bitset_find_start">mono_bitset_find_start</a></h4>
|
||||
<h4><a name="api:mono_bitset_foreach">mono_bitset_foreach</a></h4>
|
||||
<h4><a name="api:mono_bitset_free">mono_bitset_free</a></h4>
|
||||
<h4><a name="api:mono_bitset_intersection">mono_bitset_intersection</a></h4>
|
||||
<h4><a name="api:mono_bitset_invert">mono_bitset_invert</a></h4>
|
||||
<h4><a name="api:mono_bitset_mem_new">mono_bitset_mem_new</a></h4>
|
||||
<h4><a name="api:mono_bitset_new">mono_bitset_new</a></h4>
|
||||
<h4><a name="api:mono_bitset_set">mono_bitset_set</a></h4>
|
||||
<h4><a name="api:mono_bitset_set_all">mono_bitset_set_all</a></h4>
|
||||
<h4><a name="api:mono_bitset_size">mono_bitset_size</a></h4>
|
||||
<h4><a name="api:mono_bitset_sub">mono_bitset_sub</a></h4>
|
||||
<h4><a name="api:mono_bitset_test">mono_bitset_test</a></h4>
|
||||
<h4><a name="api:mono_bitset_test_bulk">mono_bitset_test_bulk</a></h4>
|
||||
<h4><a name="api:mono_bitset_union">mono_bitset_union</a></h4>
|
||||
<h4><a name="api:mono_bitset_find_first_unset">mono_bitset_find_first_unset</a></h4>
|
||||
<h4><a name="api:mono_bitset_intersection_2">mono_bitset_intersection_2</a></h4>
|
||||
|
||||
<h3>JIT utilities</h3>
|
||||
|
||||
<h4><a name="api:mono_signbit_double">mono_signbit_double</a></h4>
|
||||
<h4><a name="api:mono_signbit_float">mono_signbit_float</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>
|
||||
|
||||
|
||||
<h2>Notification Interface</h2>
|
||||
|
||||
<p>This is an internal profiler interface. In general, users
|
||||
would not be using this interface, but would be using the
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
|
||||
<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>
|
||||
@@ -617,7 +617,6 @@ MONO_TYPESPEC_SIZE
|
||||
|
||||
<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_metadata_get_table">mono_metadata_get_table</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_row">mono_metadata_decode_row</a></h4>
|
||||
<h4><a name="api:mono_metadata_compute_size">mono_metadata_compute_size</a></h4>
|
||||
@@ -631,9 +630,10 @@ MONO_TYPESPEC_SIZE
|
||||
<p>This is the low-level API for accessing the metadata
|
||||
images.
|
||||
|
||||
<h4><a name="api:mono_cli_rva_image_map">mono_cli_rva_image_map</a></h4>
|
||||
<h4><a name="api:mono_pe_file_open">mono_pe_file_open</a></h4>
|
||||
<h4><a name="api:mono_metadata_events_from_typedef">mono_metadata_events_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_table_row">mono_metadata_decode_table_row</a></h4>
|
||||
<h4><a name="api:mono_metadata_decode_table_row_col">mono_metadata_decode_table_row_col</a></h4>
|
||||
<h4><a name="api:mono_metadata_field_info">mono_metadata_field_info</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_array">mono_metadata_free_array</a></h4>
|
||||
<h4><a name="api:mono_metadata_free_marshal_spec">mono_metadata_free_marshal_spec</a></h4>
|
||||
@@ -652,6 +652,7 @@ MONO_TYPESPEC_SIZE
|
||||
<h4><a name="api:mono_metadata_packing_from_typedef">mono_metadata_packing_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_properties_from_typedef">mono_metadata_properties_from_typedef</a></h4>
|
||||
<h4><a name="api:mono_metadata_token_from_dor">mono_metadata_token_from_dor</a></h4>
|
||||
<h4><a name="api:mono_metadata_translate_token_index">mono_metadata_translate_token_index</a></h4>
|
||||
<h4><a name="api:mono_metadata_typedef_from_field">mono_metadata_typedef_from_field</a></h4>
|
||||
<h4><a name="api:mono_metadata_typedef_from_method">mono_metadata_typedef_from_method</a></h4>
|
||||
<h4><a name="api:mono_metadata_type_equal">mono_metadata_type_equal</a></h4>
|
||||
@@ -661,24 +662,23 @@ MONO_TYPESPEC_SIZE
|
||||
|
||||
<h3>Retrieving Objects from Tokens</h3>
|
||||
|
||||
<h4><a name="api:mono_metadata_parse_array">mono_metadata_parse_array</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_custom_mod">mono_metadata_parse_custom_mod</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_field_type">mono_metadata_parse_field_type</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_marshal_spec">mono_metadata_parse_marshal_spec</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_method_signature_full">mono_metadata_parse_method_signature_full</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_method_signature">mono_metadata_parse_method_signature</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_mh_full">mono_metadata_parse_mh_full</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_mh">mono_metadata_parse_mh</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_param">mono_metadata_parse_param</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_ret_type">mono_metadata_parse_ret_type</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_signature">mono_metadata_parse_signature</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_typedef_or_ref">mono_metadata_parse_typedef_or_ref</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_type_full">mono_metadata_parse_type_full</a></h4>
|
||||
<h4><a name="api:mono_metadata_parse_type">mono_metadata_parse_type</a></h4>
|
||||
|
||||
<h2>Generics Support</h2>
|
||||
|
||||
<h4><a name="api:mono_metadata_generic_class_equal">mono_metadata_generic_class_equal</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_class_hash">mono_metadata_generic_class_hash</a></h4>
|
||||
<h4><a name="api:mono_metadata_generic_class_is_valuetype">mono_metadata_generic_class_is_valuetype</a></h4>
|
||||
<h4><a name="api:mono_metadata_inflate_generic_inst">mono_metadata_inflate_generic_inst</a></h4>
|
||||
<h4><a name="api:mono_metadata_load_generic_params">mono_metadata_load_generic_params</a></h4>
|
||||
|
||||
<h2>Tokens</h2>
|
||||
|
||||
|
||||
@@ -1,5 +1,159 @@
|
||||
<h3>Methods</h3>
|
||||
<h2>Methods</h2>
|
||||
|
||||
<p>Methods are represented by the <code>MonoMethod*</code>
|
||||
instances. Various APIs surface these instances, but usually
|
||||
you will use the <a href="#method-desc">method description</a>
|
||||
API to get a handle to a Mono Method. You can <a href="method-invoking">invoke</a> those methods from C,
|
||||
or you can probe <a href="method-working">probe various properties</a> of a method, and in particular
|
||||
its <a href="method-signature">method signature</a> or get
|
||||
some <a href="method-header">low-level information</a> about them.
|
||||
|
||||
<p>The following code snippet from the Mono runtime shows you
|
||||
how to create a managed <code>System.Version</code> instance
|
||||
with four integers by looking up the constructor in the
|
||||
managed implementation of System.Version, creating an instance
|
||||
of the object, and then invoking the constructor on it.
|
||||
|
||||
<div class="mapi-header">
|
||||
MonoObject*
|
||||
create_version (MonoDomain *domain, guint32 major, guint32 minor, guint32 build, guint32 revision)
|
||||
{
|
||||
MonoClass *System_Version;
|
||||
MonoMethod *create_version;
|
||||
MonoError error;
|
||||
MonoObject *result;
|
||||
gpointer args [4];
|
||||
|
||||
System_Version = mono_class_from_name (mono_defaults.corlib, "System", "Version");
|
||||
|
||||
// Create a method description that we use to search for the
|
||||
// constructor method
|
||||
MonoMethodDesc *desc = mono_method_desc_new (":.ctor(int,int,int,int)", FALSE);
|
||||
create_version = mono_method_desc_search_in_class (desc, System_Version);
|
||||
mono_method_desc_free (desc);
|
||||
|
||||
// Setup the parameters to pass.
|
||||
args [0] = &major;
|
||||
args [1] = &minor;
|
||||
args [2] = &build;
|
||||
args [3] = &revision;
|
||||
|
||||
// Create the object instance
|
||||
result = mono_object_new_checked (domain, System_Version, &error);
|
||||
|
||||
// Raise an exception in case of an error
|
||||
mono_error_raise_exception (&error);
|
||||
|
||||
// Otherwise, invoke the constructor
|
||||
mono_runtime_invoke (create_version, result, args, NULL);
|
||||
|
||||
// Return ther esult
|
||||
return result;
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<a name="method-desc"></a>
|
||||
<h3>Method Descriptions</h3>
|
||||
|
||||
<p>Methods are represented by the <code>MonoMethod*</code>
|
||||
instances. To simplify the process of getting
|
||||
a <code>MonoMethod*</code>, you use Method Descriptors, which
|
||||
are C-strings that describe the method that you are looking
|
||||
for, and then you perform a search in either
|
||||
a <a href="mono-api-type.html">type</a>, or a
|
||||
loaded <a href="mono-api-image.html">image</a>.
|
||||
|
||||
|
||||
<p>To describe a method, you use the Method Description API.
|
||||
Method descriptions are used to locate a method in the
|
||||
executing program. They can either be fully specified, that
|
||||
is, they would include the namespace, class, method name and
|
||||
all of its arguments or they omit the namespace and arguments
|
||||
and even use wildcard matches for the class name and method names.
|
||||
|
||||
<p>You use the fully specified version to identify a
|
||||
particular method, or you can use the partial version to find
|
||||
a method or a family of methods in the code.
|
||||
|
||||
<p>Method descriptions are typically created from a C string
|
||||
representation, and take the following form:
|
||||
|
||||
<p><code>[namespace.]classname:methodname[(args...)]</code>
|
||||
|
||||
<p>Both classname and methodname can contain the '*' character
|
||||
which can be used to match anything. Arguments are separated
|
||||
by commas.
|
||||
|
||||
<p>You can use the type shortcuts to match the fully qualified
|
||||
parameter types. The supported type shortcuts are:
|
||||
<code>char</code>,
|
||||
<code>bool</code>,
|
||||
<code>byte</code>,
|
||||
<code>sbyte</code>,
|
||||
<code>uint16</code>,
|
||||
<code>int16</code>,
|
||||
<code>uint</code>,
|
||||
<code>int</code>,
|
||||
<code>ulong</code>,
|
||||
<code>long</code>,
|
||||
<code>uintptr</code>,
|
||||
<code>intptr</code>,
|
||||
<code>single</code>,
|
||||
<code>double</code>,
|
||||
<code>string</code> and
|
||||
<code>object</code>.
|
||||
|
||||
<p>The type parameters can use the "&" and "*" type modifiers.
|
||||
|
||||
<p>Examples of method descriptions:
|
||||
<ul>
|
||||
<li>"Monitor:Exit": matches classes and methods called "Monitor.Exit"
|
||||
<li>"Monitor:enter_with_atomic_var(object,bool&)":
|
||||
matches a method in the class Monitor with two
|
||||
specific type parameters.
|
||||
<li>":.ctor(int,int,int,int)": matches constructors
|
||||
that take four integers.
|
||||
<li>"System.Globalization.CultureInfo:CreateCulture(string,bool)":
|
||||
matches the CreateCultureMethod that takes a string
|
||||
and a boolean on the System.Globalization.CultureInfo class.
|
||||
</ul>
|
||||
|
||||
<p>You can
|
||||
then <a href="api:mono_method_desc_search_in_image">search for
|
||||
methods in MonoImages</a>
|
||||
or <a href="api:mono_method_desc_search_in_class">search for
|
||||
methods in classes</a>.
|
||||
|
||||
<h4><a name="api:mono_method_desc_new">mono_method_desc_new</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_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>
|
||||
|
||||
<a name="method-working"></a>
|
||||
<h3>Working with Methods</h3>
|
||||
|
||||
<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_get_unmanaged_thunk">mono_method_get_unmanaged_thunk</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>
|
||||
|
||||
<a name="method-invoking"></a>
|
||||
<h3>Invoking Methods</h3>
|
||||
|
||||
<h4><a name="api:mono_runtime_invoke">mono_runtime_invoke</a></h4>
|
||||
@@ -8,7 +162,7 @@ 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">
|
||||
<div class="mapi-code">
|
||||
MonoClass *clazz;
|
||||
MonoMethod *method;
|
||||
|
||||
@@ -29,29 +183,8 @@ mono_runtime_invoke (method, obj, args, &exception);
|
||||
<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>
|
||||
|
||||
<a name="method-signature"></a>
|
||||
<h3>Method Signatures</h3>
|
||||
|
||||
<h4><a name="api:mono_method_signature">mono_method_signature</a></h4>
|
||||
@@ -63,11 +196,13 @@ mono_runtime_invoke (method, obj, args, &exception);
|
||||
<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_param_is_out">mono_signature_param_is_out</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>
|
||||
|
||||
<a name="method-header"></a>
|
||||
<h3>Methods Header Operations</h3>
|
||||
|
||||
<h4><a name="api:mono_method_get_header">mono_method_get_header</a></h4>
|
||||
|
||||
@@ -6,15 +6,17 @@
|
||||
|
||||
<p>The object API has methods for accessing <a
|
||||
href="#fields">fields</a>, <a
|
||||
href="#properties">properties</a>, <a
|
||||
href="#properties">properties</a>, <a href="mono-api-methods.html">methods</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">
|
||||
<div class="mapi-header">
|
||||
#include <metadata/object.h>
|
||||
|
||||
typedef struct MonoVTable MonoVTable;
|
||||
@@ -43,7 +45,7 @@ typedef struct {
|
||||
@API_IDX@
|
||||
</div>
|
||||
|
||||
<p>MonoObject is the base definition for all managed objects
|
||||
<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.
|
||||
@@ -54,12 +56,11 @@ typedef struct {
|
||||
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>
|
||||
<div class="mapi-code">
|
||||
typedef struct {
|
||||
MonoObject parent;
|
||||
int my_new_field;
|
||||
} MyNewObject</div>
|
||||
|
||||
<a name="objects"></a>
|
||||
<h2>Core Object Methods</h2>
|
||||
@@ -69,7 +70,7 @@ typedef struct {
|
||||
<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">
|
||||
<div class="mapi-code">
|
||||
MonoClass *version_class;
|
||||
MonoObject *result;
|
||||
|
||||
@@ -79,7 +80,7 @@ version_class = mono_class_from_name (mono_get_corlib (),
|
||||
|
||||
/* Create an object of that class */
|
||||
result = mono_object_new (mono_domain_get (), version_class);
|
||||
</div>
|
||||
</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>
|
||||
@@ -94,6 +95,8 @@ result = mono_object_new (mono_domain_get (), version_class);
|
||||
<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_get_size">mono_object_get_size</a></h4>
|
||||
<h4><a name="api:mono_object_hash">mono_object_hash</a></h4>
|
||||
<h4><a name="api:mono_object_to_string">mono_object_to_string</a></h4>
|
||||
|
||||
<a name="valuetypes"></a>
|
||||
<h2>Value Types</h2>
|
||||
@@ -112,19 +115,17 @@ result = mono_object_new (mono_domain_get (), version_class);
|
||||
elements of type <tt>System.Byte</tt>, and sets the values
|
||||
0xca and 0xfe on it:
|
||||
|
||||
<pre class="code">
|
||||
<pre class="mapi-code">
|
||||
MonoArray *CreateByteArray (MonoDomain *domain)
|
||||
{
|
||||
MonoArray *data;
|
||||
|
||||
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;
|
||||
}
|
||||
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>
|
||||
@@ -137,12 +138,31 @@ result = mono_object_new (mono_domain_get (), version_class);
|
||||
|
||||
<h3>Using Arrays</h3>
|
||||
|
||||
<p>Arrays are represented by the `MonoArray` data type and are
|
||||
instances of `MonoObject`. While you can use the `bounds`
|
||||
and `max_length` fields of the type, the actual storage
|
||||
(represented by `vector`) is not very useful. Instead you
|
||||
should use one of the accesor methods described below to
|
||||
fetch or set the values in the array.
|
||||
|
||||
<p>When setting values in an array, you should
|
||||
use <a href="api:mono_array_set">mono_array_set</a> for
|
||||
setting elements in an array that contains value types, and
|
||||
<a
|
||||
href="api:mono_array_setref">mono_array_setref</a> for arrays
|
||||
that contain reference types.
|
||||
|
||||
<p>The <a href="api:mono_array_get">mono_array_get</a>,
|
||||
<a href="api:mono_array_set">mono_array_set</a> and <a
|
||||
href="api:mono_array_setref">mono_array_setref</a> are C
|
||||
macros that wrap the underlying array access.
|
||||
|
||||
<h4><a name="api:mono_array_get">mono_array_get</a></h4>
|
||||
<h4><a name="api:mono_array_length">mono_array_length</a></h4>
|
||||
<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>
|
||||
@@ -190,3 +210,7 @@ result = mono_object_new (mono_domain_get (), version_class);
|
||||
<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>
|
||||
|
||||
<a name="delegates"></a>
|
||||
<h2>Delegates</h2>
|
||||
<h4><a name="api:mono_get_delegate_begin_invoke">mono_get_delegate_begin_invoke</a></h4>
|
||||
<h4><a name="api:mono_get_delegate_end_invoke">mono_get_delegate_end_invoke</a></h4>
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<h2>Fetching Types, and Basic Reflection</h2>
|
||||
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs_blob">mono_reflection_get_custom_attrs_blob</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs">mono_reflection_get_custom_attrs</a></h4>
|
||||
<h4><a name="api:mono_custom_attrs_get_attr">mono_custom_attrs_get_attr</a></h4>
|
||||
<h4><a name="api:mono_reflection_assembly_get_assembly">mono_reflection_assembly_get_assembly</a></h4>
|
||||
<h4><a name="api:mono_reflection_free_type_info">mono_reflection_free_type_info</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs_blob">mono_reflection_get_custom_attrs_blob</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs_by_type">mono_reflection_get_custom_attrs_by_type</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs_data">mono_reflection_get_custom_attrs_data</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs">mono_reflection_get_custom_attrs</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_token">mono_reflection_get_token</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_type">mono_reflection_get_type</a></h4>
|
||||
<h4><a name="api:mono_reflection_parse_type">mono_reflection_parse_type</a></h4>
|
||||
<h4><a name="api:mono_reflection_type_get_type">mono_reflection_type_get_type</a></h4>
|
||||
<h4><a name="api:mono_reflection_type_from_name">mono_reflection_type_from_name</a></h4>
|
||||
<h4><a name="api:mono_reflection_get_custom_attrs_info">mono_reflection_get_custom_attrs_info</a></h4>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user