Permalink
Browse files

Wed Feb 24 16:02:42 CET 2010 Paolo Molaro <lupus@ximian.com>

	* reflection.h: the MonoTypeNameParse guts are internal now.
	* assembly.c, assembly.h, image.h: the MonoAssemblyName guts
	are internal now, provide accessors as needed.
	* metadata.h, metadata-internals.h: the MonoMethodSignature
	guts are internal now.
	* Makefile.am: mempool.h is an internal header now.
	* *.h, *.c: remove glib.h usage from the public headers.


svn path=/trunk/mono/; revision=152357
  • Loading branch information...
1 parent 9e1f34d commit 8c3df7bf87da63f1d6ad449df7ed34debc0fbce0 @illupus illupus committed Feb 24, 2010
View
11 mono/metadata/ChangeLog
@@ -1,3 +1,14 @@
+
+Wed Feb 24 16:02:42 CET 2010 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.h: the MonoTypeNameParse guts are internal now.
+ * assembly.c, assembly.h, image.h: the MonoAssemblyName guts
+ are internal now, provide accessors as needed.
+ * metadata.h, metadata-internals.h: the MonoMethodSignature
+ guts are internal now.
+ * Makefile.am: mempool.h is an internal header now.
+ * *.h, *.c: remove glib.h usage from the public headers.
+
2010-02-24 Atsushi Enomoto <atsushi@ximian.com>
* culture-info-table.h : regenerated.
View
2 mono/metadata/Makefile.am
@@ -108,6 +108,7 @@ libmonoruntime_la_SOURCES = \
marshal.c \
marshal.h \
mempool.c \
+ mempool.h \
mempool-internals.h \
metadata.c \
metadata-verify.c \
@@ -188,7 +189,6 @@ libmonoruntimeinclude_HEADERS = \
exception.h \
image.h \
loader.h \
- mempool.h \
metadata.h \
mono-config.h \
mono-debug.h \
View
46 mono/metadata/appdomain.h
@@ -10,22 +10,21 @@
#ifndef _MONO_METADATA_APPDOMAIN_H_
#define _MONO_METADATA_APPDOMAIN_H_
-#include <glib.h>
+#include <mono/utils/mono-publib.h>
#include <mono/metadata/object.h>
#include <mono/metadata/reflection.h>
-#include <mono/metadata/mempool.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
-typedef void (*MonoThreadStartCB) (gsize tid, gpointer stack_start,
- gpointer func);
-typedef void (*MonoThreadAttachCB) (gsize tid, gpointer stack_start);
+typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start,
+ void* func);
+typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start);
typedef struct _MonoAppDomain MonoAppDomain;
typedef struct _MonoJitInfo MonoJitInfo;
-typedef void (*MonoDomainFunc) (MonoDomain *domain, gpointer user_data);
+typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
MonoDomain*
mono_init (const char *filename);
@@ -55,7 +54,7 @@ mono_runtime_quit (void);
void
mono_runtime_set_shutting_down (void);
-gboolean
+mono_bool
mono_runtime_is_shutting_down (void);
const char*
@@ -71,13 +70,13 @@ MonoDomain *
mono_domain_get (void);
MonoDomain *
-mono_domain_get_by_id (gint32 domainid);
+mono_domain_get_by_id (int32_t domainid);
-gint32
+int32_t
mono_domain_get_id (MonoDomain *domain);
-gboolean
-mono_domain_set (MonoDomain *domain, gboolean force);
+mono_bool
+mono_domain_set (MonoDomain *domain, mono_bool force);
void
mono_domain_set_internal (MonoDomain *domain);
@@ -88,32 +87,32 @@ mono_domain_unload (MonoDomain *domain);
void
mono_domain_try_unload (MonoDomain *domain, MonoObject **exc);
-gboolean
+mono_bool
mono_domain_is_unloading (MonoDomain *domain);
MonoDomain *
mono_domain_from_appdomain (MonoAppDomain *appdomain);
void
-mono_domain_foreach (MonoDomainFunc func, gpointer user_data);
+mono_domain_foreach (MonoDomainFunc func, void* user_data);
MonoAssembly *
mono_domain_assembly_open (MonoDomain *domain, const char *name);
-gboolean
-mono_domain_finalize (MonoDomain *domain, guint32 timeout);
+mono_bool
+mono_domain_finalize (MonoDomain *domain, uint32_t timeout);
void
-mono_domain_free (MonoDomain *domain, gboolean force);
+mono_domain_free (MonoDomain *domain, mono_bool force);
-gboolean
+mono_bool
mono_domain_has_type_resolve (MonoDomain *domain);
MonoReflectionAssembly *
mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb);
-gboolean
-mono_domain_owns_vtable_slot (MonoDomain *domain, gpointer vtable_slot);
+mono_bool
+mono_domain_owns_vtable_slot (MonoDomain *domain, void* vtable_slot);
void
mono_context_init (MonoDomain *domain);
@@ -129,7 +128,7 @@ mono_jit_info_table_find (MonoDomain *domain, char *addr);
/* MonoJitInfo accessors */
-gpointer
+void*
mono_jit_info_get_code_start (MonoJitInfo* ji);
int
@@ -208,11 +207,12 @@ mono_get_exception_class (void);
void
mono_security_enable_core_clr (void);
-typedef gboolean (*MonoCoreClrPlatformCB) (const char *image_name);
+typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name);
void
mono_security_set_core_clr_platform_callback (MonoCoreClrPlatformCB callback);
-G_END_DECLS
+MONO_END_DECLS
+
#endif /* _MONO_METADATA_APPDOMAIN_H_ */
View
51 mono/metadata/assembly.c
@@ -1886,6 +1886,57 @@ mono_assembly_name_parse (const char *name, MonoAssemblyName *aname)
return mono_assembly_name_parse_full (name, aname, FALSE, NULL, NULL);
}
+/**
+ * mono_assembly_name_new:
+ * @name: name to parse
+ *
+ * Allocate a new MonoAssemblyName and fill its values from the
+ * passed @name.
+ *
+ * Returns: a newly allocated structure or NULL if there was any failure.
+ */
+MonoAssemblyName*
+mono_assembly_name_new (const char *name)
+{
+ MonoAssemblyName *aname = g_new0 (MonoAssemblyName, 1);
+ if (mono_assembly_name_parse (name, aname))
+ return aname;
+ g_free (aname);
+ return NULL;
+}
+
+const char*
+mono_assembly_name_get_name (MonoAssemblyName *aname)
+{
+ return aname->name;
+}
+
+const char*
+mono_assembly_name_get_culture (MonoAssemblyName *aname)
+{
+ return aname->culture;
+}
+
+mono_byte*
+mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname)
+{
+ if (aname->public_key_token [0])
+ return aname->public_key_token;
+ return NULL;
+}
+
+uint16_t
+mono_assembly_name_get_version (MonoAssemblyName *aname, uint16_t *minor, uint16_t *build, uint16_t *revision)
+{
+ if (minor)
+ *minor = aname->minor;
+ if (build)
+ *build = aname->build;
+ if (revision)
+ *revision = aname->revision;
+ return aname->major;
+}
+
static MonoAssembly*
probe_for_partial_name (const char *basepath, const char *fullname, MonoAssemblyName *aname, MonoImageOpenStatus *status)
{
View
56 mono/metadata/assembly.h
@@ -1,62 +1,60 @@
#ifndef _MONONET_METADATA_ASSEMBLY_H_
#define _MONONET_METADATA_ASSEMBLY_H_
-#include <glib.h>
-
#include <mono/metadata/image.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
void mono_assemblies_init (void);
void mono_assemblies_cleanup (void);
MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
MonoAssembly *mono_assembly_open_full (const char *filename,
MonoImageOpenStatus *status,
- gboolean refonly);
+ mono_bool refonly);
MonoAssembly* mono_assembly_load (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status,
- gboolean refonly);
+ mono_bool refonly);
MonoAssembly* mono_assembly_load_from (MonoImage *image, const char *fname,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load_from_full (MonoImage *image, const char *fname,
MonoImageOpenStatus *status,
- gboolean refonly);
+ mono_bool refonly);
MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_loaded (MonoAssemblyName *aname);
-MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, gboolean refonly);
+MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, mono_bool refonly);
void mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname);
void mono_assembly_load_reference (MonoImage *image, int index);
void mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
-MonoImage* mono_assembly_load_module (MonoAssembly *assembly, guint32 idx);
+MonoImage* mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
void mono_assembly_close (MonoAssembly *assembly);
void mono_assembly_setrootdir (const char *root_dir);
-G_CONST_RETURN gchar *mono_assembly_getrootdir (void);
-void mono_assembly_foreach (GFunc func, gpointer user_data);
+MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
+void mono_assembly_foreach (MonoFunc func, void* user_data);
void mono_assembly_set_main (MonoAssembly *assembly);
MonoAssembly *mono_assembly_get_main (void);
MonoImage *mono_assembly_get_image (MonoAssembly *assembly);
-gboolean mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
-gboolean mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
+mono_bool mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
+mono_bool mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
char* mono_stringify_assembly_name (MonoAssemblyName *aname);
/* Installs a function which is called each time a new assembly is loaded. */
-typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, gpointer user_data);
-void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, gpointer user_data);
+typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, void* user_data);
+void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data);
/*
* Installs a new function which is used to search the list of loaded
* assemblies for a given assembly name.
*/
-typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, gpointer user_data);
-void mono_install_assembly_search_hook (MonoAssemblySearchFunc func, gpointer user_data);
-void mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, gpointer user_data);
+typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, void* user_data);
+void mono_install_assembly_search_hook (MonoAssemblySearchFunc func, void* user_data);
+void mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
@@ -65,26 +63,34 @@ MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
* an assembly fails. This could invoke AssemblyResolve events.
*/
void
-mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, gpointer user_data);
+mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, void* user_data);
void
-mono_install_assembly_postload_refonly_search_hook (MonoAssemblySearchFunc func, gpointer user_data);
+mono_install_assembly_postload_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
/* Installs a function which is called before a new assembly is loaded
* The hook are invoked from last hooked to first. If any of them returns
* a non-null value, that will be the value returned in mono_assembly_load */
typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
- gchar **assemblies_path,
- gpointer user_data);
+ char **assemblies_path,
+ void* user_data);
void mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func,
- gpointer user_data);
+ void* user_data);
void mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func,
- gpointer user_data);
+ void* user_data);
void mono_assembly_invoke_load_hook (MonoAssembly *ass);
+MonoAssemblyName* mono_assembly_name_new (const char *name);
+const char* mono_assembly_name_get_name (MonoAssemblyName *aname);
+const char* mono_assembly_name_get_culture (MonoAssemblyName *aname);
+uint16_t mono_assembly_name_get_version (MonoAssemblyName *aname,
+ uint16_t *minor, uint16_t *build, uint16_t *revision);
+mono_byte* mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname);
+void mono_assembly_name_free (MonoAssemblyName *aname);
+
typedef struct {
const char *name;
const unsigned char *data;
@@ -97,6 +103,8 @@ void mono_register_machine_config (const char *config_xml);
void mono_set_rootdir (void);
void mono_set_dirs (const char *assembly_dir, const char *config_dir);
-G_END_DECLS
+
+MONO_END_DECLS
+
#endif
View
1 mono/metadata/cil-coff.h
@@ -3,6 +3,7 @@
#define __MONO_CIL_COFF_H__
#include <mono/metadata/metadata.h>
+#include <glib.h>
/*
* 25.2.1: Method header type values
View
89 mono/metadata/class.h
@@ -4,9 +4,8 @@
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
#include <mono/metadata/loader.h>
-#include <mono/utils/mono-error.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
typedef struct MonoVTable MonoVTable;
@@ -19,19 +18,19 @@ typedef struct {
MonoVTable *xdomain_vtable;
MonoClass *proxy_class;
char* proxy_class_name;
- guint interface_count;
+ uint32_t interface_count;
MonoClass *interfaces [MONO_ZERO_LEN_ARRAY];
} MonoRemoteClass;
#define MONO_SIZEOF_REMOTE_CLASS (sizeof (MonoRemoteClass) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
MonoClass *
-mono_class_get (MonoImage *image, guint32 type_token);
+mono_class_get (MonoImage *image, uint32_t type_token);
MonoClass *
-mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context);
+mono_class_get_full (MonoImage *image, uint32_t type_token, MonoGenericContext *context);
-gboolean
+mono_bool
mono_class_init (MonoClass *klass);
MonoVTable *
@@ -47,10 +46,10 @@ MonoMethod *
mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int param_count, int flags);
MonoClass *
-mono_class_from_typeref (MonoImage *image, guint32 type_token);
+mono_class_from_typeref (MonoImage *image, uint32_t type_token);
MonoClass *
-mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, gboolean is_mvar);
+mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar);
MonoType*
mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */;
@@ -62,65 +61,65 @@ MonoMethod *
mono_get_inflated_method (MonoMethod *method);
MonoClassField*
-mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, MonoGenericContext *context);
+mono_field_from_token (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context);
MonoClass *
-mono_bounded_array_class_get (MonoClass *element_class, guint32 rank, gboolean bounded);
+mono_bounded_array_class_get (MonoClass *element_class, uint32_t rank, mono_bool bounded);
MonoClass *
-mono_array_class_get (MonoClass *element_class, guint32 rank);
+mono_array_class_get (MonoClass *element_class, uint32_t rank);
MonoClass *
mono_ptr_class_get (MonoType *type);
MonoClassField *
-mono_class_get_field (MonoClass *klass, guint32 field_token);
+mono_class_get_field (MonoClass *klass, uint32_t field_token);
MonoClassField *
mono_class_get_field_from_name (MonoClass *klass, const char *name);
-guint32
+uint32_t
mono_class_get_field_token (MonoClassField *field);
-guint32
+uint32_t
mono_class_get_event_token (MonoEvent *event);
MonoProperty*
mono_class_get_property_from_name (MonoClass *klass, const char *name);
-guint32
+uint32_t
mono_class_get_property_token (MonoProperty *prop);
-gint32
+int32_t
mono_array_element_size (MonoClass *ac);
-gint32
+int32_t
mono_class_instance_size (MonoClass *klass);
-gint32
+int32_t
mono_class_array_element_size (MonoClass *klass);
-gint32
+int32_t
mono_class_data_size (MonoClass *klass);
-gint32
-mono_class_value_size (MonoClass *klass, guint32 *align);
+int32_t
+mono_class_value_size (MonoClass *klass, uint32_t *align);
-gint32
+int32_t
mono_class_min_align (MonoClass *klass);
MonoClass *
mono_class_from_mono_type (MonoType *type);
-gboolean
+mono_bool
mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc,
- gboolean check_interfaces);
+ mono_bool check_interfaces);
-gboolean
+mono_bool
mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass);
-gpointer
-mono_ldtoken (MonoImage *image, guint32 token, MonoClass **retclass, MonoGenericContext *context);
+void*
+mono_ldtoken (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context);
char*
mono_type_get_name (MonoType *type);
@@ -135,10 +134,10 @@ mono_class_get_image (MonoClass *klass);
MonoClass*
mono_class_get_element_class (MonoClass *klass);
-gboolean
+mono_bool
mono_class_is_valuetype (MonoClass *klass);
-gboolean
+mono_bool
mono_class_is_enum (MonoClass *klass);
MonoType*
@@ -153,7 +152,7 @@ mono_class_get_nesting_type (MonoClass *klass);
int
mono_class_get_rank (MonoClass *klass);
-guint32
+uint32_t
mono_class_get_flags (MonoClass *klass);
const char*
@@ -165,7 +164,7 @@ mono_class_get_namespace (MonoClass *klass);
MonoType*
mono_class_get_type (MonoClass *klass);
-guint32
+uint32_t
mono_class_get_type_token (MonoClass *klass);
MonoType*
@@ -184,22 +183,22 @@ int
mono_class_num_events (MonoClass *klass);
MonoClassField*
-mono_class_get_fields (MonoClass* klass, gpointer *iter);
+mono_class_get_fields (MonoClass* klass, void **iter);
MonoMethod*
-mono_class_get_methods (MonoClass* klass, gpointer *iter);
+mono_class_get_methods (MonoClass* klass, void **iter);
MonoProperty*
-mono_class_get_properties (MonoClass* klass, gpointer *iter);
+mono_class_get_properties (MonoClass* klass, void **iter);
MonoEvent*
-mono_class_get_events (MonoClass* klass, gpointer *iter);
+mono_class_get_events (MonoClass* klass, void **iter);
MonoClass*
-mono_class_get_interfaces (MonoClass* klass, gpointer *iter);
+mono_class_get_interfaces (MonoClass* klass, void **iter);
MonoClass*
-mono_class_get_nested_types (MonoClass* klass, gpointer *iter);
+mono_class_get_nested_types (MonoClass* klass, void **iter);
/* MonoClassField accessors */
const char*
@@ -211,10 +210,10 @@ mono_field_get_type (MonoClassField *field);
MonoClass*
mono_field_get_parent (MonoClassField *field);
-guint32
+uint32_t
mono_field_get_flags (MonoClassField *field);
-guint32
+uint32_t
mono_field_get_offset (MonoClassField *field);
const char *
@@ -233,7 +232,7 @@ mono_property_get_get_method (MonoProperty *prop);
MonoClass*
mono_property_get_parent (MonoProperty *prop);
-guint32
+uint32_t
mono_property_get_flags (MonoProperty *prop);
/* MonoEvent accessors */
@@ -255,21 +254,21 @@ mono_event_get_raise_method (MonoEvent *event);
MonoClass*
mono_event_get_parent (MonoEvent *event);
-guint32
+uint32_t
mono_event_get_flags (MonoEvent *event);
MonoMethod *
mono_class_get_method_from_name (MonoClass *klass, const char *name, int param_count);
char *
-mono_class_name_from_token (MonoImage *image, guint32 type_token);
+mono_class_name_from_token (MonoImage *image, uint32_t type_token);
-gboolean
+mono_bool
mono_method_can_access_field (MonoMethod *method, MonoClassField *field);
-gboolean
+mono_bool
mono_method_can_access_method (MonoMethod *method, MonoMethod *called);
-G_END_DECLS
+MONO_END_DECLS
#endif /* _MONO_CLI_CLASS_H_ */
View
26 mono/metadata/debug-helpers.h
@@ -1,50 +1,48 @@
#ifndef __MONO_DEBUG_HELPERS_H__
#define __MONO_DEBUG_HELPERS_H__
-#include <glib.h>
#include <mono/metadata/class.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
typedef struct MonoDisHelper MonoDisHelper;
-typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, guint32 ip_offset);
-typedef char* (*MonoDisTokener) (MonoDisHelper *dh, MonoMethod *method, guint32 token);
+typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, uint32_t ip_offset);
+typedef char* (*MonoDisTokener) (MonoDisHelper *dh, MonoMethod *method, uint32_t token);
struct MonoDisHelper {
const char *newline;
const char *label_format;
const char *label_target;
MonoDisIndenter indenter;
MonoDisTokener tokener;
- gpointer user_data;
+ void* user_data;
};
-char* mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar** endp);
-char* mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar* end);
+char* mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp);
+char* mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end);
typedef struct MonoMethodDesc MonoMethodDesc;
-void mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace);
char* mono_type_full_name (MonoType *type);
-char* mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace);
+char* mono_signature_get_desc (MonoMethodSignature *sig, mono_bool include_namespace);
char* mono_context_get_desc (MonoGenericContext *context);
-MonoMethodDesc* mono_method_desc_new (const char *name, gboolean include_namespace);
+MonoMethodDesc* mono_method_desc_new (const char *name, mono_bool include_namespace);
MonoMethodDesc* mono_method_desc_from_method (MonoMethod *method);
void mono_method_desc_free (MonoMethodDesc *desc);
-gboolean mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method);
-gboolean mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method);
+mono_bool mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method);
+mono_bool mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method);
MonoMethod* mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
MonoMethod* mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
-char* mono_method_full_name (MonoMethod *method, gboolean signature);
+char* mono_method_full_name (MonoMethod *method, mono_bool signature);
char* mono_field_full_name (MonoClassField *field);
-G_END_DECLS
+MONO_END_DECLS
#endif /* __MONO_DEBUG_HELPERS_H__ */
View
4 mono/metadata/domain-internals.h
@@ -5,6 +5,7 @@
#define __MONO_METADATA_DOMAIN_INTERNALS_H__
#include <mono/metadata/appdomain.h>
+#include <mono/metadata/mempool.h>
#include <mono/metadata/lock-tracer.h>
#include <mono/utils/mono-codeman.h>
#include <mono/utils/mono-hash.h>
@@ -478,9 +479,6 @@ mono_runtime_get_no_exec (void) MONO_INTERNAL;
gboolean
mono_assembly_name_parse (const char *name, MonoAssemblyName *aname) MONO_INTERNAL;
-void
-mono_assembly_name_free (MonoAssemblyName *aname) MONO_INTERNAL;
-
MonoImage *mono_assembly_open_from_bundle (const char *filename,
MonoImageOpenStatus *status,
gboolean refonly) MONO_INTERNAL;
View
10 mono/metadata/environment.h
@@ -10,13 +10,15 @@
#ifndef _MONO_METADATA_ENVIRONMENT_H_
#define _MONO_METADATA_ENVIRONMENT_H_
-G_BEGIN_DECLS
+#include <mono/utils/mono-publib.h>
-extern gint32 mono_environment_exitcode_get (void);
-extern void mono_environment_exitcode_set (gint32 value);
+MONO_BEGIN_DECLS
+
+extern int32_t mono_environment_exitcode_get (void);
+extern void mono_environment_exitcode_set (int32_t value);
extern MonoString* ves_icall_System_Environment_GetOSVersionString (void);
-G_END_DECLS
+MONO_END_DECLS
#endif /* _MONO_METADATA_ENVIRONMENT_H_ */
View
1 mono/metadata/exception.c
@@ -13,6 +13,7 @@
#include <mono/metadata/exception.h>
#include <mono/metadata/object-internals.h>
+#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/appdomain.h>
#include <string.h>
View
12 mono/metadata/exception.h
@@ -7,15 +7,15 @@
#include <mono/metadata/object.h>
#include <mono/metadata/image.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
extern MonoException *
mono_exception_from_name (MonoImage *image,
const char* name_space,
const char *name);
MonoException *
-mono_exception_from_token (MonoImage *image, guint32 token);
+mono_exception_from_token (MonoImage *image, uint32_t token);
MonoException *
mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
@@ -26,8 +26,8 @@ mono_exception_from_name_msg (MonoImage *image, const char *name_space,
const char *name, const char *msg);
MonoException *
-mono_exception_from_token_two_strings (MonoImage *image, guint32 token,
- MonoString *a1, MonoString *a2);
+mono_exception_from_token_two_strings (MonoImage *image, uint32_t token,
+ MonoString *a1, MonoString *a2);
extern MonoException *
mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
@@ -110,7 +110,7 @@ MonoException *
mono_get_exception_file_not_found2 (const char *msg, MonoString *fname);
MonoException *
-mono_get_exception_type_initialization (const gchar *type_name, MonoException *inner);
+mono_get_exception_type_initialization (const char *type_name, MonoException *inner);
MonoException *
mono_get_exception_synchronization_lock (const char *msg);
@@ -142,6 +142,6 @@ mono_get_exception_method_access (void);
MonoException *
mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions);
-G_END_DECLS
+MONO_END_DECLS
#endif /* _MONO_METADATA_EXCEPTION_H_ */
View
61 mono/metadata/image.h
@@ -2,29 +2,15 @@
#define _MONONET_METADATA_IMAGE_H_
#include <stdio.h>
-#include <glib.h>
+#include <mono/utils/mono-publib.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
+typedef struct _MonoAssemblyName MonoAssemblyName;
typedef struct _MonoTableInfo MonoTableInfo;
-#define MONO_PUBLIC_KEY_TOKEN_LENGTH 17
-
-typedef struct {
- const char *name;
- const char *culture;
- const char *hash_value;
- const guint8* public_key;
- // string of 16 hex chars + 1 NULL
- guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
- guint32 hash_alg;
- guint32 hash_len;
- guint32 flags;
- guint16 major, minor, build, revision;
-} MonoAssemblyName;
-
typedef enum {
MONO_IMAGE_OK,
MONO_IMAGE_ERROR_ERRNO,
@@ -38,20 +24,20 @@ void mono_images_cleanup (void);
MonoImage *mono_image_open (const char *fname,
MonoImageOpenStatus *status);
MonoImage *mono_image_open_full (const char *fname,
- MonoImageOpenStatus *status, gboolean refonly);
+ MonoImageOpenStatus *status, mono_bool refonly);
MonoImage *mono_pe_file_open (const char *fname,
MonoImageOpenStatus *status);
-MonoImage *mono_image_open_from_data (char *data, guint32 data_len, gboolean need_copy,
+MonoImage *mono_image_open_from_data (char *data, uint32_t data_len, mono_bool need_copy,
MonoImageOpenStatus *status);
-MonoImage *mono_image_open_from_data_full (char *data, guint32 data_len, gboolean need_copy,
- MonoImageOpenStatus *status, gboolean refonly);
-MonoImage *mono_image_open_from_data_with_name (char *data, guint32 data_len, gboolean need_copy,
- MonoImageOpenStatus *status, gboolean refonly, const char *name);
+MonoImage *mono_image_open_from_data_full (char *data, uint32_t data_len, mono_bool need_copy,
+ MonoImageOpenStatus *status, mono_bool refonly);
+MonoImage *mono_image_open_from_data_with_name (char *data, uint32_t data_len, mono_bool need_copy,
+ MonoImageOpenStatus *status, mono_bool refonly, const char *name);
void mono_image_fixup_vtable (MonoImage *image);
MonoImage *mono_image_loaded (const char *name);
-MonoImage *mono_image_loaded_full (const char *name, gboolean refonly);
+MonoImage *mono_image_loaded_full (const char *name, mono_bool refonly);
MonoImage *mono_image_loaded_by_guid (const char *guid);
-MonoImage *mono_image_loaded_by_guid_full (const char *guid, gboolean refonly);
+MonoImage *mono_image_loaded_by_guid_full (const char *guid, mono_bool refonly);
void mono_image_init (MonoImage *image);
void mono_image_close (MonoImage *image);
void mono_image_addref (MonoImage *image);
@@ -62,8 +48,8 @@ int mono_image_ensure_section (MonoImage *image,
int mono_image_ensure_section_idx (MonoImage *image,
int section);
-guint32 mono_image_get_entry_point (MonoImage *image);
-const char *mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size);
+uint32_t mono_image_get_entry_point (MonoImage *image);
+const char *mono_image_get_resource (MonoImage *image, uint32_t offset, uint32_t *size);
MonoImage* mono_image_load_file_for_image (MonoImage *image, int fileidx);
MonoImage* mono_image_load_module (MonoImage *image, int idx);
@@ -72,8 +58,8 @@ const char* mono_image_get_name (MonoImage *image);
const char* mono_image_get_filename (MonoImage *image);
const char * mono_image_get_guid (MonoImage *image);
MonoAssembly* mono_image_get_assembly (MonoImage *image);
-gboolean mono_image_is_dynamic (MonoImage *image);
-char* mono_image_rva_map (MonoImage *image, guint32 rva);
+mono_bool mono_image_is_dynamic (MonoImage *image);
+char* mono_image_rva_map (MonoImage *image, uint32_t rva);
const MonoTableInfo *mono_image_get_table_info (MonoImage *image, int table_id);
int mono_image_get_table_rows (MonoImage *image, int table_id);
@@ -82,17 +68,16 @@ int mono_table_info_get_rows (const MonoTableInfo *table);
/* This actually returns a MonoPEResourceDataEntry *, but declaring it
* causes an include file loop.
*/
-gpointer mono_image_lookup_resource (MonoImage *image, guint32 res_id,
- guint32 lang_id, gunichar2 *name);
+void* mono_image_lookup_resource (MonoImage *image, uint32_t res_id,
+ uint32_t lang_id, mono_unichar2 *name);
-const char* mono_image_get_public_key (MonoImage *image, guint32 *size);
-const char* mono_image_get_strong_name (MonoImage *image, guint32 *size);
-guint32 mono_image_strong_name_position (MonoImage *image, guint32 *size);
+const char* mono_image_get_public_key (MonoImage *image, uint32_t *size);
+const char* mono_image_get_strong_name (MonoImage *image, uint32_t *size);
+uint32_t mono_image_strong_name_position (MonoImage *image, uint32_t *size);
void mono_image_add_to_name_cache (MonoImage *image,
- const char *nspace,
- const char *name, guint32 idx);
-gboolean mono_image_has_authenticode_entry (MonoImage *image);
+ const char *nspace, const char *name, uint32_t idx);
+mono_bool mono_image_has_authenticode_entry (MonoImage *image);
-G_END_DECLS
+MONO_END_DECLS
#endif
View
38 mono/metadata/loader.h
@@ -4,30 +4,30 @@
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
-typedef gboolean (*MonoStackWalk) (MonoMethod *method, gint32 native_offset, gint32 il_offset, gboolean managed, gpointer data);
+typedef mono_bool (*MonoStackWalk) (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data);
MonoMethod *
-mono_get_method (MonoImage *image, guint32 token, MonoClass *klass);
+mono_get_method (MonoImage *image, uint32_t token, MonoClass *klass);
MonoMethod *
-mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass,
+mono_get_method_full (MonoImage *image, uint32_t token, MonoClass *klass,
MonoGenericContext *context);
MonoMethod *
-mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class,
+mono_get_method_constrained (MonoImage *image, uint32_t token, MonoClass *constrained_class,
MonoGenericContext *context, MonoMethod **cil_method);
void
mono_free_method (MonoMethod *method);
MonoMethodSignature*
-mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token,
+mono_method_get_signature_full (MonoMethod *method, MonoImage *image, uint32_t token,
MonoGenericContext *context);
MonoMethodSignature*
-mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token);
+mono_method_get_signature (MonoMethod *method, MonoImage *image, uint32_t token);
MonoMethodSignature*
mono_method_signature (MonoMethod *method);
@@ -41,53 +41,53 @@ mono_method_get_name (MonoMethod *method);
MonoClass*
mono_method_get_class (MonoMethod *method);
-guint32
+uint32_t
mono_method_get_token (MonoMethod *method);
-guint32
-mono_method_get_flags (MonoMethod *method, guint32 *iflags);
+uint32_t
+mono_method_get_flags (MonoMethod *method, uint32_t *iflags);
-guint32
+uint32_t
mono_method_get_index (MonoMethod *method);
MonoImage *
mono_load_image (const char *fname, MonoImageOpenStatus *status);
void
-mono_add_internal_call (const char *name, gconstpointer method);
+mono_add_internal_call (const char *name, const void* method);
-gpointer
+void*
mono_lookup_internal_call (MonoMethod *method);
void
mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc);
-gpointer
+void*
mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char **exc_arg);
void
mono_method_get_param_names (MonoMethod *method, const char **names);
-guint32
+uint32_t
mono_method_get_param_token (MonoMethod *method, int idx);
void
mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs);
-gboolean
+mono_bool
mono_method_has_marshal_info (MonoMethod *method);
MonoMethod*
mono_method_get_last_managed (void);
void
-mono_stack_walk (MonoStackWalk func, gpointer user_data);
+mono_stack_walk (MonoStackWalk func, void* user_data);
/* Use this if the IL offset is not needed: it's faster */
void
-mono_stack_walk_no_il (MonoStackWalk func, gpointer user_data);
+mono_stack_walk_no_il (MonoStackWalk func, void* user_data);
-G_END_DECLS
+MONO_END_DECLS
#endif
View
1 mono/metadata/mempool-internals.h
@@ -4,6 +4,7 @@
#include <glib.h>
#include "mono/utils/mono-compiler.h"
+#include "mono/metadata/mempool.h"
static inline GList*
g_list_prepend_mempool (MonoMemPool *mp, GList *list, gpointer data)
View
26 mono/metadata/mempool.h
@@ -1,7 +1,9 @@
#ifndef _MONO_MEMPOOL_H_
#define _MONO_MEMPOOL_H_
-G_BEGIN_DECLS
+#include <mono/utils/mono-publib.h>
+
+MONO_BEGIN_DECLS
typedef struct _MonoMemPool MonoMemPool;
@@ -23,25 +25,21 @@ mono_mempool_empty (MonoMemPool *pool);
void
mono_mempool_stats (MonoMemPool *pool);
-gpointer
-mono_mempool_alloc (MonoMemPool *pool,
- guint size);
+void*
+mono_mempool_alloc (MonoMemPool *pool, unsigned int size);
-gpointer
-mono_mempool_alloc0 (MonoMemPool *pool,
- guint size);
+void*
+mono_mempool_alloc0 (MonoMemPool *pool, unsigned int size);
-gboolean
-mono_mempool_contains_addr (MonoMemPool *pool,
- gpointer addr);
+mono_bool
+mono_mempool_contains_addr (MonoMemPool *pool, void* addr);
char*
-mono_mempool_strdup (MonoMemPool *pool,
- const char *s);
+mono_mempool_strdup (MonoMemPool *pool, const char *s);
-guint32
+uint32_t
mono_mempool_get_allocated (MonoMemPool *pool);
-G_END_DECLS
+MONO_END_DECLS
#endif
View
44 mono/metadata/metadata-internals.h
@@ -12,11 +12,36 @@
#include "mono/utils/monobitset.h"
#include "mono/utils/mono-property-hash.h"
#include "mono/utils/mono-value-hash.h"
+#include <mono/utils/mono-error.h>
#define MONO_SECMAN_FLAG_INIT(x) (x & 0x2)
#define MONO_SECMAN_FLAG_GET_VALUE(x) (x & 0x1)
#define MONO_SECMAN_FLAG_SET_VALUE(x,y) do { x = ((y) ? 0x3 : 0x2); } while (0)
+#define MONO_PUBLIC_KEY_TOKEN_LENGTH 17
+
+struct _MonoAssemblyName {
+ const char *name;
+ const char *culture;
+ const char *hash_value;
+ const mono_byte* public_key;
+ // string of 16 hex chars + 1 NULL
+ mono_byte public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
+ uint32_t hash_alg;
+ uint32_t hash_len;
+ uint32_t flags;
+ uint16_t major, minor, build, revision;
+};
+
+struct MonoTypeNameParse {
+ char *name_space;
+ char *name;
+ MonoAssemblyName assembly;
+ GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
+ GPtrArray *type_arguments;
+ GList *nested;
+};
+
struct _MonoAssembly {
/*
* The number of appdomains which have this assembly loaded plus the number of
@@ -406,6 +431,23 @@ typedef struct {
#define MONO_SIZEOF_METHOD_HEADER (sizeof (struct _MonoMethodHeader) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+struct _MonoMethodSignature {
+ unsigned int hasthis : 1;
+ unsigned int explicit_this : 1;
+ unsigned int call_convention : 6;
+ unsigned int pinvoke : 1;
+ unsigned int ref_count : 23;
+ guint16 param_count;
+ gint16 sentinelpos;
+ unsigned int generic_param_count : 30;
+ unsigned int is_inflated : 1;
+ unsigned int has_type_parameters : 1;
+ MonoType *ret;
+ MonoType *params [MONO_ZERO_LEN_ARRAY];
+};
+
+#define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+
/* for use with allocated memory blocks (assumes alignment is to 8 bytes) */
guint mono_aligned_addr_hash (gconstpointer ptr) MONO_INTERNAL;
@@ -569,6 +611,8 @@ mono_get_shared_generic_inst (MonoGenericContainer *container) MONO_INTERNAL;
int
mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open) MONO_INTERNAL;
+void mono_type_get_desc (GString *res, MonoType *type, mono_bool include_namespace);
+
gboolean
mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only) MONO_INTERNAL;
View
181 mono/metadata/metadata.h
@@ -2,13 +2,13 @@
#ifndef __MONO_METADATA_H__
#define __MONO_METADATA_H__
-#include <glib.h>
+#include <mono/utils/mono-publib.h>
#include <mono/metadata/blob.h>
#include <mono/metadata/row-indexes.h>
#include <mono/metadata/image.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
/*
* When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
@@ -194,17 +194,17 @@ typedef struct {
union {
struct {
MonoMarshalNative elem_type;
- gint32 num_elem; /* -1 if not set */
- gint16 param_num; /* -1 if not set */
- gint16 elem_mult; /* -1 if not set */
+ int32_t num_elem; /* -1 if not set */
+ int16_t param_num; /* -1 if not set */
+ int16_t elem_mult; /* -1 if not set */
} array_data;
struct {
char *custom_name;
char *cookie;
} custom_data;
struct {
MonoMarshalVariant elem_type;
- gint32 num_elem;
+ int32_t num_elem;
} safearray_data;
} data;
} MonoMarshalSpec;
@@ -213,12 +213,12 @@ void mono_metadata_init (void);
void mono_metadata_decode_row (const MonoTableInfo *t,
int idx,
- guint32 *res,
+ uint32_t *res,
int res_size);
-guint32 mono_metadata_decode_row_col (const MonoTableInfo *t,
+uint32_t mono_metadata_decode_row_col (const MonoTableInfo *t,
int idx,
- guint col);
+ unsigned int col);
/*
* This macro is used to extract the size of the table encoded in
@@ -229,59 +229,59 @@ guint32 mono_metadata_decode_row_col (const MonoTableInfo *t,
int mono_metadata_compute_size (MonoImage *meta,
int tableindex,
- guint32 *result_bitfield);
+ uint32_t *result_bitfield);
/*
*
*/
const char *mono_metadata_locate (MonoImage *meta, int table, int idx);
-const char *mono_metadata_locate_token (MonoImage *meta, guint32 token);
+const char *mono_metadata_locate_token (MonoImage *meta, uint32_t token);
-const char *mono_metadata_string_heap (MonoImage *meta, guint32 table_index);
-const char *mono_metadata_blob_heap (MonoImage *meta, guint32 table_index);
-const char *mono_metadata_user_string (MonoImage *meta, guint32 table_index);
-const char *mono_metadata_guid_heap (MonoImage *meta, guint32 table_index);
-
-guint32 mono_metadata_typedef_from_field (MonoImage *meta, guint32 table_index);
-guint32 mono_metadata_typedef_from_method (MonoImage *meta, guint32 table_index);
-guint32 mono_metadata_nested_in_typedef (MonoImage *meta, guint32 table_index);
-guint32 mono_metadata_nesting_typedef (MonoImage *meta, guint32 table_index, guint32 start_index);
-
-MonoClass** mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 table_index, guint *count);
-
-guint32 mono_metadata_events_from_typedef (MonoImage *meta, guint32 table_index, guint *end_idx);
-guint32 mono_metadata_methods_from_event (MonoImage *meta, guint32 table_index, guint *end);
-guint32 mono_metadata_properties_from_typedef (MonoImage *meta, guint32 table_index, guint *end);
-guint32 mono_metadata_methods_from_property (MonoImage *meta, guint32 table_index, guint *end);
-guint32 mono_metadata_packing_from_typedef (MonoImage *meta, guint32 table_index, guint32 *packing, guint32 *size);
-const char* mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field);
-guint32 mono_metadata_custom_attrs_from_index (MonoImage *meta, guint32 cattr_index);
+const char *mono_metadata_string_heap (MonoImage *meta, uint32_t table_index);
+const char *mono_metadata_blob_heap (MonoImage *meta, uint32_t table_index);
+const char *mono_metadata_user_string (MonoImage *meta, uint32_t table_index);
+const char *mono_metadata_guid_heap (MonoImage *meta, uint32_t table_index);
+
+uint32_t mono_metadata_typedef_from_field (MonoImage *meta, uint32_t table_index);
+uint32_t mono_metadata_typedef_from_method (MonoImage *meta, uint32_t table_index);
+uint32_t mono_metadata_nested_in_typedef (MonoImage *meta, uint32_t table_index);
+uint32_t mono_metadata_nesting_typedef (MonoImage *meta, uint32_t table_index, uint32_t start_index);
+
+MonoClass** mono_metadata_interfaces_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *count);
+
+uint32_t mono_metadata_events_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *end_idx);
+uint32_t mono_metadata_methods_from_event (MonoImage *meta, uint32_t table_index, unsigned int *end);
+uint32_t mono_metadata_properties_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *end);
+uint32_t mono_metadata_methods_from_property (MonoImage *meta, uint32_t table_index, unsigned int *end);
+uint32_t mono_metadata_packing_from_typedef (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size);
+const char* mono_metadata_get_marshal_info (MonoImage *meta, uint32_t idx, mono_bool is_field);
+uint32_t mono_metadata_custom_attrs_from_index (MonoImage *meta, uint32_t cattr_index);
MonoMarshalSpec *mono_metadata_parse_marshal_spec (MonoImage *image, const char *ptr);
void mono_metadata_free_marshal_spec (MonoMarshalSpec *spec);
-guint32 mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx);
+uint32_t mono_metadata_implmap_from_method (MonoImage *meta, uint32_t method_idx);
void mono_metadata_field_info (MonoImage *meta,
- guint32 table_index,
- guint32 *offset,
- guint32 *rva,
+ uint32_t table_index,
+ uint32_t *offset,
+ uint32_t *rva,
MonoMarshalSpec **marshal_spec);
-guint32 mono_metadata_get_constant_index (MonoImage *meta, guint32 token, guint32 hint);
+uint32_t mono_metadata_get_constant_index (MonoImage *meta, uint32_t token, uint32_t hint);
/*
* Functions to extract information from the Blobs
*/
-guint32 mono_metadata_decode_value (const char *ptr,
+uint32_t mono_metadata_decode_value (const char *ptr,
const char **rptr);
-gint32 mono_metadata_decode_signed_value (const char *ptr, const char **rptr);
+int32_t mono_metadata_decode_signed_value (const char *ptr, const char **rptr);
-guint32 mono_metadata_decode_blob_size (const char *ptr,
+uint32_t mono_metadata_decode_blob_size (const char *ptr,
const char **rptr);
-void mono_metadata_encode_value (guint32 value, char *bug, char **endbuf);
+void mono_metadata_encode_value (uint32_t value, char *bug, char **endbuf);
#define MONO_OFFSET_IN_CLAUSE(clause,offset) \
((clause)->try_offset <= (offset) && (offset) < ((clause)->try_offset + (clause)->try_len))
@@ -291,13 +291,13 @@ void mono_metadata_encode_value (guint32 value, char *bug, char **endbuf);
((clause)->flags == MONO_EXCEPTION_CLAUSE_FILTER && (clause)->data.filter_offset <= (offset) && (offset) < ((clause)->handler_offset))
typedef struct {
- guint32 flags;
- guint32 try_offset;
- guint32 try_len;
- guint32 handler_offset;
- guint32 handler_len;
+ uint32_t flags;
+ uint32_t try_offset;
+ uint32_t try_len;
+ uint32_t handler_offset;
+ uint32_t handler_len;
union {
- guint32 filter_offset;
+ uint32_t filter_offset;
MonoClass *catch_class;
} data;
} MonoExceptionClause;
@@ -322,9 +322,9 @@ typedef struct {
struct _MonoArrayType {
MonoClass *eklass;
- guint8 rank;
- guint8 numsizes;
- guint8 numlobounds;
+ uint8_t rank;
+ uint8_t numsizes;
+ uint8_t numlobounds;
int *sizes;
int *lobounds;
};
@@ -351,27 +351,6 @@ struct _MonoType {
#define MONO_SIZEOF_TYPE (offsetof (struct _MonoType, modifiers))
-/*
- * This structure is an internal runtime detail: use the mono_signature_*
- * accessors below, because it will go away from the public header.
- */
-struct _MonoMethodSignature {
- unsigned int hasthis : 1;
- unsigned int explicit_this : 1;
- unsigned int call_convention : 6;
- unsigned int pinvoke : 1;
- unsigned int ref_count : 23;
- guint16 param_count;
- gint16 sentinelpos;
- unsigned int generic_param_count : 30;
- unsigned int is_inflated : 1;
- unsigned int has_type_parameters : 1;
- MonoType *ret;
- MonoType *params [MONO_ZERO_LEN_ARRAY];
-};
-
-#define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
-
typedef struct _MonoMethodHeader MonoMethodHeader;
typedef enum {
@@ -383,7 +362,7 @@ typedef enum {
MONO_PARSE_FIELD
} MonoParseTypeMode;
-gboolean
+mono_bool
mono_type_is_byref (MonoType *type);
int
@@ -405,30 +384,30 @@ MonoType*
mono_type_get_ptr_type (MonoType *type);
MonoClass*
-mono_type_get_modifiers (MonoType *type, gboolean *is_required, gpointer *iter);
+mono_type_get_modifiers (MonoType *type, mono_bool *is_required, void **iter);
MonoType*
mono_signature_get_return_type (MonoMethodSignature *sig);
MonoType*
-mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter);
+mono_signature_get_params (MonoMethodSignature *sig, void **iter);
-guint32
+uint32_t
mono_signature_get_param_count (MonoMethodSignature *sig);
-guint32
+uint32_t
mono_signature_get_call_conv (MonoMethodSignature *sig);
int
mono_signature_vararg_start (MonoMethodSignature *sig);
-gboolean
+mono_bool
mono_signature_is_instance (MonoMethodSignature *sig);
-gboolean
+mono_bool
mono_signature_explicit_this (MonoMethodSignature *sig);
-guint32 mono_metadata_parse_typedef_or_ref (MonoImage *m,
+uint32_t mono_metadata_parse_typedef_or_ref (MonoImage *m,
const char *ptr,
const char **rptr);
int mono_metadata_parse_custom_mod (MonoImage *m,
@@ -455,58 +434,58 @@ MonoType *mono_metadata_parse_field_type (MonoImage *m,
const char *ptr,
const char **rptr);
MonoType *mono_type_create_from_typespec (MonoImage *image,
- guint32 type_spec);
+ uint32_t type_spec);
void mono_metadata_free_type (MonoType *type);
int mono_type_size (MonoType *type,
int *alignment);
int mono_type_stack_size (MonoType *type,
int *alignment);
-gboolean mono_type_generic_inst_is_valuetype (MonoType *type);
-gboolean mono_metadata_generic_class_is_valuetype (MonoGenericClass *gclass);
-guint mono_metadata_generic_class_hash (MonoGenericClass *gclass);
-gboolean mono_metadata_generic_class_equal (MonoGenericClass *g1, MonoGenericClass *g2);
+mono_bool mono_type_generic_inst_is_valuetype (MonoType *type);
+mono_bool mono_metadata_generic_class_is_valuetype (MonoGenericClass *gclass);
+unsigned int mono_metadata_generic_class_hash (MonoGenericClass *gclass);
+mono_bool mono_metadata_generic_class_equal (MonoGenericClass *g1, MonoGenericClass *g2);
-guint mono_metadata_type_hash (MonoType *t1);
-gboolean mono_metadata_type_equal (MonoType *t1, MonoType *t2);
+unsigned int mono_metadata_type_hash (MonoType *t1);
+mono_bool mono_metadata_type_equal (MonoType *t1, MonoType *t2);
-MonoMethodSignature *mono_metadata_signature_alloc (MonoImage *image, guint32 nparams);
+MonoMethodSignature *mono_metadata_signature_alloc (MonoImage *image, uint32_t nparams);
MonoMethodSignature *mono_metadata_signature_dup (MonoMethodSignature *sig);
MonoMethodSignature *mono_metadata_parse_signature (MonoImage *image,
- guint32 token);
+ uint32_t token);
MonoMethodSignature *mono_metadata_parse_method_signature (MonoImage *m,
int def,
const char *ptr,
const char **rptr);
void mono_metadata_free_method_signature (MonoMethodSignature *method);
-gboolean mono_metadata_signature_equal (MonoMethodSignature *sig1,
+mono_bool mono_metadata_signature_equal (MonoMethodSignature *sig1,
MonoMethodSignature *sig2);
-guint mono_signature_hash (MonoMethodSignature *sig);
+unsigned int mono_signature_hash (MonoMethodSignature *sig);
MonoMethodHeader *mono_metadata_parse_mh (MonoImage *m, const char *ptr);
void mono_metadata_free_mh (MonoMethodHeader *mh);
/* MonoMethodHeader acccessors */
const unsigned char*
-mono_method_header_get_code (MonoMethodHeader *header, guint32* code_size, guint32* max_stack);
+mono_method_header_get_code (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack);
MonoType**
-mono_method_header_get_locals (MonoMethodHeader *header, guint32* num_locals, gboolean *init_locals);
+mono_method_header_get_locals (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals);
int
mono_method_header_get_num_clauses (MonoMethodHeader *header);
int
-mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, gpointer *iter, MonoExceptionClause *clause);
+mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause);
-guint32
+uint32_t
mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
- gboolean as_field, gboolean unicode, MonoMarshalConv *conv);
+ mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv);
/*
* Makes a token based on a table and an index
@@ -526,23 +505,23 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
#define mono_metadata_token_code(token) ((token & 0xff000000))
-guint32 mono_metadata_token_from_dor (guint32 dor_index);
+uint32_t mono_metadata_token_from_dor (uint32_t dor_index);
-char *mono_guid_to_string (const guint8 *guid);
+char *mono_guid_to_string (const uint8_t *guid);
-guint32 mono_metadata_declsec_from_index (MonoImage *meta, guint32 idx);
+uint32_t mono_metadata_declsec_from_index (MonoImage *meta, uint32_t idx);
-guint32 mono_metadata_translate_token_index (MonoImage *image, int table, guint32 idx);
+uint32_t mono_metadata_translate_token_index (MonoImage *image, int table, uint32_t idx);
void mono_metadata_decode_table_row (MonoImage *image, int table,
int idx,
- guint32 *res,
+ uint32_t *res,
int res_size);
-guint32 mono_metadata_decode_table_row_col (MonoImage *image, int table,
+uint32_t mono_metadata_decode_table_row_col (MonoImage *image, int table,
int idx,
- guint col);
+ unsigned int col);
-G_END_DECLS
+MONO_END_DECLS
#endif /* __MONO_METADATA_H__ */
View
7 mono/metadata/mono-config.h
@@ -8,7 +8,10 @@
#ifndef __MONO_METADATA_CONFIG_H__
#define __MONO_METADATA_CONFIG_H__
-G_BEGIN_DECLS
+#include <mono/utils/mono-publib.h>
+#include <mono/metadata/image.h>
+
+MONO_BEGIN_DECLS
const char* mono_get_config_dir (void);
void mono_set_config_dir (const char *dir);
@@ -21,7 +24,7 @@ void mono_config_parse_memory (const char *buffer);
const char* mono_config_string_for_assembly_file (const char *filename);
-G_END_DECLS
+MONO_END_DECLS
#endif /* __MONO_METADATA_CONFIG_H__ */
View
79 mono/metadata/mono-debug.h
@@ -6,7 +6,8 @@
#ifndef __MONO_DEBUG_H__
#define __MONO_DEBUG_H__
-#include <glib.h>
+#include <glib.h> /* GHashTable dep below */
+#include <mono/utils/mono-publib.h>
#include <mono/metadata/image.h>
#include <mono/metadata/appdomain.h>
@@ -43,13 +44,13 @@ typedef enum {
*/
struct _MonoDebugList {
MonoDebugList *next;
- gconstpointer data;
+ const void* data;
};
struct _MonoSymbolTable {
guint64 magic;
- guint32 version;
- guint32 total_size;
+ uint32_t version;
+ uint32_t total_size;
/*
* Corlib and metadata info.
@@ -65,38 +66,38 @@ struct _MonoSymbolTable {
};
struct _MonoDebugHandle {
- guint32 index;
+ uint32_t index;
char *image_file;
MonoImage *image;
MonoDebugDataTable *type_table;
MonoSymbolFile *symfile;
};
struct _MonoDebugMethodJitInfo {
- const guint8 *code_start;
- guint32 code_size;
- guint32 prologue_end;
- guint32 epilogue_begin;
- const guint8 *wrapper_addr;
- guint32 num_line_numbers;
+ const mono_byte *code_start;
+ uint32_t code_size;
+ uint32_t prologue_end;
+ uint32_t epilogue_begin;
+ const mono_byte *wrapper_addr;
+ uint32_t num_line_numbers;
MonoDebugLineNumberEntry *line_numbers;
- guint32 num_params;
+ uint32_t num_params;
MonoDebugVarInfo *this_var;
MonoDebugVarInfo *params;
- guint32 num_locals;
+ uint32_t num_locals;
MonoDebugVarInfo *locals;
};
struct _MonoDebugMethodAddressList {
- guint32 size;
- guint32 count;
- guint8 data [MONO_ZERO_LEN_ARRAY];
+ uint32_t size;
+ uint32_t count;
+ mono_byte data [MONO_ZERO_LEN_ARRAY];
};
struct _MonoDebugSourceLocation {
- gchar *source_file;
- guint32 row, column;
- guint32 il_offset;
+ char *source_file;
+ uint32_t row, column;
+ uint32_t il_offset;
};
/*
@@ -120,11 +121,11 @@ struct _MonoDebugSourceLocation {
#define MONO_DEBUG_VAR_ADDRESS_MODE_DEAD 0x30000000
struct _MonoDebugVarInfo {
- guint32 index;
- guint32 offset;
- guint32 size;
- guint32 begin_scope;
- guint32 end_scope;
+ uint32_t index;
+ uint32_t offset;
+ uint32_t size;
+ uint32_t begin_scope;
+ uint32_t end_scope;
MonoType *type;
};
@@ -135,22 +136,22 @@ struct _MonoDebugVarInfo {
extern MonoSymbolTable *mono_symbol_table;
extern MonoDebugFormat mono_debug_format;
extern GHashTable *mono_debug_handles;
-extern gint32 mono_debug_debugger_version;
-extern gint32 _mono_debug_using_mono_debugger;
+extern int32_t mono_debug_debugger_version;
+extern int32_t _mono_debug_using_mono_debugger;
-void mono_debug_list_add (MonoDebugList **list, gconstpointer data);
-void mono_debug_list_remove (MonoDebugList **list, gconstpointer data);
+void mono_debug_list_add (MonoDebugList **list, const void* data);
+void mono_debug_list_remove (MonoDebugList **list, const void* data);
void mono_debug_init (MonoDebugFormat format);
-void mono_debug_open_image_from_memory (MonoImage *image, const guint8 *raw_contents, int size);
+void mono_debug_open_image_from_memory (MonoImage *image, const mono_byte *raw_contents, int size);
void mono_debug_cleanup (void);
void mono_debug_close_image (MonoImage *image);
void mono_debug_domain_unload (MonoDomain *domain);
void mono_debug_domain_create (MonoDomain *domain);
-gboolean mono_debug_using_mono_debugger (void);
+mono_bool mono_debug_using_mono_debugger (void);
MonoDebugMethodAddress *
mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain);
@@ -169,7 +170,7 @@ mono_debug_free_method_jit_info (MonoDebugMethodJitInfo *jit);
void
-mono_debug_add_delegate_trampoline (gpointer code, int size);
+mono_debug_add_delegate_trampoline (void* code, int size);
int
mono_debug_lookup_locals (MonoMethod *method, char ***names, int **indexes);
@@ -179,16 +180,16 @@ mono_debug_lookup_locals (MonoMethod *method, char ***names, int **indexes);
*/
MonoDebugSourceLocation *
-mono_debug_lookup_source_location (MonoMethod *method, guint32 address, MonoDomain *domain);
+mono_debug_lookup_source_location (MonoMethod *method, uint32_t address, MonoDomain *domain);
-gint32
-mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, guint32 native_offset);
+int32_t
+mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, uint32_t native_offset);
void
mono_debug_free_source_location (MonoDebugSourceLocation *location);
-gchar *
-mono_debug_print_stack_frame (MonoMethod *method, guint32 native_offset, MonoDomain *domain);
+char *
+mono_debug_print_stack_frame (MonoMethod *method, uint32_t native_offset, MonoDomain *domain);
/*
* Mono Debugger support functions
@@ -197,9 +198,9 @@ mono_debug_print_stack_frame (MonoMethod *method, guint32 native_offset, MonoDom
*/
int mono_debugger_method_has_breakpoint (MonoMethod *method);
-int mono_debugger_insert_breakpoint (const gchar *method_name, gboolean include_namespace);
+int mono_debugger_insert_breakpoint (const char *method_name, mono_bool include_namespace);
-void mono_set_is_debugger_attached (gboolean attached);
-gboolean mono_is_debugger_attached (void);
+void mono_set_is_debugger_attached (mono_bool attached);
+mono_bool mono_is_debugger_attached (void);
#endif /* __MONO_DEBUG_H__ */
View
8 mono/metadata/mono-gc.h
@@ -7,17 +7,17 @@
#include <mono/metadata/object.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
void mono_gc_collect (int generation);
int mono_gc_max_generation (void);
int mono_gc_get_generation (MonoObject *object);
int mono_gc_collection_count (int generation);
-gint64 mono_gc_get_used_size (void);
-gint64 mono_gc_get_heap_size (void);
+int64_t mono_gc_get_used_size (void);
+int64_t mono_gc_get_heap_size (void);
int mono_gc_invoke_finalizers (void);
-G_END_DECLS
+MONO_END_DECLS
#endif /* __METADATA_MONO_GC_H__ */
View
102 mono/metadata/object.h
@@ -3,9 +3,9 @@
#include <mono/metadata/class.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
-typedef guchar MonoBoolean;
+typedef mono_byte MonoBoolean;
typedef struct _MonoReflectionMethod MonoReflectionMethod;
typedef struct _MonoReflectionAssembly MonoReflectionAssembly;
@@ -29,15 +29,15 @@ typedef struct {
} MonoObject;
#ifdef MONO_BIG_ARRAYS
-typedef guint64 mono_array_size_t;
-typedef gint64 mono_array_lower_bound_t;
+typedef uint64_t mono_array_size_t;
+typedef int64_t mono_array_lower_bound_t;
#define MONO_ARRAY_MAX_INDEX G_MAXINT64
#define MONO_ARRAY_MAX_SIZE G_MAXUINT64
#else
-typedef guint32 mono_array_size_t;
-typedef gint32 mono_array_lower_bound_t;
-#define MONO_ARRAY_MAX_INDEX ((gint32) 0x7fffffff)
-#define MONO_ARRAY_MAX_SIZE ((guint32) 0xffffffff)
+typedef uint32_t mono_array_size_t;
+typedef int32_t mono_array_lower_bound_t;
+#define MONO_ARRAY_MAX_INDEX ((int32_t) 0x7fffffff)
+#define MONO_ARRAY_MAX_SIZE ((uint32_t) 0xffffffff)
#endif
typedef struct {
@@ -57,13 +57,13 @@ typedef struct {
typedef struct {
MonoObject object;
- gint32 length;
- gunichar2 chars [MONO_ZERO_LEN_ARRAY];
+ int32_t length;
+ mono_unichar2 chars [MONO_ZERO_LEN_ARRAY];
} MonoString;
typedef MonoObject* (*MonoInvokeFunc) (MonoMethod *method, void *obj, void **params, MonoObject **exc);
-typedef gpointer (*MonoCompileFunc) (MonoMethod *method);
-typedef void (*MonoMainThreadFunc) (gpointer user_data);
+typedef void* (*MonoCompileFunc) (MonoMethod *method);
+typedef void (*MonoMainThreadFunc) (void* user_data);
#define mono_object_class(obj) (((MonoObject*)(obj))->vtable->klass)
#define mono_object_domain(obj) (((MonoObject*)(obj))->vtable->domain)
@@ -79,7 +79,7 @@ typedef void (*MonoMainThreadFunc) (gpointer user_data);
} while (0)
#define mono_array_length(array) ((array)->max_length)
-#define mono_array_addr(array,type,index) ((type*)(gpointer) mono_array_addr_with_size (array, sizeof (type), index))
+#define mono_array_addr(array,type,index) ((type*)(void*) mono_array_addr_with_size (array, sizeof (type), index))
#define mono_array_addr_with_size(array,size,index) ( ((char*)(array)->vector) + (size) * (index) )
#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) )
#define mono_array_set(array,type,index,value) \
@@ -89,18 +89,18 @@ typedef void (*MonoMainThreadFunc) (gpointer user_data);
} while (0)
#define mono_array_setref(array,index,value) \
do { \
- gpointer *__p = (gpointer *) mono_array_addr ((array), gpointer, (index)); \
+ void **__p = (void **) mono_array_addr ((array), void*, (index)); \
mono_gc_wbarrier_set_arrayref ((array), __p, (MonoObject*)(value)); \
/* *__p = (value);*/ \
} while (0)
#define mono_array_memcpy_refs(dest,destidx,src,srcidx,count) \
do { \
- gpointer *__p = (gpointer *) mono_array_addr ((dest), gpointer, (destidx)); \
- gpointer *__s = mono_array_addr ((src), gpointer, (srcidx)); \
+ void **__p = (void **) mono_array_addr ((dest), void*, (destidx)); \
+ void **__s = mono_array_addr ((src), void*, (srcidx)); \
mono_gc_wbarrier_arrayref_copy (__p, __s, (count)); \
} while (0)
-#define mono_string_chars(s) ((gunichar2*)(s)->chars)
+#define mono_string_chars(s) ((mono_unichar2*)(s)->chars)
#define mono_string_length(s) ((s)->length)
MonoObject *
@@ -117,7 +117,7 @@ MonoObject *
mono_object_new_alloc_specific (MonoVTable *vtable);
MonoObject *
-mono_object_new_from_token (MonoDomain *domain, MonoImage *image, guint32 token);
+mono_object_new_from_token (MonoDomain *domain, MonoImage *image, uint32_t token);
MonoArray*
mono_array_new (MonoDomain *domain, MonoClass *eclass, mono_array_size_t n);
@@ -133,13 +133,13 @@ MonoArray*
mono_array_clone (MonoArray *array);
MonoString*
-mono_string_new_utf16 (MonoDomain *domain, const guint16 *text, gint32 len);
+mono_string_new_utf16 (MonoDomain *domain, const mono_unichar2 *text, int32_t len);
MonoString*
-mono_string_new_size (MonoDomain *domain, gint32 len);
+mono_string_new_size (MonoDomain *domain, int32_t len);
MonoString*
-mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 str_index);
+mono_ldstr (MonoDomain *domain, MonoImage *image, uint32_t str_index);
MonoString*
mono_string_is_interned (MonoString *str);
@@ -154,42 +154,42 @@ MonoString*
mono_string_new_wrapper (const char *text);
MonoString*
-mono_string_new_len (MonoDomain *domain, const char *text, guint length);
+mono_string_new_len (MonoDomain *domain, const char *text, unsigned int length);
char *
mono_string_to_utf8 (MonoString *string_obj);
-gunichar2 *
+mono_unichar2 *
mono_string_to_utf16 (MonoString *string_obj);
MonoString *
-mono_string_from_utf16 (gunichar2 *data);
+mono_string_from_utf16 (mono_unichar2 *data);
-gboolean
+mono_bool
mono_string_equal (MonoString *s1, MonoString *s2);
-guint
+unsigned int
mono_string_hash (MonoString *s);
int
mono_object_hash (MonoObject* obj);
MonoObject *
-mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer val);
+mono_value_box (MonoDomain *domain, MonoClass *klass, void* val);
void
-mono_value_copy (gpointer dest, gpointer src, MonoClass *klass);
+mono_value_copy (void* dest, void* src, MonoClass *klass);
void
-mono_value_copy_array (MonoArray *dest, int dest_idx, gpointer src, int count);
+mono_value_copy_array (MonoArray *dest, int dest_idx, void* src, int count);
MonoDomain*
mono_object_get_domain (MonoObject *obj);
MonoClass*
mono_object_get_class (MonoObject *obj);
-gpointer
+void*
mono_object_unbox (MonoObject *obj);
MonoObject *
@@ -204,13 +204,13 @@ mono_object_isinst_mbyref (MonoObject *obj, MonoClass *klass);
MonoObject *
mono_object_castclass_mbyref (MonoObject *obj, MonoClass *klass);
-gboolean
-mono_monitor_try_enter (MonoObject *obj, guint32 ms);
+mono_bool
+mono_monitor_try_enter (MonoObject *obj, uint32_t ms);
-gboolean
+mono_bool
mono_monitor_enter (MonoObject *obj);
-guint
+unsigned int
mono_object_get_size (MonoObject *o);
void
@@ -243,7 +243,7 @@ MonoObject*
mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
MonoObject **exc);
-gpointer
+void*
mono_method_get_unmanaged_thunk (MonoMethod *method);
MonoArray*
@@ -252,7 +252,7 @@ mono_runtime_get_main_args (void);
void
mono_runtime_exec_managed_code (MonoDomain *domain,
MonoMainThreadFunc main_func,
- gpointer main_args);
+ void* main_args);
int
mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
@@ -262,14 +262,14 @@ int
mono_runtime_exec_main (MonoMethod *method, MonoArray *args,
MonoObject **exc);
-gpointer
-mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer *res);
+void*
+mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res);
MonoObject *
mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field);
void
-mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer val);
+mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val);
void
mono_store_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg);
@@ -280,7 +280,7 @@ mono_unhandled_exception (MonoObject *exc);
void
mono_print_unhandled_exception (MonoObject *exc);
-gpointer
+void*
mono_compile_method (MonoMethod *method);
MonoRemoteClass*
@@ -322,21 +322,21 @@ mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObjec
* mono_gchandle_get_target () can be used to get the object referenced by both kinds
* of handle: for a weakref handle, if an object has been collected, it will return NULL.
*/
-guint32 mono_gchandle_new (MonoObject *obj, gboolean pinned);
-guint32 mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection);
-MonoObject* mono_gchandle_get_target (guint32 gchandle);
-void mono_gchandle_free (guint32 gchandle);
+uint32_t mono_gchandle_new (MonoObject *obj, mono_bool pinned);
+uint32_t mono_gchandle_new_weakref (MonoObject *obj, mono_bool track_resurrection);
+MonoObject* mono_gchandle_get_target (uint32_t gchandle);
+void mono_gchandle_free (uint32_t gchandle);
/* GC write barriers support */
-void mono_gc_wbarrier_set_field (MonoObject *obj, gpointer field_ptr, MonoObject* value);
-void mono_gc_wbarrier_set_arrayref (MonoArray *arr, gpointer slot_ptr, MonoObject* value);
-void mono_gc_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count);
-void mono_gc_wbarrier_generic_store (gpointer ptr, MonoObject* value);
-void mono_gc_wbarrier_generic_nostore (gpointer ptr);
-void mono_gc_wbarrier_value_copy (gpointer dest, gpointer src, int count, MonoClass *klass);
+void mono_gc_wbarrier_set_field (MonoObject *obj, void* field_ptr, MonoObject* value);
+void mono_gc_wbarrier_set_arrayref (MonoArray *arr, void* slot_ptr, MonoObject* value);
+void mono_gc_wbarrier_arrayref_copy (void* dest_ptr, void* src_ptr, int count);
+void mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value);
+void mono_gc_wbarrier_generic_nostore (void* ptr);
+void mono_gc_wbarrier_value_copy (void* dest, void* src, int count, MonoClass *klass);
void mono_gc_wbarrier_object_copy (MonoObject* obj, MonoObject *src);
-G_END_DECLS
+MONO_END_DECLS
#endif
View
6 mono/metadata/opcodes.c
@@ -37,7 +37,7 @@ static const struct msgstr_t {
#include "mono/cil/opcode.def"
#undef OPDEF
};
-static const gint16 opidx [] = {
+static const int16_t opidx [] = {
#define OPDEF(a,b,c,d,e,f,g,h,i,j) [MONO_ ## a] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)),
#include "mono/cil/opcode.def"
#undef OPDEF
@@ -66,10 +66,10 @@ mono_opcode_name (int opcode)
#endif
MonoOpcodeEnum
-mono_opcode_value (const guint8 **ip, const guint8 *end)
+mono_opcode_value (const mono_byte **ip, const mono_byte *end)
{
MonoOpcodeEnum res;
- const guint8 *p = *ip;
+ const mono_byte *p = *ip;
if (p >= end)
return -1;
View
9 mono/metadata/opcodes.h
@@ -10,9 +10,9 @@
* (C) 2002 Ximian, Inc.
*/
-#include <glib.h>
+#include <mono/utils/mono-publib.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
#define MONO_CUSTOM_PREFIX 0xf0
@@ -68,8 +68,9 @@ const char*
mono_opcode_name (int opcode);
MonoOpcodeEnum
-mono_opcode_value (const guint8 **ip, const guint8 *end);
+mono_opcode_value (const mono_byte **ip, const mono_byte *end);
-G_END_DECLS
+MONO_END_DECLS
#endif /* __MONO_METADATA_OPCODES_H__ */
+
View
1 mono/metadata/profiler-private.h
@@ -4,6 +4,7 @@
#include <mono/metadata/profiler.h>
#include "mono/utils/mono-compiler.h"
+#include <glib.h>
extern MonoProfileFlags mono_profiler_events;
View
20 mono/metadata/profiler.h
@@ -4,7 +4,7 @@
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
-G_BEGIN_DECLS
+MONO_BEGIN_DECLS
#define MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH 128