2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: OOP function OOP_GetMethodID
9 /*****************************************************************************
12 #include <proto/exec.h>
13 #include <proto/oop.h>
14 #include <exec/memory.h>
15 #include <aros/libcall.h>
17 #include <aros/debug.h>
20 AROS_LH2(OOP_MethodID
, OOP_GetMethodID
,
23 AROS_LHA(STRPTR
, interfaceID
, A0
),
24 AROS_LHA(ULONG
, methodOffset
, D0
),
27 struct Library
*, OOPBase
, 7, OOP
)
30 Maps a globally unique full method ID
31 (Interface ID + method offset) into
35 interfaceID - globally unique interface identifier.
36 methodOffset - offset to the method in this interface.
40 Numeric method identifier that is unique for this machine.
54 ******************************************************************************/
57 AROS_LIBBASE_EXT_DECL(struct Library
*,OOPBase
)
61 struct iid_bucket
*idb
;
62 struct HashTable
*iidtable
= GetOBase(OOPBase
)->ob_IIDTable
;
64 EnterFunc(bug("OOP_GetMethodID(interfaceID=%s, methodOffset=%ld)\n",
65 interfaceID
, methodOffset
));
67 /* #warning doesn't handle failures. (Should throw exception of some kind)
69 idb
= (struct iid_bucket
*)iidtable
->Lookup(iidtable
, (IPTR
)interfaceID
, GetOBase(OOPBase
));
72 D(bug("Got mid %ld\n", mid
));
73 /* Should throw eception here if metodbase == -1UL */
74 mid
= idb
->methodbase
+ methodOffset
;
76 ReturnInt ("OOP_GetMethodID", ULONG
, mid
);
79 /* Should throw exception here */
81 /* The ID must be left-shifted to make place for method offsets */
82 ReturnInt ("OOP_GetMethodID", ULONG
, -1UL);
86 } /* OOP_GetMethodID */