From 7d5a7ea7ac324bb4ee63094ddcf8e20ae9ba4322 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 8 Feb 2016 13:56:51 -0500 Subject: [PATCH] [docs] Improve the rendering of our API binding APIs and runtime API documentation --- docs/exdoc | 280 ++++++++++++++++++++------- docs/sources/mono-api-assembly.html | 64 +++--- docs/sources/mono-api-domains.html | 18 +- docs/sources/mono-api-embedding.html | 2 +- docs/sources/mono-api-jit.html | 8 +- mono/metadata/appdomain.c | 2 +- mono/metadata/assembly.c | 144 +++++++++++++- mono/metadata/boehm-gc.c | 2 +- mono/metadata/class.c | 29 +-- mono/metadata/gc.c | 2 +- mono/metadata/metadata.c | 2 +- mono/metadata/runtime.c | 7 +- mono/metadata/sgen-mono.c | 2 +- mono/metadata/threads.c | 2 +- mono/metadata/verify.c | 42 ++-- 15 files changed, 444 insertions(+), 162 deletions(-) diff --git a/docs/exdoc b/docs/exdoc index ce35052443e..a1ce4378b6f 100644 --- a/docs/exdoc +++ b/docs/exdoc @@ -49,64 +49,179 @@ if ($html){ - $name - +
EOF @a = split (/\n/, $files_content[$f]); $strikeextra = ""; @@ -131,32 +246,45 @@ EOF $proto = "Prototype: $api"; } -print OUT<
-
$api$strikeextra
-
Syntax
-
$proto
+
$api$strikeextra
+
+
+
+
+ +
Syntax
+
$proto

EOF - &opt_print ("Parameters", $arguments{$api}, 1); - &opt_print ("Returns", $returns{$api}, 1); - &opt_print ("Description", $bodies{$api}, 0); - print OUT "\n"; + +# if ($arguments{$api} ne "" && (!($arguments{$api}) =~ /^[ \t]+$/)){ + print OUT "

