Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / metadata / metadata.c
index 953c2377a060439f863953aa58fa6c9743810065..3dea73e16d7b7f6991a04bc627312eb2ad75ac9b 100644 (file)
@@ -2588,6 +2588,25 @@ mono_metadata_methods_from_property   (MonoImage *meta, guint32 index, guint *en
        return start;
 }
 
+guint32
+mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx)
+{
+       locator_t loc;
+       MonoTableInfo *tdef  = &meta->tables [MONO_TABLE_IMPLMAP];
+
+       if (!tdef->base)
+               return 0;
+
+       loc.t = tdef;
+       loc.col_idx = MONO_IMPLMAP_MEMBER;
+       loc.idx = ((method_idx + 1) << MEMBERFORWD_BITS) | MEMBERFORWD_METHODDEF;
+
+       if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+               return 0;
+
+       return loc.result + 1;
+}
+
 /**
  * @image: context where the image is created
  * @type_spec:  typespec token