[Mono-bugs] [Bug 582899] Missing bits in the 2-0 embedded API

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 25 12:16:55 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=582899

http://bugzilla.novell.com/show_bug.cgi?id=582899#c2


Robert Jordan <robertj at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #2 from Robert Jordan <robertj at gmx.net> 2010-02-25 17:16:55 UTC ---
More inclusion candidates:

mono_reflection_type_get_handle (), currently in object-internals.h
W/out this function one has to get the handle from System.Type.TypeHandle.Value
using runtime_invoke.

mono_class_is_nullable (), currently in class-internals.h


Nice to have, already public for mdb but w/out public prototypes:

mono_object_describe        (MonoObject *obj);
mono_object_describe_fields (MonoObject *obj);
mono_class_describe_statics (MonoClass* klass);


Missing bits:

- mono_get_delegate_class () { return mono_defaults.delegate_class; }
- mono_get_systemtype_class () { return mono_defaults.systemtype_class; }


/* similar to all other mono_class_get_xyz_from_name */ 
MonoEvent *
mono_class_get_event_from_name (MonoClass *clazz, const char *name)
{
    gpointer iter;
    MonoEvent *e;

    while (clazz) {
        iter = NULL;
        while ((e = mono_class_get_events (clazz, &iter))) {
            if (strcmp (name, mono_event_get_name (e)) == 0)
                return e;
        }
        clazz = mono_class_get_parent (clazz);
    }
    return NULL;
}


Nice to have:

/* enumerates all classes of the specified assembly */
MonoClass*
mono_assembly_get_classes (MonoAssembly *assembly, gpointer *iter)
{
    MonoImage *image;
    int num_types;
    gssize *index;

    if (!iter)
        return NULL;

    index = (gssize *) iter;

    /* skip the <Module> */
    if (!*index)
        *index = 1;

    image = mono_assembly_get_image (assembly);
    num_types = mono_image_get_table_rows (image, MONO_TABLE_TYPEDEF);

    if (*index < num_types) {
        (*index)++;
        return mono_class_get (image, *index | MONO_TOKEN_TYPE_DEF);
    } else {
        *index = 0;
        return NULL;
    }
}

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mono-bugs mailing list