Parameters
\n"; + print OUT "".${arguments{$api}}."
"; +# } +# &opt_print ("Parameters", $arguments{$api}, 1); + + &opt_print ("Returns", $returns{$api}, 1); + &opt_print ("Description", $bodies{$api}, 0); + print OUT "\n"; } else { if ($line =~ /@API_IDX@/){ $apis_toc = &create_toc ($apis[$f]); $line =~ s/\@API_IDX\@/$apis_toc/; } - if ($line =~ /^"; + if ($line =~ /^

"; $api_shown = 0; } - + if ($line =~ /`/){ + } print OUT "$line\n"; } } print OUT< EOF @@ -192,11 +320,22 @@ sub process_doc { # Process arguments while (<>){ - if (/^ \*\*?\//){ - $body =~ s/[@#](\w+)/\1<\/i>/g; - $returns =~ s/[@#](\w+)/\1<\/i>/g; - + s/NULL/NULL<\/code>/g; + s/TRUE/TRUE<\/code>/g; + s/FALSE/FALSE<\/code>/g; + if (/^ \*\*?\//){ + $body =~ s/@(\w+)/\1<\/i>/g; + $returns =~ s/@(\w+)/\1<\/i>/g; $args =~ s/@(\w+)/\1<\/i>/g; + + $body =~ s/#(\w+)/\1<\/code>/g; + $returns =~ s/#(\w+)/\1<\/code>/g; + $args =~ s/#(\w+)/\1<\/code>/g; + + $returns =~ s/\`([:\w\*]+)\`/\1<\/code>/g; + $args =~ s/\`([:\w\*]+)\`/\1<\/code>/g; + $body =~ s/\`([:\w\*]+)\`/\1<\/code>/g; + $body =~ s/\n/ /; $bodies{$func} = $body; $arguments{$func} = $args; @@ -224,7 +363,8 @@ sub process_doc { if ($1 eq "deprecated"){ $deprecated = $2; } else { - $args .= "
$1:
$2
"; + #$args .= "
$1:
$2
"; + $args .= "$1$2"; } } else { @@ -315,7 +455,7 @@ sub opt_print { my ($caption, $opttext, $quote) = @_; if ($opttext ne "" && (!($opttext =~ /^[ \t]+$/))){ - print OUT "$caption\n"; + print OUT "
$caption
\n"; if ($quote == 1){ print OUT "
$opttext
\n"; } else { diff --git a/docs/sources/mono-api-assembly.html b/docs/sources/mono-api-assembly.html index c38ea00f2b2..15e29583999 100644 --- a/docs/sources/mono-api-assembly.html +++ b/docs/sources/mono-api-assembly.html @@ -20,33 +20,33 @@ typedef struct _MonoAssembly MonoAssembly;

mono_assembly_load

mono_assembly_load_full

mono_assembly_loaded

-

mono_assembly_load_from -

mono_assembly_load_from_full -

mono_assembly_load_with_partial_name +

mono_assembly_load_from

+

mono_assembly_load_from_full

+

mono_assembly_load_with_partial_name

mono_assembly_open

-

mono_assembly_open_full -

mono_set_assemblies_path -

mono_set_rootdir +

mono_assembly_open_full

+

mono_set_assemblies_path

+

mono_set_rootdir

Working with Assemblies

-

mono_assembly_fill_assembly_name -

mono_assembly_foreach +

mono_assembly_fill_assembly_name

+

mono_assembly_foreach

mono_assembly_get_image

mono_assembly_get_main

-

mono_assembly_get_name +

mono_assembly_get_name

mono_assembly_getrootdir

-

mono_assembly_get_assemblyref -

mono_assembly_loaded_full -

mono_assembly_load_reference -

mono_assembly_load_references -

mono_assembly_load_module -

mono_assembly_invoke_load_hook -

mono_assembly_invoke_search_hook -

mono_assembly_set_main -

mono_assembly_setrootdir -

mono_register_config_for_assembly -

mono_register_symfile_for_assembly +

mono_assembly_get_assemblyref

+

mono_assembly_loaded_full

+

mono_assembly_load_reference

+

mono_assembly_load_references

+

mono_assembly_load_module

+

mono_assembly_invoke_load_hook

+

mono_assembly_invoke_search_hook

+

mono_assembly_set_main

+

mono_assembly_setrootdir

+

mono_register_config_for_assembly

+

mono_register_symfile_for_assembly

Assembly Names

@@ -58,11 +58,11 @@ typedef struct _MonoAssembly MonoAssembly; href="http://www.mono-project.com/monodoc/T:System.Reflection.AssemblyName">System.Reflection.AssemblyName managed type. -

mono_assembly_name_new -

mono_assembly_name_get_name -

mono_assembly_name_get_culture -

mono_assembly_name_get_version -

mono_assembly_name_get_pubkeytoken +

mono_assembly_name_new

+

mono_assembly_name_get_name

+

mono_assembly_name_get_culture

+

mono_assembly_name_get_version

+

mono_assembly_name_get_pubkeytoken

mono_assembly_name_free

mono_stringify_assembly_name

mono_assembly_names_equal

@@ -77,10 +77,10 @@ typedef struct _MonoAssembly MonoAssembly;

Advanced

-

mono_install_assembly_load_hook -

mono_install_assembly_search_hook -

mono_install_assembly_refonly_search_hook -

mono_install_assembly_preload_hook -

mono_install_assembly_refonly_preload_hook -

mono_install_assembly_postload_search_hook -

mono_install_assembly_postload_refonly_search_hook +

mono_install_assembly_load_hook

+

mono_install_assembly_search_hook

+

mono_install_assembly_refonly_search_hook

+

mono_install_assembly_preload_hook

+

mono_install_assembly_refonly_preload_hook

+

mono_install_assembly_postload_search_hook

+

mono_install_assembly_postload_refonly_search_hook

diff --git a/docs/sources/mono-api-domains.html b/docs/sources/mono-api-domains.html index b6381c786a6..9ae0bd14497 100644 --- a/docs/sources/mono-api-domains.html +++ b/docs/sources/mono-api-domains.html @@ -34,30 +34,30 @@ typedef struct _MonoAppContext MonoAppContext

mono_domain_assembly_open

mono_domain_create

-

mono_domain_create_appdomain +

mono_domain_create_appdomain

mono_domain_finalize

mono_domain_foreach

mono_domain_free

-

mono_domain_from_appdomain +

mono_domain_from_appdomain

mono_domain_get_by_id

-

mono_domain_get_friendly_name +

mono_domain_get_friendly_name

mono_domain_get_id

mono_domain_get

mono_domain_has_type_resolve

mono_domain_is_unloading

mono_domain_owns_vtable_slot

-

mono_domain_set_config +

mono_domain_set_config

mono_domain_set_internal

mono_domain_set

mono_domain_try_type_resolve

-

mono_domain_try_unload -

mono_domain_unload +

mono_domain_try_unload

+

mono_domain_unload

Contexts

-

mono_context_init +

mono_context_init

mono_context_get

-

mono_context_get_domain_id -

mono_context_get_id +

mono_context_get_domain_id

+

mono_context_get_id

mono_context_set

mono_context_get_desc

diff --git a/docs/sources/mono-api-embedding.html b/docs/sources/mono-api-embedding.html index 1199c45697b..4c4329f634a 100644 --- a/docs/sources/mono-api-embedding.html +++ b/docs/sources/mono-api-embedding.html @@ -150,7 +150,7 @@ getMessage ()

mono_config_string_for_assembly_file

mono_get_config_dir

mono_get_machine_config

-

mono_register_machine_config +

mono_register_machine_config

mono_set_config_dir

Advanced Execution Setups

diff --git a/docs/sources/mono-api-jit.html b/docs/sources/mono-api-jit.html index d21b08fc6fd..14548c4e9d3 100644 --- a/docs/sources/mono-api-jit.html +++ b/docs/sources/mono-api-jit.html @@ -7,10 +7,10 @@

JIT Information

-

mono_jit_info_get_code_size -

mono_jit_info_get_code_start -

mono_jit_info_get_method -

mono_jit_info_table_find +

mono_jit_info_get_code_size

+

mono_jit_info_get_code_start

+

mono_jit_info_get_method

+

mono_jit_info_table_find

Useful Debugging Functions

diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c index 3a939a868ba..82ad87936a7 100644 --- a/mono/metadata/appdomain.c +++ b/mono/metadata/appdomain.c @@ -527,7 +527,7 @@ mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetup * * mono_domain_has_type_resolve: * @domain: application domains being looked up * - * Returns true if the AppDomain.TypeResolve field has been + * Returns: TRUE if the AppDomain.TypeResolve field has been * set. */ gboolean diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c index f381d464b98..a4d20e464a8 100644 --- a/mono/metadata/assembly.c +++ b/mono/metadata/assembly.c @@ -1039,10 +1039,13 @@ mono_assembly_remap_version (MonoAssemblyName *aname, MonoAssemblyName *dest_ana return aname; } -/* +/** * mono_assembly_get_assemblyref: + * @image: pointer to the MonoImage to extract the information from. + * @index: index to the assembly reference in the image. + * @aname: pointer to a `MonoAssemblyName` that will hold the returned value. * - * Fill out ANAME with the assembly name of the INDEXth assembly reference in IMAGE. + * Fills out the @aname with the assembly name of the @index assembly reference in @image. */ void mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname) @@ -1182,6 +1185,14 @@ mono_assembly_load_reference (MonoImage *image, int index) } } +/** + * mono_assembly_load_references: + * @image: + * @status: + * @deprecated: There is no reason to use this method anymore, it does nothing + * + * This method is now a no-op, it does nothing other than setting the @status to #MONO_IMAGE_OK + */ void mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status) { @@ -1487,7 +1498,7 @@ absolute_dir (const gchar *filename) /** * mono_assembly_open_from_bundle: * @filename: Filename requested - * @status: return value + * @status: return status code * * This routine tries to open the assembly specified by `filename' from the * defined bundles, if found, returns the MonoImage for it, if not found @@ -1528,6 +1539,31 @@ mono_assembly_open_from_bundle (const char *filename, MonoImageOpenStatus *statu return NULL; } +/** + * mono_assemblies_open_full: + * @filename: the file to load + * @status: return status code + * @refonly: Whether this assembly is being opened in "reflection-only" mode. +* + * This loads an assembly from the specified @filename. The @filename allows + * a local URL (starting with a file:// prefix). If a file prefix is used, the + * filename is interpreted as a URL, and the filename is URL-decoded. Otherwise the file + * is treated as a local path. + * + * First, an attempt is made to load the assembly from the bundled executable (for those + * deployments that have been done with the `mkbundle` tool or for scenarios where the + * assembly has been registered as an embedded assembly). If this is not the case, then + * the assembly is loaded from disk using `api:mono_image_open_full`. + * + * If the pointed assembly does not live in the Global Assembly Cache, a shadow copy of + * the assembly is made. + * + * If @refonly is set to true, then the assembly is loaded purely for inspection with + * the `System.Reflection` API. + * + * Returns: NULL on error, with the @status set to an error code, or a pointer + * to the assembly. + */ MonoAssembly * mono_assembly_open_full (const char *filename, MonoImageOpenStatus *status, gboolean refonly) { @@ -1640,7 +1676,7 @@ free_item (gpointer val, gpointer user_data) g_free (val); } -/* +/** * mono_assembly_load_friends: * @ass: an assembly * @@ -1726,10 +1762,20 @@ mono_assembly_load_friends (MonoAssembly* ass) /** * mono_assembly_open: * @filename: Opens the assembly pointed out by this name - * @status: where a status code can be returned + * @status: return status code + * + * This loads an assembly from the specified @filename. The @filename allows + * a local URL (starting with a file:// prefix). If a file prefix is used, the + * filename is interpreted as a URL, and the filename is URL-decoded. Otherwise the file + * is treated as a local path. * - * mono_assembly_open opens the PE-image pointed by @filename, and - * loads any external assemblies referenced by it. + * First, an attempt is made to load the assembly from the bundled executable (for those + * deployments that have been done with the `mkbundle` tool or for scenarios where the + * assembly has been registered as an embedded assembly). If this is not the case, then + * the assembly is loaded from disk using `api:mono_image_open_full`. + * + * If the pointed assembly does not live in the Global Assembly Cache, a shadow copy of + * the assembly is made. * * Return: a pointer to the MonoAssembly if @filename contains a valid * assembly or NULL on error. Details about the error are stored in the @@ -1741,6 +1787,25 @@ mono_assembly_open (const char *filename, MonoImageOpenStatus *status) return mono_assembly_open_full (filename, status, FALSE); } +/** + * mono_assembly_load_from_full: + * @image: Image to load the assembly from + * @fname: assembly name to associate with the assembly + * @status: returns the status condition + * @refonly: Whether this assembly is being opened in "reflection-only" mode. + * + * If the provided @image has an assembly reference, it will process the given + * image as an assembly with the given name. + * + * Most likely you want to use the `api:mono_assembly_load_full` method instead. + * + * Returns: A valid pointer to a `MonoAssembly*` on success and the @status will be + * set to #MONO_IMAGE_OK; or NULL on error. + * + * If there is an error loading the assembly the @status will indicate the + * reason with @status being set to `MONO_IMAGE_INVALID` if the + * image did not contain an assembly reference table. + */ MonoAssembly * mono_assembly_load_from_full (MonoImage *image, const char*fname, MonoImageOpenStatus *status, gboolean refonly) @@ -1846,6 +1911,27 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname, return ass; } +/** + * mono_assembly_load_from: + * @image: Image to load the assembly from + * @fname: assembly name to associate with the assembly + * @status: return status code + * + * If the provided @image has an assembly reference, it will process the given + * image as an assembly with the given name. + * + * Most likely you want to use the `api:mono_assembly_load_full` method instead. + * + * This is equivalent to calling `api:mono_assembly_load_from_full` with the + * @refonly parameter set to FALSE. + * Returns: A valid pointer to a `MonoAssembly*` on success and the @status will be + * set to #MONO_IMAGE_OK; or NULL on error. + * + * If there is an error loading the assembly the @status will indicate the + * reason with @status being set to `MONO_IMAGE_INVALID` if the + * image did not contain an assembly reference table. + + */ MonoAssembly * mono_assembly_load_from (MonoImage *image, const char *fname, MonoImageOpenStatus *status) @@ -2276,7 +2362,7 @@ unquote (const char *str) * Parses an assembly qualified type name and assigns the name, * version, culture and token to the provided assembly name object. * - * Returns: true if the name could be parsed. + * Returns: TRUE if the name could be parsed. */ gboolean mono_assembly_name_parse (const char *name, MonoAssemblyName *aname) @@ -2406,6 +2492,23 @@ probe_for_partial_name (const char *basepath, const char *fullname, MonoAssembly } } +/** + * mono_assembly_load_with_partial_name: + * @name: an assembly name that is then parsed by `api:mono_assembly_name_parse`. + * @status: return status code + * + * Loads a Mono Assembly from a name. The name is parsed using `api:mono_assembly_name_parse`, + * so it might contain a qualified type name, version, culture and token. + * + * This will load the assembly from the file whose name is derived from the assembly name + * by appending the .dll extension. + * + * The assembly is loaded from either one of the extra Global Assembly Caches specified + * by the extra GAC paths (specified by the `MONO_GAC_PREFIX` environment variable) or + * if that fails from the GAC. + * + * Returns: NULL on failure, or a pointer to a MonoAssembly on success. + */ MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status) { @@ -3101,6 +3204,15 @@ mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenS return mono_assembly_load_full_internal (aname, NULL, basedir, status, FALSE); } +/** + * mono_assembly_loaded_full: + * @aname: an assembly to look for. + * @refonly: Whether this assembly is being opened in "reflection-only" mode. + * + * This is used to determine if the specified assembly has been loaded + * Returns: NULL If the given @aname assembly has not been loaded, or a pointer to + * a `MonoAssembly` that matches the `MonoAssemblyName` specified. + */ MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, gboolean refonly) { @@ -3118,8 +3230,10 @@ mono_assembly_loaded_full (MonoAssemblyName *aname, gboolean refonly) * mono_assembly_loaded: * @aname: an assembly to look for. * + * This is used to determine if the specified assembly has been loaded + * Returns: NULL If the given @aname assembly has not been loaded, or a pointer to - * a MonoAssembly that matches the MonoAssemblyName specified. + * a `MonoAssembly` that matches the `MonoAssemblyName` specified. */ MonoAssembly* mono_assembly_loaded (MonoAssemblyName *aname) @@ -3223,6 +3337,18 @@ mono_assembly_load_module (MonoAssembly *assembly, guint32 idx) return mono_image_load_file_for_image (assembly->image, idx); } +/** + * mono_assembly_foreach: + * @func: function to invoke for each assembly loaded + * @user_data: data passed to the callback + * + * Invokes the provided @func callback for each assembly loaded into + * the runtime. The first parameter passed to the callback is the + * `MonoAssembly*`, and the second parameter is the @user_data. + * + * This is done for all assemblies loaded in the runtime, not just + * those loaded in the current application domain. + */ void mono_assembly_foreach (GFunc func, gpointer user_data) { diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c index c13e015c3b1..f7844b39bbf 100644 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@ -1787,7 +1787,7 @@ mono_gchandle_set_target (guint32 gchandle, MonoObject *obj) * @gchandle: a GCHandle's handle. * @domain: An application domain. * - * Returns: true if the object wrapped by the @gchandle belongs to the specific @domain. + * Returns: TRUE if the object wrapped by the @gchandle belongs to the specific @domain. */ gboolean mono_gc_is_null (void) diff --git a/mono/metadata/class.c b/mono/metadata/class.c index b6538c7d6f1..44189c2608c 100644 --- a/mono/metadata/class.c +++ b/mono/metadata/class.c @@ -631,11 +631,11 @@ mono_type_get_underlying_type (MonoType *type) return type; } -/* +/** * mono_class_is_open_constructed_type: * @type: a type * - * Returns TRUE if type represents a generics open constructed type. + * Returns: TRUE if type represents a generics open constructed type. * IOW, not all type parameters required for the instantiation have * been provided or it's a generic type definition. * @@ -2911,7 +2911,7 @@ mono_class_interface_offset (MonoClass *klass, MonoClass *itf) { } } -/* +/** * mono_class_interface_offset_with_variance: * * Return the interface offset of @itf in @klass. Sets @non_exact_match to TRUE if the match required variance check @@ -8038,11 +8038,11 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name * This method determines whether @klass is a subclass of @klassc. * * If the @check_interfaces flag is set, then if @klassc is an interface - * this method return true if the @klass implements the interface or + * this method return TRUE if the @klass implements the interface or * if @klass is an interface, if one of its base classes is @klass. * * If @check_interfaces is false then, then if @klass is not an interface - * then it returns true if the @klass is a subclass of @klassc. + * then it returns TRUE if the @klass is a subclass of @klassc. * * if @klass is an interface and @klassc is System.Object, then this function * return true. @@ -8129,8 +8129,9 @@ mono_gparam_is_reference_conversible (MonoClass *target, MonoClass *candidate, g * @klass: the class to be assigned to * @oklass: the source class * - * Both klass and oklass must be instances of the same generic interface. - * Return true if @klass can be assigned to a @klass variable + * Both @klass and @oklass must be instances of the same generic interface. + * + * Returns: TRUE if @klass can be assigned to a @klass variable */ gboolean mono_class_is_variant_compatible (MonoClass *klass, MonoClass *oklass, gboolean check_for_reference_conv) @@ -8281,7 +8282,7 @@ mono_gparam_is_assignable_from (MonoClass *target, MonoClass *candidate) * @klass: the class to be assigned to * @oklass: the source class * - * Return: true if an instance of object oklass can be assigned to an + * Returns: TRUE if an instance of object oklass can be assigned to an * instance of object @klass */ gboolean @@ -8887,7 +8888,7 @@ mono_class_get_element_class (MonoClass *klass) * mono_class_is_valuetype: * @klass: the MonoClass to act on * - * Returns: true if the MonoClass represents a ValueType. + * Returns: TRUE if the MonoClass represents a ValueType. */ gboolean mono_class_is_valuetype (MonoClass *klass) @@ -8899,7 +8900,7 @@ mono_class_is_valuetype (MonoClass *klass) * mono_class_is_enum: * @klass: the MonoClass to act on * - * Returns: true if the MonoClass represents an enumeration. + * Returns: TRUE if the MonoClass represents an enumeration. */ gboolean mono_class_is_enum (MonoClass *klass) @@ -9472,7 +9473,7 @@ mono_class_get_nested_types (MonoClass* klass, gpointer *iter) * mono_class_is_delegate * @klass: the MonoClass to act on * - * Returns: true if the MonoClass represents a System.Delegate. + * Returns: TRUE if the MonoClass represents a System.Delegate. */ mono_bool mono_class_is_delegate (MonoClass *klass) @@ -9485,7 +9486,7 @@ mono_class_is_delegate (MonoClass *klass) * @klass: The MonoClass to act on * @interface: The interface to check if @klass implements. * - * Returns: true if @klass implements @interface. + * Returns: TRUE if @klass implements @interface. */ mono_bool mono_class_implements_interface (MonoClass* klass, MonoClass* iface) @@ -10300,7 +10301,7 @@ can_access_member (MonoClass *access_klass, MonoClass *member_klass, MonoClass* * * Used to determine if a method is allowed to access the specified field. * - * Returns: true if the given @method is allowed to access the @field while following + * Returns: TRUE if the given @method is allowed to access the @field while following * the accessibility rules of the CLI. */ gboolean @@ -10327,7 +10328,7 @@ mono_method_can_access_field (MonoMethod *method, MonoClassField *field) * * Used to determine if the @method is allowed to access the specified @called method. * - * Returns: true if the given @method is allowed to invoke the @called while following + * Returns: TRUE if the given @method is allowed to invoke the @called while following * the accessibility rules of the CLI. */ gboolean diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index c372266713b..2364b0b3637 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -890,7 +890,7 @@ mono_gc_is_finalizer_internal_thread (MonoInternalThread *thread) * This routine tests whether the @thread argument represents the * finalization thread. * - * Returns true if @thread is the finalization thread. + * Returns: TRUE if @thread is the finalization thread. */ gboolean mono_gc_is_finalizer_thread (MonoThread *thread) diff --git a/mono/metadata/metadata.c b/mono/metadata/metadata.c index e50ad0288c9..3e0316df9d4 100644 --- a/mono/metadata/metadata.c +++ b/mono/metadata/metadata.c @@ -3606,7 +3606,7 @@ parse_section_data (MonoImage *m, int *num_clauses, const unsigned char *ptr) * @summary: Where to store the header * * - * Returns: true if the header was properly decoded. + * Returns: TRUE if the header was properly decoded. */ gboolean mono_method_get_header_summary (MonoMethod *method, MonoMethodHeaderSummary *summary) diff --git a/mono/metadata/runtime.c b/mono/metadata/runtime.c index 7e001b99849..fcd87823876 100644 --- a/mono/metadata/runtime.c +++ b/mono/metadata/runtime.c @@ -81,11 +81,14 @@ mono_runtime_fire_process_exit_event (void) } -/* +/** + * mono_runtime_try_shutdown: + * * Try to initialize runtime shutdown. + * * After this call completes the thread pool will stop accepting new jobs and no further threads will be created. * - * @return true if shutdown was initiated by this call or false is other thread beat this one + * Returns: TRUE if shutdown was initiated by this call or false is other thread beat this one. */ gboolean mono_runtime_try_shutdown (void) diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index a442c763af6..74ee377c49a 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -2605,7 +2605,7 @@ sgen_client_metadata_for_object (GCObject *obj) * @gchandle: a GCHandle's handle. * @domain: An application domain. * - * Returns: true if the object wrapped by the @gchandle belongs to the specific @domain. + * Returns: TRUE if the object wrapped by the @gchandle belongs to the specific @domain. */ gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain) diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 668b31e3268..9bd451ee71c 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -4819,7 +4819,7 @@ self_suspend_internal (MonoInternalThread *thread) * This function allows one to determine if a thread was created by the mono runtime and has * a well defined lifecycle or it's a foreigh one, created by the native environment. * - * Returns: true if @thread was not created by the runtime. + * Returns: TRUE if @thread was not created by the runtime. */ mono_bool mono_thread_is_foreign (MonoThread *thread) diff --git a/mono/metadata/verify.c b/mono/metadata/verify.c index e9af9516a1b..8058c5fb37e 100644 --- a/mono/metadata/verify.c +++ b/mono/metadata/verify.c @@ -390,7 +390,7 @@ mono_type_create_fnptr_from_mono_method (VerifyContext *ctx, MonoMethod *method) /* * mono_type_is_enum_type: * - * Returns TRUE if @type is an enum type. + * Returns: TRUE if @type is an enum type. */ static gboolean mono_type_is_enum_type (MonoType *type) @@ -405,7 +405,7 @@ mono_type_is_enum_type (MonoType *type) /* * mono_type_is_value_type: * - * Returns TRUE if @type is named after @namespace.@name. + * Returns: TRUE if @type is named after @namespace.@name. * */ static gboolean @@ -639,8 +639,10 @@ is_valid_generic_instantiation (MonoGenericContainer *gc, MonoGenericContext *co return TRUE; } -/* - * Return true if @candidate is constraint compatible with @target. +/** + * mono_generic_param_is_constraint_compatible: + * + * Returns: TRUE if @candidate is constraint compatible with @target. * * This means that @candidate constraints are a super set of @target constaints */ @@ -1875,8 +1877,12 @@ dump_stack_state (ILCodeDesc *state) } #endif -/*Returns TRUE if candidate array type can be assigned to target. - *Both parameters MUST be of type MONO_TYPE_ARRAY (target->type == MONO_TYPE_ARRAY) +/** + * is_array_type_compatible: + * + * Returns TRUE if candidate array type can be assigned to target. + * + * Both parameters MUST be of type MONO_TYPE_ARRAY (target->type == MONO_TYPE_ARRAY) */ static gboolean is_array_type_compatible (MonoType *target, MonoType *candidate) @@ -2455,10 +2461,10 @@ recursive_boxed_constraint_type_check (VerifyContext *ctx, MonoType *type, MonoC return FALSE; } -/* +/** * is_compatible_boxed_valuetype: * - * Returns TRUE if @candidate / @stack is a valid boxed valuetype. + * Returns: TRUE if @candidate / @stack is a valid boxed valuetype. * * @type The source type. It it tested to be of the proper type. * @candidate type of the boxed valuetype. @@ -4711,7 +4717,7 @@ end_verify: #define HANDLER_START(clause) ((clause)->flags == MONO_EXCEPTION_CLAUSE_FILTER ? (clause)->data.filter_offset : clause->handler_offset) #define IS_CATCH_OR_FILTER(clause) ((clause)->flags == MONO_EXCEPTION_CLAUSE_FILTER || (clause)->flags == MONO_EXCEPTION_CLAUSE_NONE) -/* +/** * is_clause_in_range : * * Returns TRUE if either the protected block or the handler of @clause is in the @start - @end range. @@ -4726,7 +4732,7 @@ is_clause_in_range (MonoExceptionClause *clause, guint32 start, guint32 end) return FALSE; } -/* +/** * is_clause_inside_range : * * Returns TRUE if @clause lies completely inside the @start - @end range. @@ -4741,7 +4747,7 @@ is_clause_inside_range (MonoExceptionClause *clause, guint32 start, guint32 end) return TRUE; } -/* +/** * is_clause_nested : * * Returns TRUE if @nested is nested in @clause. @@ -6020,8 +6026,11 @@ mono_verify_corlib () return NULL; } -/* - * Returns true if @method needs to be verified. +/** + * mono_verifier_is_enabled_for_method: + * @method: the method to probe + * + * Returns TRUE if @method needs to be verified. * */ gboolean @@ -6030,8 +6039,11 @@ mono_verifier_is_enabled_for_method (MonoMethod *method) return mono_verifier_is_enabled_for_class (method->klass) && (method->wrapper_type == MONO_WRAPPER_NONE || method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD); } -/* - * Returns true if @klass need to be verified. +/** + * mono_verifier_is_enabled_for_class: + * @klass: The `MonoClass` to probe + * + * Returns TRUE if @klass need to be verified. * */ gboolean -- 2.25.1