+*******************************************************************************/
+
+methodinfo *class_findmethod_approx(classinfo *c, utf *name, utf *desc)
+{
+ s4 i;
+
+ for (i = 0; i < c->methodscount; i++) {
+ if (c->methods[i].name == name) {
+ utf *meth_descr = c->methods[i].descriptor;
+
+ if (desc == NULL)
+ /* ignore type */
+ return &(c->methods[i]);
+
+ if (desc->blength <= meth_descr->blength) {
+ /* current position in utf text */
+ char *desc_utf_ptr = desc->text;
+ char *meth_utf_ptr = meth_descr->text;
+ /* points behind utf strings */
+ char *desc_end = utf_end(desc);
+ char *meth_end = utf_end(meth_descr);
+ char ch;
+
+ /* compare argument types */
+ while (desc_utf_ptr < desc_end && meth_utf_ptr < meth_end) {
+
+ if ((ch = *desc_utf_ptr++) != (*meth_utf_ptr++))
+ break; /* no match */
+
+ if (ch == ')')
+ return &(c->methods[i]); /* all parameter types equal */
+ }
+ }
+ }
+ }
+
+ return NULL;
+}
+
+
+/***************** Function: class_resolvemethod_approx ***********************
+
+ Searches a class and every super class for a method (without paying
+ attention to the return value)
+
+*******************************************************************************/
+
+methodinfo *class_resolvemethod_approx(classinfo *c, utf *name, utf *desc)
+{
+ while (c) {
+ /* search for method (ignore returntype) */
+ methodinfo *m = class_findmethod_approx(c, name, desc);
+ /* method found */
+ if (m) return m;
+ /* search superclass */
+ c = c->super;
+ }
+
+ return NULL;
+}
+
+
+/************************* Function: class_resolvemethod ***********************
+
+ Searches a class and every super class for a method.
+
+*******************************************************************************/
+
+methodinfo *class_resolvemethod(classinfo *c, utf *name, utf *desc)
+{
+ /*log_text("Trying to resolve a method");
+ utf_display(c->name);
+ utf_display(name);
+ utf_display(desc);*/
+
+ while (c) {
+ /*log_text("Looking in:");
+ utf_display(c->name);*/
+ methodinfo *m = class_findmethod(c, name, desc);
+ if (m) return m;
+ /* search superclass */
+ c = c->super;
+ }
+ /*log_text("method not found:");*/
+
+ return NULL;
+}
+
+
+/****************** Function: class_resolveinterfacemethod_int ****************
+
+ Internally used helper function. Do not use this directly.
+
+*******************************************************************************/
+
+static
+methodinfo *class_resolveinterfacemethod_int(classinfo *c, utf *name, utf *desc)
+{
+ methodinfo *mi;
+ int i;
+
+ mi = class_findmethod(c,name,desc);
+ if (mi)
+ return mi;
+
+ /* try the superinterfaces */
+ for (i=0; i<c->interfacescount; ++i) {
+ mi = class_resolveinterfacemethod_int(c->interfaces[i],name,desc);
+ if (mi)
+ return mi;
+ }
+
+ return NULL;
+}
+
+/******************** Function: class_resolveinterfacemethod ******************
+
+ Resolves a reference from REFERER to a method with NAME and DESC in
+ interface C.
+
+ If the method cannot be resolved the return value is NULL. If EXCEPT is
+ true *exceptionptr is set, too.
+
+*******************************************************************************/
+
+methodinfo *class_resolveinterfacemethod(classinfo *c, utf *name, utf *desc,
+ classinfo *referer, bool except)
+{
+ methodinfo *mi;
+
+ /* XXX resolve class c */
+ /* XXX check access from REFERER to C */
+
+ if (!(c->flags & ACC_INTERFACE)) {
+ if (except)
+ *exceptionptr =
+ new_exception(string_java_lang_IncompatibleClassChangeError);